Gadgets > Rogue Wave Views Gadgets > Docking Panes and Containers > Using Docking Bars
 
Using Docking Bars
Most GUI applications include docking bars. Their behavior is slightly different from that of standard docking panes.
This section introduces you to docking bars. It covers the following topics:
*Using the IlvAbstractBarPane Class
*Customizing Docking Bars
Using the IlvAbstractBarPane Class
The class IlvAbstractBarPane defines a pane specifically designed for handling toolbars and menu bars. This class is a subclass of the IlvGraphicPane class which encapsulates an IlvAbstractBar object. It is responsible for managing the bar orientation.
When a docking bar is docked, its direction must change according to its new location.
The following illustrations show the same toolbar oriented horizontally and vertically.
Figure 16.8    Horizontal Toolbar
Figure 16.9    Vertical Toolbar
Note: This class manages its own subclass of IlvDockable and, therefore, must not be modified.
Customizing Docking Bars
The IlvAbstractBarPane class has virtual member functions that you can redefine to meet your specific needs:
*orientationChanged—Is called each time the orientation of the toolbar encapsulated by the pane changes.
*geometryChanged—Is called each time the geometry of the toolbar encapsulated by the pane changes. See Notifying the Bar About Geometry Changes.
The following example shows a subclass of the IlvAbstractBarPane class that changes the orientation of the labels according to the bar orientation:
class MyMainMenuBarPane
: public IlvAbstractBarPane
{
public:
MyMainMenuBarPane(const char* name, IlvAbstractBar* bar)
: IlvAbstractBarPane(name, bar) {}
virtual void setContainer(IlvPanedContainer* container)
{
IlvAbstractBarPane::setContainer(container);
if (container)
checkLabelOrientation();
}
virtual void orientationChanged()
{
checkLabelOrientation();
IlvAbstractBarPane::orientationChanged();
}
void checkLabelOrientation()
{
IlvDockable* dockable = IlvDockable::GetDockable(this);
getBar()->setLabelOrientation(dockable && dockable->isDocked()
? getBar()->getOrientation()
: IlvHorizontal,
IlFalse,
IlFalse);
}
};
The checkLabelOrientation member function is called each time the bar orientation changes. It sets the orientation of the bar labels to the bar orientation if the pane is docked, or to IlvHorizontal if the bar is undocked.

Version 6.0
Copyright © 2015, Rogue Wave Software, Inc. All Rights Reserved.