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.