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 » Resizing a slider into a toolbar Collapse All
Subject Author Date
claude laflamme Aug 8, 2005 - 9:30 AM

Hi,


  I have a slider created into a toolbar. I need my toolbar to use maximun space available when it is docked. So, I’ve make it single on row and stretch it. But, if I try to resize the slider, it always try to resize the toolbar causing to resize the slider again and again and again. So, how can I implemet it?


Thanks

Technical Support Aug 9, 2005 - 4:28 AM

The CExtMenuControlBar class implements a menu bar and it is a kind of the CExtToolControlBar class that implements a toolbar. It is possible to make toolbar occupy a full row/column automatically by overriding the CExtToolControlBar::_GetFullRowMode() internal virtual method like as follows:

bool C_YOUR_ToolControlBar::_GetFullRowMode() const
{
    ASSERT_VALID( this );
    return true;
}
It is also possible to stretch some toolbar button to fit all the space. By default, the toolbar button with the attached window measures its size by simply returning width/height of the attached window. So, you will need to implement custom measure technique. This task should be solved by overriding the CExtToolControlBar::_RecalcPositionsImpl() internal virtual method. Your implementation of this method should invoke parent’s method, analyze space between the last toolbar button and the end of the toolbar’s client area. This can be done via comparison of two rectangles: one is the client rectangle of the toolbar window and another is that returned by the CExtBarButton::Rect() method of the last button object in the toolbar. If your code detects some free space or collision between the last button’s area and the end of the client rectangle, then the window size of the combo box should be adjusted according to the detected size difference. In this case, you should invoke the parent CExtToolControlBar::_RecalcPositionsImpl() method second time to apply new positions of toolbar buttons according to the changes of the combo box’s size. If it’s difficult for you, we can help you by coding a ready-to-use solution.