Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » DockControlBar Collapse All
Subject Author Date
Ian McIntosh Jan 15, 2008 - 7:44 AM

It seems that using DockControlBarInnerOuter causes a CExtControlBar to no longer be accessible using GetDlgItem.

in the following code:
CWnd* pWnd = GetDlgItem(ID_SYSTEM_TREE);
m_barSystemTree.DockControlBarInnerOuter( AFX_IDW_DOCKBAR_LEFT, true );
pWnd = GetDlgItem(ID_SYSTEM_TREE);

pWnd returned by the first GetDlgItem is populated, but the second GetDlgItem returns NULL.

Is this correct?
What is the best way to access a CExtControlBar from its ID?

Dave Foster Sep 15, 2009 - 8:40 PM

CMainWnd::DockControlBar( m_ToolBar, AFX_IDW_DOCKBAR_LEFT, &rect ) appears to undesirably resize our m_ToolBar when docked.  This did not occur when running with an MFC CToolBar.  m_ToolBar is an instance of CExtToolControlBar which was constructed with a 6 or so buttons (implemented from a bitmap), two CExtComboBox items and two CStatic objects inserted dynamically (they were "created", then "positioned" on the m_ToolBar).  I have read that one should use CExtToolControlBar::DockControlBar() instead of CMainWnd::DockControlBar(), but I cannot see the equivelent functionality in the CExtControlBar class.


Thanks

Technical Support Sep 17, 2009 - 3:01 AM

The CExtControlBar::Dock***() methods should be used with CExtControlBar resizable control bars. The CFrameWnd::DockControlBar() method should be used with CExtToolControlBar , CExtMenuControlBar, CExtPanelControlBar panel bars and other fixed size bars which cannot be resized by the user when docked.

The problem is to do with something else. Please drop an e-mail to the support mail box at this web site and attach the source code of your classes mentioned in your forum message and the source code of the main frame class.

Ian McIntosh Jan 15, 2008 - 10:13 AM

thanks guys

Technical Support Jan 15, 2008 - 10:07 AM

The CFrameWnd::m_listControlBars list object contains CControlBar* pointers to all control bars created in this frame window (including dock bars). You can use this list for enumerating all the control bars. The CFrameWnd::GetControlBar() method can be used for retrieving a CControlBar* pointer by its identifier.

Suhai Gyorgy Jan 15, 2008 - 8:05 AM

GetDlgItem searches the immediate child windows for the given ID. But docking the bar changes its parent (Check out ProfUIS article Docking Mechanism Explained)

You might want to try AfxGetMainWnd()->GetDescendantWindow(ID_SYSTEM_TREE) method, which searches all descendants for the given ID. But I’m not sure if it’s safe in all situations (let’s say when the control bar is in floating state).