Professional UI Solutions
Site Map   /  Register


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 General Discussion » CExtToolControlBar: how to show/hide buttons with subsequent re-arrangement of bar? Collapse All
Subject Author Date
Oliver Rau Sep 21, 2011 - 6:14 AM

Dear ProfUIS-Team,

having created a CExtToolControlBar-derivated button bar with fixed button positions:

CExtBarButton * p_Btn = p_Bar->GetButton(1);
if (p_Btn)
    p_Btn->Show(! p_Btn->IsVisible() ); // toggle

This leads to a gap between button 0 and 2 as a result of the hide action.

I tried to call _RecalcLayoutImpl() as well as _RecalcPositionsImpl() for p_Bar, but without success. Even worse: calling any of these functions leads to a reset of the p_Btn->m_bVisible flag ...

How can I correctly do show/hide of buttons with a subsequent re-arrangement of the bar, i.e. without getting gaps between buttons?

Thanks in advance for your help.

Kind regards,


Technical Support Sep 22, 2011 - 2:08 PM

Please do not use the Show() method. The toolbar also invokes it while computing its inner buttons layout. The toolbar tries showing all its buttons. If there is not enough space for them, some buttons become hidden and you can access them through the chevron button. If you need to hide a button regardless of any conditions, you should apply the TBBS_HIDDEN toolbar button style.