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 » position toolbar on specific row Collapse All
Subject Author Date
Peter Segerdahl Mar 24, 2005 - 2:49 AM

Hi,


When my program runs for the first time the toolbars (i.e. CExtToolControlBar) are given default orders/positions (the following times the positions are saved and restored). The problem is that they all are positioned on the first row, which leads to that some toolbars are positioned outside the screen or at least major parts of some toolbars are positioned outside the screen.


This is very unfortunate as first time users may never find the features in the toolbars.


So, my question if how I could control the row the toolbar will end up on?


Thanks!

Technical Support Mar 24, 2005 - 6:53 AM

Yes, you are right. When your application runs for the first time, toolbars are docked in their default positions. But these positions are fully controlled by your code. So, if you want every toolbar to be fully displayed, that is to make all toolbar buttons initially visible, don’t dock too many toolbars in the same row. The following code demonstrates how it can be done for four toolbars:

// Dock m_wndToolBar1 in row 1
DockControlBar(&m_wndToolBar1); // Docked in row 1
RecalcLayout();
 
// Dock m_wndToolBar2 in row 1 next to m_wndToolBar1
CRect wrAlreadyDockedBar;
m_wndToolBar1.GetWindowRect( &wrAlreadyDockedBar );
wrAlreadyDockedBar.OffsetRect( 1, 0 );
DockControlBar( 
     &m_wndToolBar2,
     AFX_IDW_DOCKBAR_TOP,
     &wrAlreadyDockedBar
);
RecalcLayout();
 
// Dock m_wndToolBar1 in row 2
DockControlBar(&m_wndToolBar3);
 
// Dock m_wndToolBar1 in row 3
DockControlBar(&m_wndToolBar4);
RecalcLayout(); 
So, it seems you need just to check you code and make sure the default positions of your toolbars are set in the appropriate way.

Peter Segerdahl Mar 24, 2005 - 7:44 AM

Perfect!


Thanks for the prompt reply and good explanation.