Subject |
Author |
Date |
|
Keith Bradbury
|
Jun 8, 2005 - 9:06 AM
|
for each document, I want to have a split frame with 2 panes. In the top pane, I need to put a grid. The bottom pane is for drawing. How can I do use the grid from prof-uis in the top pane?
|
|
Technical Support
|
Jun 9, 2005 - 8:35 AM
|
You code is correct but the grid window is created with the width and height set to zero, so it is not visible. So, you need just to resize the grid window so that it can stretch to the full view space:#define IDC_GRID 0x1111
BOOL CTest_grid_in_viewView::PreCreateWindow(CREATESTRUCT& cs)
{
BOOL bPreCreated = CView::PreCreateWindow(cs);
cs.style |= WS_CLIPSIBLINGS|WS_CLIPCHILDREN;
return bPreCreated;
}
int CTest_grid_in_viewView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
if( ! m_wndGrid.Create(
this,
CRect(0,0,0,0),
IDC_GRID
)
)
{
ASSERT( FALSE );
return -1;
}
m_wndGrid.OuterRowCountTopSet( 1L, false );
LPCTSTR arrHdrNames[3];
INT arrHdrExtents[3];
arrHdrNames[0] = _T("Column 0");
arrHdrNames[1] = _T("Column 1");
arrHdrNames[2] = _T("Column 2");
arrHdrExtents[0] = 100;
arrHdrExtents[1] = 100;
arrHdrExtents[2] = 100;
LONG nColCount = sizeof(arrHdrNames) / sizeof(arrHdrNames[0]);
m_wndGrid.ColumnAdd( nColCount, false );
for( LONG nColNo = 0L; nColNo < nColCount; nColNo++ )
{
CExtGridCellHeader * pCell =
STATIC_DOWNCAST(
CExtGridCellHeader,
m_wndGrid.GridCellGetOuterAtTop(
nColNo,
0L,
RUNTIME_CLASS(CExtGridCellHeader)
)
);
pCell->ExtentSet( arrHdrExtents[nColNo] );
pCell->TextSet( arrHdrNames[nColNo] );
}
CWnd::RepositionBars( 0, 0xFFFF, IDC_GRID );
m_wndGrid.OnSwUpdateScrollBars();
m_wndGrid.OnSwDoRedraw();
return 0;
}
void CTest_grid_in_viewView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
if( nType != SIZE_MINIMIZED )
CWnd::RepositionBars( 0, 0xFFFF, IDC_GRID );
}
|
|
Technical Support
|
Jun 8, 2005 - 11:14 AM
|
Just create a splitter window as usual. Then dynamically create a child grid window in the view that is in the top pane:if( ! m_wndGrid.Create(
this, //<-- pointer to the view window, which is in the top pane
CRect(0,0,0,0),
IDC_GRID
)
)
{
ASSERT( FALSE );
return -1;
}
|
|
Keith Bradbury
|
Jun 8, 2005 - 8:14 PM
|
The first step for me is to get the grid to work in a simple view, without worrying about the split pane for now. I did the following but the grid does not show up. Could you tell me what is wrong or provide me with the simplest example just to get the grid to show up in a view. Thanks!
my view class header file: class CTestGridView : public CView { ... public: CExtGridWnd m_wndGrid; ... }
In the view class source file: int CTestGridView::OnCreate(LPCREATESTRUCT lpCreateStruct) { if (CView::OnCreate(lpCreateStruct) == -1) return -1;
// TODO: Add your specialized creation code here if( ! m_wndGrid.Create( this, //<-- pointer to the view window, which is in the top pane CRect(0,0,0,0) ) ) { ASSERT( FALSE ); return -1; } return 0; }
|
|
Chris Fudge
|
Jun 8, 2005 - 4:13 AM
|
I am using a Child window within a dock control bar. The child window however is created in a COM dll and the main app creates a CExtControlBar which the com dll uses as a parent for the child dialog it creates.
I have encountered a few problems:
If i have a CEdit control on the child dialog then messages such as ctrl+v do not get processed. Tabbing around the dialog controls does not work If I use a DHTML dialog as the child dialog and navigate it to a web page with a edit box on then pressing enter doesnt make a new line (as well as the other problems experienced with a normal dialog).
I have sent some demo projects for the com dll and exe to the support email address.
Thanks in advance.
|
|
Technical Support
|
Jun 8, 2005 - 11:09 AM
|
Dear Chris,
We have modified your projects. First of all, we made the CIPlugInterface control more powerful:class ATL_NO_VTABLE CIPlugInterface :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CIPlugInterface, &CLSID_IPlugInterface>,
public IDispatchImpl < IIPlugInterface,
&IID_IIPlugInterface,
&LIBID_XPPluginLib,
/*wMajor =*/ 1,
/*wMinor =*/ 0>,
public IOleInPlaceActiveObjectImpl < CIPlugInterface >
, public CComControl < CIPlugInterface >
, public IOleControlImpl < CIPlugInterface >
, public IOleObjectImpl < CIPlugInterface >
, public IViewObjectExImpl < CIPlugInterface >
, public IOleInPlaceObjectWindowlessImpl < CIPlugInterface >
, public IQuickActivateImpl < CIPlugInterface >
. . . It was not possible to avoid this modification. Second, we have created the CMyCompatibleControlBar class in your EXE project and we used it as a type for the CMainFrame::m_wndResizableBarDlg property. This control is now compatible with your improved window-based COM control. It is possible to avoid using CMyCompatibleControlBar , but you should create an improved version of your control using the CWnd::CreateControl() method. The Prof-UIS 2.33 works very well with CWnd -subclassed COM controls.
Finally, we have modified the properties of the dialog template resource in your project: we set up the want return property of the multi-line edit control to true.
|
|
Thomas Zaenker
|
Jun 7, 2005 - 7:35 AM
|
Dear support team, is it possible to have the same behavior for the MdiDocumentButtons like in standard MFC-apps. At the moment there is no close document on doubleclick available. Best regards. Axel
|
|
Technical Support
|
Jun 7, 2005 - 9:39 AM
|
Thank you for your suggestion. We have already implemented the MDI document button’s behavior described in your message. Please contact us by e-mail so that we can provide you with the update.
|
|
Chris Fudge
|
Jun 6, 2005 - 5:21 AM
|
Is there a way to have a minimize button on a cextcontrolbar when it is floated ?
|
|
Technical Support
|
Jun 6, 2005 - 10:30 AM
|
The floating mini frame window is a kind of Win32 tool window, i.e. it has the WS_EX_TOOLWINDOW extended window style. Tool windows never have minimize/maximize/restore caption buttons. Besides, the state loading/saving algorithm for resizable control bars works with the floating bars in the normal state only. Of course, we can implement this button for you, but we are now overloaded with other work on the next release. If this important to you, please let us know so that we can do this later.
|
|
Technical Support
|
Jun 6, 2005 - 6:36 AM
|
It is possible to code and insert any kind of custom caption button for the resizable control bar. Please provide us with more details on your requirements. What behavior you expect when such a minimize button is clicked?
|
|
Chris Fudge
|
Jun 6, 2005 - 6:59 AM
|
I dont want the control bar to look any different when it is docked I would like a minimize button on the window when it is in a floating state. The action of the minimize button would minimise the floating window to appear at the bottom of the screen. When in a minimised state the minimise button would need to appear as a maximise button which would restore the window to its floating size.
|
|
claude laflamme
|
Jun 3, 2005 - 2:31 PM
|
I’ve posted that question but it doesn’t appear on the web. So I post it again. I want to create dynamic control bars. I mean by pressing on a button for example and adding a new bar in my frame. I’m trying to do so but it fall in a dead loop when calling the Create method. If the customization subsystem can create dynamic toolbar, it should be possible? Tanks to answer as fast!
|
|
Technical Support
|
Jun 4, 2005 - 10:02 AM
|
The customization subsystem has nothing to do with resizable control bars, but it actually allows the application users to create user-defined toolbars dynamically at run time. But you need to dynamically create control bars (e.g, by clicking a button in you application as you mentioned). Although this can be done with ordinary resizable control bars (the CExtResiazable class), we recommend you pay attention to dynamic resizable control bars announced in Prof-UIS 2.31. These control bars are based on the CExtDynamicControlBar class and managed by the dynamic bar site implemented in the CExtDynamicBarSite class. We are working on the article and documentation on these classes right now (will be available in the Prof-UIS 2.40 major release soon) so please take a look at the SDI_DynamicBars and MDI_DynamicBars samples. They demonstrate how to allocate and initialize new fully dynamic control bars with the CExtDynamicBarSite::BarAlloc() method. New bars are very convenient because the dynamic bar site automatically allocates and manages commands corresponding to these dynamic control bars. These control bars are fully serializable. The feature that may also interest you deals with that the dynamic bars support the floating state inside the MDI client area and they can be injected into the tab page container based child view in MDI/SDI applications.
|
|
claude laflamme
|
Jun 3, 2005 - 8:23 AM
|
Hi, I have a toolbar that include a CExtComboBox control. When the bar is reduce, we can access invisible button from the chevron menu. But, is there a way to show the combo box in that menu instead of a regular command button that send a message with my control’s id? Tanks
|
|
Technical Support
|
Jun 3, 2005 - 9:54 AM
|
Please take a look at the StyleEditor sample. It demonstrates combo boxes both in toolbars and menus. If you decrease the size of a docked toolbar, then you can find the hidden combo boxes in the pop-up menu dropped from the chevron button. Besides, you can find combo boxes in the menu bar’s pop-up menus. All the combo boxes of one type are synchronized between each other that is provided by Prof-UIS automatically, i.e. if you change value of the font name combo box in menu bar’s menu, you will see the same value in the toolbar’s combo box. The secret is simple: there are no combo boxes at all in this sample application. In fact, these combo-box-like controls are built-in combo-fields provides by the Prof-UIS customization system and they are available in the customizable applications only. If you want to see combo boxes in Prof-UIS menus, then you have to make your application customizable. Please take a closer look at the StyleEditor sample, read the Prof-UIS Customization Subsystem article and contact us for details.
|
|
Holger Hellenschmidt
|
Jun 3, 2005 - 7:40 AM
|
Hi, I want to realize a toolbar button with a simple popup menu. I have implemented it as described in your online help, but as soon as I enable customization (CExtCustomizeSite::EnableCustomization) the menu ist alwasy empty. Where do I have to register the popup menu?
|
|
Technical Support
|
Jun 5, 2005 - 8:43 AM
|
After the customization subsystem is initialized, all toolbars and menus get based on command tree nodes (the CExtCustomizeCmdTreeNode class). There are two approaches to this task. The first is based on direct access to the command tree node of the toolbar button and creating its child nodes. As a result, such a button gets a menu because its command tree node contains child nodes. You can get a pointer to the CExtBarButton object (that implements the toolbar button) by calling the CExtToolControlBar::GetButton() and CExtToolControlBar::CommandToIndex() methods. Then you can get a pointer to the CExtCustomizeCmdTreeNode object of the toolbar’s button by invoking the CExtBarButton::GetCmdNode() method. After that you can construct child nodes. Please note that each toolbar button is linked to two command tree nodes. The current command tree node describes the currently displayed button whose properties can be changed by the user in the customize mode. The initial command tree node describes the toolbar button in its initial state (when the application starts for the first time or when the user presses Reset on the Customize dialog). The initial node is required for reset the toolbar button in the customize mode. We must admit that this solution is a bit complicated because the user can always drag-and-drop your toolbar button to any other toolbar or menu. So, you would have to traverse all the sub trees of all the toolbars and menus, locate your toolbar button’s drag-and-dropped copies and initialize them. The alternative approach is very simple and based on marker commands. You create a pop-up menu resource with one command item that is called marker. Then you assign this menu to the toolbar button before the customization subsystem is initialized. Now your toolbar button has a menu with only one marker command item and you need to handle the CExtPopupMenuWnd::g_nMsgPrepareMenu or CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel registered windows messages which allow you to modify any pop-up menu before it appears on the screen. Your handler method just finds the marker command item in the pop-up menu being constructed, removes the marker and inserts some other menu items which, in your case, depend on the list selection. The CExtPopupMenuWnd::g_nMsgPrepareMenu registered windows message is sent once for each menu tree which allows you to analyze the entire menu tree that is constructed. The CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel registered windows message is introduced in Prof-UIS 2.33. It is similar to the previous message but is invoked for each single pop-up menu sublevel before it appears on the screen. This makes it handy for constructing menus which have many submenus. Your list selection dependent menu will be always correct even if the user drag-and-drop the marker item to any other menu in the customize mode. Here is the declaration, message map entry and implementation for the CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel registered windows message handler:afx_msg LRESULT OnExtMenuPrepare(
WPARAM wParam, LPARAM lParam );
ON_REGISTERED_MESSAGE(
CExtPopupMenuWnd::g_nMsgPrepareOneMenuLevel,
OnExtMenuPrepare
)
LRESULT CDrawView::OnExtMenuPrepare(
WPARAM wParam, LPARAM lParam )
{
lParam;
CExtPopupMenuWnd::MsgPrepareMenuData_t * pData =
reinterpret_cast
< CExtPopupMenuWnd::MsgPrepareMenuData_t * >
( wParam );
ASSERT( pData != NULL );
CExtPopupMenuWnd * pPopup = pData->m_pPopup;
ASSERT( pPopup != NULL );
INT nReplacePos =
pPopup->ItemFindPosForCmdID(
ID_YOUR_MARKER_COMMAND
);
for( ; nReplacePos >= 0;
nReplacePos =
pPopup->ItemFindPosForCmdID(
ID_YOUR_MARKER_COMMAND )
)
{
VERIFY( pPopup->ItemRemove( nReplacePos ) );
// insert new menu items into
// the nReplacePos position
}
return TRUE;
} Please note that this method absolutely correctly assumes that the marker command item can be presented more than once in any pop-up menu because your application is customizable and everything can be moved or copied to any other location.
|
|
Holger Hellenschmidt
|
Jun 6, 2005 - 2:30 AM
|
Hi, is there really no possibility to display a simple popup menu on a toolbar button. Is it possible to catch the event when pressing the toolbar button and display an own popup menu?
|
|
Technical Support
|
Jun 3, 2005 - 9:37 AM
|
Please note that both toolbars and menus in customizable applications are based on the command trees (the CExtCustomizeCmdTreeNode class) controlled by the customize site (the CExtCustomizeSite class). So, any menu bar button and toolbar button with drop-down menu contains its own command tree node instead of a HMENU handle. To find a solution how to create the toolbar button with drop-down menu, take a look at the CMainFrame::OnCreate() method of the DRAWCLI sample that can be compiled both as a customizable application and as non-customizable too. In both cases, this application creates the "line width" toolbar button with the drop-down menu:INT nBtnIdx = m_wndToolBarStandard.CommandToIndex(ID_DOC_LINE_WIDTH);
ASSERT( nBtnIdx >= 0 );
CMenu _line_menu;
VERIFY( _line_menu.LoadMenu(IDR_MENU_LW) );
VERIFY( m_wndToolBarStandard.SetButtonMenu( nBtnIdx, _line_menu.Detach() ) );
CExtBarButton * pTBB = m_wndToolBarStandard.GetButton(nBtnIdx);
ASSERT_VALID( pTBB );
pTBB->SetNoRotateVerticalLayout();
pTBB->SetSeparatedDropDown();
pTBB->SetAutoChangeID();
pTBB->SetCmdID(ID_LINE_WIDTH_1,true); // set default effective command The call of the CExtCustomizeSite::EnableCustomization() method close to the end of the CMainFrame::OnCreate() method simply converts all the toolbars and menus and makes them using command tree nodes of the customization system. The command manager is not updated from the IDR_MENU_LW menu resource because all its commands are available in other menu resources which are used for building the command manager’s command set at the beginning of the CMainFrame::OnCreate() method.
We may guess, the same method of your main frame window contains an invalid sequence of API invocations. Please compare it with that in the DRAWCLI sample or send it to us.
|
|
Holger Hellenschmidt
|
Jun 5, 2005 - 3:06 AM
|
Thank’s for your response, but I cannot create the menu before CExtCustomizeSite::EnableCustomization() is called because it’s a dynamic menu which depends on the current selection of a list control. The menu is also not a submenu of the main menu. How can I add a toolbar button menu after EnableCustomization is called?
|
|
Technical Support
|
Jun 6, 2005 - 6:20 AM
|
You can create a CExtBarButton -derived class and override the CExtBarButton::OnTrackPopup() virtual method in which you need to create and track your own pop-up menu. You also have to override the CExtBarButton::PutToPopupMenu() virtual method which is invoked when your button creates its specific pop-up menu and inserts it into the pop-up menu of the chevron button. You can use the CExtBarColorButton class as a sample for this task. The CExtBarColorButton class implements a color picker button which creates and tracks a color picker menu. Please do not forget to override the CExtBarButton::IsAbleToTrackMenu() virtual method that should return true because it is essential to make your button having a look of toolbar’s drop-down button. You can insert your button to the toolbar with the CExtToolControlBar::InsertSpecButton() method. But we recommend you override the CExtCustomizeSite::OnCreateToolbarButton() virtual method in the main frame window of your customizable application in which you need to create your CExtBarButton -derived instance for the command tree node with an appropriate command identifier.
|
|
Stephan Finkler
|
Jun 3, 2005 - 7:15 AM
|
Hi, how can I position 2 toolbars next to each other(no gap between)?
I do (see AviFrames sample):
CRect wrAlredyDockedBar; m_wndToolBarZoom.GetWindowRect( &wrAlredyDockedBar ); wrAlredyDockedBar.OffsetRect( 1, 0 ); DockControlBar( &m_wndToolBarSeek, AFX_IDW_DOCKBAR_TOP, &wrAlredyDockedBar ); RecalcLayout();
This works fine if the toolbars are not behind each other. If they are behind each other and there is a gap between, there is no reposition. The gap is still there. How can I set them close to each other?
Thanks for any advice?
|
|
Technical Support
|
Jun 3, 2005 - 9:22 AM
|
First of all, please tell us whether you are trying to dock toolbars initially or they are already docked and you are trying to redock them at run time. Second, please make ensure that you make a call of the RecalcLayout() method before you get a position of the first bar. Third, please provide us with a larger code snippet from your project. It should cover entire docking API invocations for both toolbars.
|
|
Chris Fudge
|
Jun 3, 2005 - 6:51 AM
|
I have a strange situation but im not sure if it is a known issue with v2.32 (and whether it has been fixed in 2.33)
To replicate you I do the following - You need 4 CExtControlBars one has the close button enabled , the other two do not. Tab up two of the windows with close buttons and tab up the other two together and dock them above the other two. Now drag the two top windows so they are tabbed with the other two.
The framwork enters a strange state and crashes if i try to close a Control bar panel.
|
|
Technical Support
|
Jun 3, 2005 - 9:45 AM
|
Please let us know whether this crash occurs in any of our sample projects? Where is the execution point in your application when the crash happens? Does your application perform any operations during the idle time processing or on timers? If yes, do these actions send any WM_CANCELMODE messages to any window?
|
|
Chris Fudge
|
Jun 3, 2005 - 2:03 AM
|
How do i prevent a single CExtControlBar from tabbing (i want it to be possible to dock it and float it etc.)
|
|
Technical Support
|
Jun 3, 2005 - 4:24 AM
|
Just use your own CExtControlBar -derived class and override the following internal virtual method:virtual bool _CanDockToTabbedContainers(
CExtControlBar * pDestBar
) const; The method should return false .
|
|
Thomas Zaenker
|
Jun 1, 2005 - 3:07 AM
|
Dear support team, I have some problems with new minor release 2.33. First I get an ASSERT in extpaintmanager.cpp in line 20995 on Windows 2000. The second it a crash in sample Prof-Studio if I redock the property control bar as another tab in solution control bar. Maybe this is due to traces of old layout settings of earlier versions. The crash occures in extcontrolbar.cpp line 17847 with pWndRoot = 0xfeeefeee. Best regards, Axel
|
|
Technical Support
|
Jun 1, 2005 - 1:46 PM
|
Thank you for the bug information. We have fixed both bugs. Please redownload the Prof-UIS 2.33 file again.
|
|
Chris Jackson
|
May 31, 2005 - 7:27 AM
|
I have a toolbar embedded in a CExtResizable dialog that is the child of a CExtControlBar. Unfortunately the OnUpdateCmdUI functions for the buttons on that toolbar do not seem to be called when the mouse isn’t over the control bar. I have tried handling WM_UPDATECMDUI in the mainframe and passing the message on to the control bar, but it doesn’t help. Can you help?
|
|
Technical Support
|
May 31, 2005 - 12:02 PM
|
The command updating for toolbar buttons inside the dialog is performed by the following static method:CExtControlBar::DoCustomModeUpdateControlBars( pDialog ); It is invoked only from the CExtResizableDialog::WindowProc() method and this explains mouse event dependency. You can invoke this method from your code when appropriate.
|
|
alexey Shetinin
|
May 27, 2005 - 3:41 PM
|
Hi. Help me, please. It’s about using of CExtTabWnd and CExtTabPageContainerWnd from CView-derived classes. Is it possible(it is, of course), and what should I do for it? In Samples all logic of these elements is handled in customized classes, derived from subject, and used in bars. I’ve not seen the sample,working directly with objects of this classes, so it’s difficult to understand way of using them. What i’ve understood: when I initialized objects in CView::OnInitialUpdate(.) and redefined PreTranslateMessage(.) and OnCmdMsg(.) to retranslate msgs to the TabPages CWnd - object of CExtTabWnd showes me only tabs without any content windows in it, and CExtTabPageContainerWnd’s object doesn’t show me even tabs. Handling of EN_CHANGE CmdMsg (as in samples) in CView is not working , TCITEM doesn’t connect with these elements - so how can I use them without deriving? Other question is - am i right with attaching HWND to the CExtTabWnd object through the LPARAM at the ItemInsert function? In CExtTabPageContainerWnd HWND translates through the PageInsert(.), but there is no such possibility in CExtTabWnd, in my view. Thank’s for reading.
|
|
Technical Support
|
May 29, 2005 - 9:20 AM
|
The CExtTabWnd class is not based on the standard MFC’s CTabCtrl class. It is a control written from scratch. To handle events of this control, you need to create and use a CExtTabWnd -derived class and override appropriate virtual methods. But your task does not deal with CExtTabWnd . It relates to the CExtTabPageContainerWnd class that is also written from scratch. It contains one child CExtTabWnd window in which each item corresponds to a certain child page window. We guess you should create a tab page container window inside your CView window and move it to fit all view window’s client size inside the CYourView::OnSize() handler. All child pages of the tab page container should be created as it is done in Prof-UIS samples. Of course, you can implement your own message pre-translation and command updating rules by invoking PreTranslateMessage() and OnCmdMsg() virtual methods of the currently active page window. You can insert a page into the CExtTabPageContainerWnd window with the PageInsert() method, which inserts a tab item associated with the page and sets LPARAM of the inserted tab item to HWND handle of the page window. But this deals with internals of CExtTabPageContainerWnd and such details are redundant when you are using this method.
|
|
Chris Douglass
|
May 26, 2005 - 10:00 AM
|
Hi guys! I want to create a custom CExtSplitterWnd that manages two vertical panes (1 row and 2 columns) and splits two non-CView dialog wnd’s. My goal is to achieve a look and feel for the entire splitter window that mimics the splitter bar in the PageNavigator complete with the 9 dots or so in the center of the splitter. So, essentially I want to use the splitter bar in PageNavigator but orient it vertically and make it split two static panes. Can you give me some pointers on how to accomplish this? My SDI application does not use MFC’s doc/view architecture. The two panes being split are two CDialog based wnd’s. They will be static so using CreateStatic seems to be the best option for creating the splitter. Thanks for any ideas!
|
|
Technical Support
|
May 30, 2005 - 10:12 AM
|
If you need a splitter that paints dots, you need to use a CExtSplitterWnd -class that has an OnDrawSplitter method like in the code below:class CPNSplitterWnd : public CExtSplitterWnd
{
public:
CPNSplitterWnd()
{
m_cxSplitterGap = 4;
m_cySplitterGap = 4;
}
protected:
virtual void OnDrawSplitter(
CDC * pDC,
ESplitType nType,
const CRect & rectArg
)
{
if( pDC == NULL)
{
RedrawWindow(
rectArg,
NULL,
RDW_INVALIDATE
|RDW_NOCHILDREN
);
return;
}
ASSERT_VALID(pDC);
CRect rect( rectArg );
CRect rcClient;
GetClientRect( &rcClient );
CRect rcClientInner( rcClient );
rcClientInner.DeflateRect(
2*CX_BORDER,
2*CX_BORDER
);
switch( nType )
{
case splitBorder:
pDC->ExcludeClipRect(
&rcClientInner
);
g_PaintManager->PaintDockerBkgnd(
true,
*pDC,
rcClient,
rect
);
pDC->SelectClipRgn( NULL );
return;
case splitBar:
case splitIntersection:
break;
case splitBox:
pDC->ExcludeClipRect(
&rcClientInner
);
g_PaintManager->PaintDockerBkgnd(
true,
*pDC,
rcClient,
rect
);
pDC->SelectClipRgn( NULL );
break;
#ifdef _DEBUG
default:
{
ASSERT( FALSE );
}
break;
#endif // _DEBUG
} // switch( nType )
rect.right =
rect.left + m_cySplitterGap;
pDC->FillSolidRect(
rect,
g_PaintManager->GetColor(
CExtPaintManager::CLR_3DFACE_OUT,
(CObject*)this
)
);
const CSize szGripDot(2,2);
const CSize szGripDist(1,1);
const CSize szGripShadowOffset(1,1);
const INT nDotCount = 9;
INT nDotsAreaWidth = szGripDot.cx + szGripShadowOffset.cx;
INT nDotsAreaHeight = nDotCount * ( szGripDot.cy + szGripDist.cy + szGripShadowOffset.cy );
CRect rcDotArea( rect );
rcDotArea.DeflateRect(
( rect.Width() - nDotsAreaWidth ) / 2 + 1,
( rect.Height() - nDotsAreaHeight ) / 2
);
for( INT nDot = 0; nDot < nDotCount; nDot++ )
{
INT nOffsetY = nDot * (szGripDot.cy + szGripShadowOffset.cy + szGripDist.cy);
CRect rcDot(
rcDotArea.left,
rcDotArea.top + nOffsetY,
rcDotArea.left + szGripDot.cx,
rcDotArea.top + nOffsetY + szGripDot.cy
);
CRect rcShadow( rcDot );
rcShadow.OffsetRect( szGripShadowOffset );
pDC->FillSolidRect(
&rcShadow,
g_PaintManager->GetColor( COLOR_WINDOW, this )
);
pDC->FillSolidRect(
&rcDot,
g_PaintManager->GetColor( COLOR_3DDKSHADOW, this )
);
} // for( INT nDot = 0; nDot < nDotCount; nDot++ )
}
}; // class CPNSplitterWnd
|
|
Roberto Manes
|
May 26, 2005 - 4:05 AM
|
I have a CExtTabWnd at the bottom of a CExtResizableDialog. If I set the ShowSizeGrip() method to true anchoring the TabWnd object I get two problems. First I can’t see the gripper until I resize the dialog. Second with the gripper on I get a lot of flicker for the TabWnd object. If you can suggest any solution would be appreciated. Thanks
|
|
Technical Support
|
May 30, 2005 - 10:07 AM
|
The griper is not visible because it is covered by the tab window. If you need to use the tab window at the bottom of the dialog and at the same time to make the gripper visible, we suggest you add and use the status bar. To avoid flickering, just turn on the Clip Children dialog style.
|
|
Roberto Manes
|
May 24, 2005 - 7:10 AM
|
How can I get the messages coming from the CExtTabWnd PopUp menu created runtime in the OnTabWndClickedButton() method ? I would undestand when the focus changes between the menu items while moving the cursor. Thanks in advance for your help.
|
|
Technical Support
|
May 24, 2005 - 1:28 PM
|
You cannot receive any message from the tab control’s popup menu because it does not send any message at all. Here is a code snippet from CExtTabWnd::OnTabWndClickedButton() that can be found in the ExtTabWnd.cpp file: if( pPopup->TrackPopupMenu(
TPMX_OWNERDRAW_FIXED
| nAlign
| TPMX_COMBINE_DEFAULT
| TPMX_DO_MESSAGE_LOOP
| TPMX_NO_WM_COMMAND
| TPMX_NO_CMD_UI
| TPMX_NO_HIDE_RARELY,
ptTrack.x,
ptTrack.y,
&rcExcludeArea,
NULL,
_CbPaintCombinedTabListBtnContent,
&nCmdRetVal
)
)
{ This code is tracking a pop-up menu when the menu button is clicked and, as you can see, the flags enforce the pop-up menu do not return back until the menu is tracked, do not invoke MFC’s command updating mechanism and do not send any WM_COMMAND message when an items is clicked. This is similar the behavior of the list box dropped down by the combo box control. The selection identifier is simply returned and analyzed. So, if you need some custom menu in the tab window, you should use your own CExtTabWnd -derived class and override the CExtTabWnd::OnTabWndClickedButton() virtual method in which you should analyze tab buttons, construct and track your own pop-up menu and, finally, implement any actions specific for your tab control. Please let us know the details of you task and we will help you with advice or a ready-to-use solution. In addition, tracking the menu item selection is a new feature that appeared in Prof-UIS 2.31 (available for registered library users) and demonstrated in the HelpNotes sample.
|
|
Roberto Manes
|
May 25, 2005 - 3:07 AM
|
I will have a look at the HelpNotes sample. Thanks
|
|
Holger Hellenschmidt
|
May 23, 2005 - 12:54 AM
|
Hi, I want to implement a variable main menu which has a different edit menu depending on the current selection in a grid. I have tried to replace the default menu in CMainFrame::OnExtMenuPrepare, but got a lot of asserts: LRESULT CMainFrame::OnExtMenuPrepare(WPARAM wParam, LPARAM lParam) { CExtPopupMenuWnd::MsgPrepareMenuData_t * pData = reinterpret_cast<CExtPopupMenuWnd::MsgPrepareMenuData_t*>(wParam); ASSERT( pData != NULL ); CExtPopupMenuWnd * pPopup = pData->m_pPopup; ASSERT( pPopup != NULL ); int nDummyPos = pPopup->ItemFindPosForCmdID(ID_MENU_DUMMY); if (( nDummyPos >= 0 ) && ( m_nEditMenuID > 0 )) { delete pPopup; pData->m_pPopup = new CExtPopupMenuWnd; pData->m_pPopup->LoadMenu( m_hWnd, m_nEditMenuID, false );
Any idea?
|
|
Technical Support
|
May 24, 2005 - 7:46 AM
|
You should not delete the pData->m_pPopup menu instance. That is not correct. Please remove all the items from this pop-up menu and load the menu resource into it.
|
|
Stephan Finkler
|
May 19, 2005 - 9:16 AM
|
Hi,
I’ve got an built in combobox and a button in toolbar. Customization is enabled. If CMainFrame::OnTextFieldVerify is called I would like to enable the button next to the combobox.
I call the ON_UPDATE_COMMAND_UI from for the button in CMainFrame::OnTextFieldVerify with CExtCmdItem CmdItem(IDPB_IE_LIST_SAVE); CmdItem.DoUpdateCmdUI(this, IDPB_IE_LIST_SAVE); CExtCustomizeSite::RedrawCommandItems( IDPB_IE_LIST_SAVE ); The update_command_handler is called but the button is still disabled. I think its because the CExtBarTextFieldButton::OnInplaceControlRun. How can I enable the button????
|
|
Technical Support
|
May 19, 2005 - 11:08 AM
|
You should not invoke MFC’s command updating mechanism from virtual methods of the CExtCustomizeSite class. In most cases the command updating chains are invoked automatically by the Prof-UIS framework. If it is not, then we should discuss your requirements in details. Besides, there is no point in analyzing relative positions of toolbar buttons and menu items in the customizable application because everything can be drag-and-dropped to a new location, added or removed. You should operate only with command identifiers.
|
|
Chris Douglass
|
May 17, 2005 - 9:06 AM
|
I noticed this method, PagePermanentWndGet, as part of the CExtTabPageContainerWnd class. However, I do not see this method documented anywhere. I’m wondering if there is a corresponding PagePermanentWndSet type of method available? The reason I ask is the child window that is contained on each of my TabPageContainerWnd’s could change dynamically at run time. So, instead of doing a PageInsert( m_arrGrids[i].m_hWnd, g_arrSampleNames[i], hIconTabCaption,(i == 0) ? false : true,-1, (i == 0) ? true : false))each time my child view/wnd is created/destroyed (this could happen N times during a normal user session), is there instead a way to just attach a new CWnd to an existing tab page dynamically? like this perhaps: PageAttach( nPageIndex, hWndNewChildViewWnd,...) Hopefully I’m explaining this well, to be sure here’s the use case: - SDI style UI with multiple tabs for each section of the app - User selects Tools tab (e.g. tab index 2) - Tools "Start Page" wnd is displayed (attached to TabPage via normal PageInsert invocation) - User selects Tool from list on Tools start page - While Tools tab index 2 is still selected, the new Tool (e.g. the My Mail Tool) window is created and displayed as a child of the Tools tab - The Tools start page wnd is replaced by the My Mail Tool window - User interacts with My Mail Tool and then repeats Tool selection for N number of Tools by navigating back to Tools Start Page and selecting a new Tool Thanks!
|
|
Technical Support
|
May 17, 2005 - 10:31 AM
|
The CExtTabPageContanerWnd class keeps HWND handles for its pages. It does not keep CWnd pointers because they can be temporary. The CExtTabPageContainerWnd::PagePermanentWndGet() method simply returns a pointer to the CWnd -based class that was instantiated in your application. The method returns NULL if HWND of the page does not correspond to the permanently instantiated CWnd -based class. So, your idea on ...PermanentWndSet() methods is not very good. You can use CExtTabPageContainerWnd::PageHwndSet() to attach a new HWND to the existing tab page. Please note that the previous HWND is not destroyed in this case. You can also remove a page and insert it again. It seems we simply forgot to document the CExtTabPageContainerWnd::PagePermanentWndGet() method. Thank you for this information.
|
|
Chris Douglass
|
May 17, 2005 - 9:10 AM
|
Is this what I need to call?? Thanks!
|
|
Wilhelm Falkner
|
May 16, 2005 - 4:35 PM
|
Hi, I have a MultiDoc application with Doc/View support. Most all toolbars are located in Mainframe, but some documents have their own toolbars in their own frames. For getting also these toolbar customizeable, I have built in their frames in the ::OnCreate an call to CExtCustomizeSite::EnableCustomization. Seem to work fine, but past closing one of these special document, my application is corrupted (toolbar in mainframe now shoe Icon AND text, and if I open any menu the program crash). Is there any call for Disabling or stop of customisation, that I have to do, when closing this frames? Or what have I forgotten to call? TIA Willi
|
|
Marcus Gebler
|
Oct 27, 2005 - 11:34 AM
|
Hello Wilhelm, I have the same scenario in my application and also the same problem. Could you please tell me, how this problem was solved? With best regards Marcus Gebler
|
|
Technical Support
|
May 17, 2005 - 8:47 AM
|
The toolbars used by your external documents/views are ordinary toolbars and they cannot cause crashes. The crash may occur if your external documents/views remove command items from the command manager without removing command nodes from the customize site (i.e. from all the command trees). We can review and debug your source code if you send it to us. In any case we need additional information about your project and, at least, source code snippets which operate with the customize site.
|
|
Wilhelm Falkner
|
May 17, 2005 - 9:00 AM
|
Does this mean: closing the document (and frame) do automatic remove command items from Command manager without removing from the customize site? if so, how can I remove the nodes from the customize site? It is not the question about menu: the menu is in mainframe. But in my special frame I have 2 additional toolbar - for these I call the EnableCustomization. These Toolbar have IDs, nowhere else used.
|
|
Technical Support
|
May 17, 2005 - 9:52 AM
|
The closing of a document in the MDI environment may change contents of the menu bar and does not remove anything from the command manager. We asked you about removing commands because we had supposed your code can do it. If it is not, then the bug hides somewhere outside Prof-UIS. In any case we are ready to help you. Could you send us a test project that demonstrates the problem?
|
|
Wilhelm Falkner
|
May 17, 2005 - 5:02 PM
|
sended you a testproject TIA Willi
|
|
Wilhelm Falkner
|
May 21, 2005 - 7:34 AM
|
Thanks, you have done a great job! Now it’s working Willi
|