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 » ToolBars visible buttons Collapse All
Subject Author Date
Daniel Tiedy Oct 27, 2003 - 12:17 PM

Is there a way to tell if all buttons are visible on the tool bar and not in the drop down menu. At start up I would like to position some of the tools bars on their own line if not all the buttons are visible. This is only for the first time the app is ran, after that I will use the serialized state.

Technical Support Oct 28, 2003 - 9:52 AM

You can write a small function to detect the number of visible buttons. The CExtToolControlBar::GetButtonsCount() method returns the total number of buttons including the chevron button. You can get the pointer to any CExtBarButton object by invoking CExtToolControlBar::GetButton(). The CExtBarButton::IsVisible() method returns true if the button is not hidden under chevron. You can also hide a button by applying TBBS_HIDDEN style to it. Any button with this style is not visible at all.

As for the initial lining you are asking about, CExtToolControlBar uses the same method of the initial single-line docking as in MFC’s CToolBar:

DockControlBar(&m_wndToolBarDebug);
RecalcLayout();
CRect wrAlreadyDockedBar;
m_wndToolBarDebug.GetWindowRect( &wrAlreadyDockedBar );
wrAlreadyDockedBar.OffsetRect( 1, 0 );
DockControlBar(&m_wndToolBarBuild,AFX_IDW_DOCKBAR_TOP,&wrAlreadyDockedBar);
RecalcLayout();


The m_wndToolBarBuild toolbar in the above sample will be docked to the left of m_wndToolBarDebug.