Vaca::ToolBar Class Reference

#include <ToolBar.h>

Inheritance diagram for Vaca::ToolBar:

Vaca::DockBar Vaca::Register< T > Vaca::Widget Vaca::Component Vaca::Referenceable Vaca::NonCopyable

List of all members.


Detailed Description

A dockable tool bar.

ToolBar.png

Warning:
This class uses a ToolSet to show ToolButtons, but a ToolSet is static, is just a set of buttons, ToolBar offers you a dockable tool bar.

Public Member Functions

 ToolBar (const String &title, Frame *parent, Style toolSetStyle=ToolSetStyle, Style style=ToolBarStyle)
virtual ~ToolBar ()
virtual Size getDockedSize (Side side)
 Returns the size of the ToolBar when it should be docked in the specified side.
virtual Size getFloatingSize ()
int getButtonCount ()
int getRows ()
Rect setRows (int rows, bool expand)
void setImageList (ImageList &imageList)
void loadStandardImageList (int imageListId=IDB_STD_SMALL_COLOR)
void addButton (ToolButton *button)
void addSeparator (int width=6)
void updateButton (ToolButton *button)
ToolButtongetButtonById (CommandId id)
ToolButtongetButtonByIndex (int index)
int hitTest (const Point &pt)

Protected Member Functions

virtual bool onCommand (CommandId id)
 Called when a command by ID is activated by the user, this can be a menu item or an accelerator.
virtual void onUpdateIndicators ()
 Event called to update the state of indicators.
virtual void onDocking ()
 When the ToolBar is docked in the top or bottom side, we must to set the rows to 1, if it's docked in the left or right side we must to make it vertical (set the rows to the maximum number).
virtual void onFloating ()
 Event called when the DockBar was docked and now is floating in some DockFrame.
virtual void onResizingFrame (DockFrame *frame, CardinalDirection dir, Rect &rc)
 When the DockBar is floating, and its DockFrame container is resized (DockFrame::onResizing), this event is fired.

Private Attributes

ToolSet m_set
int m_rowsWhenFloating

Constructor & Destructor Documentation

ToolBar::ToolBar ( const String title,
Frame parent,
Style  toolSetStyle = ToolSetStyle,
Style  style = ToolBarStyle 
)

ToolBar::~ToolBar (  )  [virtual]


Member Function Documentation

Size ToolBar::getDockedSize ( Side  side  )  [virtual]

Returns the size of the ToolBar when it should be docked in the specified side.

Reimplemented from Vaca::DockBar.

Size ToolBar::getFloatingSize (  )  [virtual]

Reimplemented from Vaca::DockBar.

bool ToolBar::onCommand ( CommandId  id  )  [protected, virtual]

Called when a command by ID is activated by the user, this can be a menu item or an accelerator.

Parameters:
commandId Identifier of the command that was activated.
Returns:
It should returns true if the commandId was used.
Win32 Specific:
Don't confuse with onReflectedCommand: onCommand is used to handle command notifications that come directly from accelarators or menus, not from Win32's controls. Notifications by Win32's controls are handled via onReflectedCommand, onReflectedNotify, or onReflectedDrawItem.

See also:
Command

Reimplemented from Vaca::Widget.

void ToolBar::onUpdateIndicators (  )  [protected, virtual]

Event called to update the state of indicators.

See also:
Widget::updateIndicators

Reimplemented from Vaca::Widget.

void ToolBar::onDocking (  )  [protected, virtual]

When the ToolBar is docked in the top or bottom side, we must to set the rows to 1, if it's docked in the left or right side we must to make it vertical (set the rows to the maximum number).

See also:
ToolSet::setRows

Reimplemented from Vaca::DockBar.

void ToolBar::onFloating (  )  [protected, virtual]

Event called when the DockBar was docked and now is floating in some DockFrame.

Reimplemented from Vaca::DockBar.

void ToolBar::onResizingFrame ( DockFrame frame,
CardinalDirection  dir,
Rect rc 
) [protected, virtual]

When the DockBar is floating, and its DockFrame container is resized (DockFrame::onResizing), this event is fired.

Reimplemented from Vaca::DockBar.

int Vaca::ToolBar::getButtonCount (  )  [inline]

int Vaca::ToolBar::getRows (  )  [inline]

See also:
ToolSet::getRows

Rect Vaca::ToolBar::setRows ( int  rows,
bool  expand 
) [inline]

See also:
ToolSet::setRows

void Vaca::ToolBar::setImageList ( ImageList imageList  )  [inline]

void Vaca::ToolBar::loadStandardImageList ( int  imageListId = IDB_STD_SMALL_COLOR  )  [inline]

void Vaca::ToolBar::addButton ( ToolButton button  )  [inline]

void Vaca::ToolBar::addSeparator ( int  width = 6  )  [inline]

void Vaca::ToolBar::updateButton ( ToolButton button  )  [inline]

ToolButton* Vaca::ToolBar::getButtonById ( CommandId  id  )  [inline]

ToolButton* Vaca::ToolBar::getButtonByIndex ( int  index  )  [inline]

int Vaca::ToolBar::hitTest ( const Point pt  )  [inline]

See also:
ToolSet::hitTest


Member Data Documentation