Vaca::DockArea Class Reference

#include <DockArea.h>

Inheritance diagram for Vaca::DockArea:

Vaca::Register< T > Vaca::Widget Vaca::Component Vaca::Referenceable Vaca::NonCopyable Vaca::BandedDockArea Vaca::BasicDockArea

List of all members.


Detailed Description

The abstract class to create DockAreas.

A DockArea is the place where you can dock toolbars (any DockBar really).

Public Member Functions

 DockArea (Side side, Widget *parent, Style style=DockAreaStyle)
virtual ~DockArea ()
bool isHorizontal ()
bool isVertical ()
Side getSide ()
virtual bool isLayoutFree ()
 Returns true, because DockAreas are controlled by the Frame, not by the Layout manager.
virtual bool hitTest (DockBar *bar, const Point &cursor, const Point &anchor, bool fromInside)=0
 Returns true if the point pt is inside a valid rectangle to dock in this DockArea.
virtual DockInfocreateDefaultDockInfo (DockBar *bar)=0
 Returns a default DockInfo for the floating DockBar that want to be docked by double-click by first-time.
virtual DockInfocreateDockInfo (DockBar *bar, const Point &cursor, const Point &anchor)=0
virtual void drawXorTracker (Graphics &g, DockInfo *dockInfo)=0
 Draws the tracker (generally a rectangle) in Xor mode that represents the specified dockInfo.
virtual void layout ()=0
 Lays out all dock bars inside the dock area using the DockInfo of each DockBar.

Protected Member Functions

virtual void onPreferredSize (Size &sz)=0
 It should calculates the preferred size for this widget.
virtual void onAddDockBar (DockBar *dockBar)
 You can use onAddDockBar to hook the addDockBar action.
virtual void onRemoveDockBar (DockBar *dockBar)
 You can use onRemoveDockBar to hook the removeDockBar action.
virtual void onRedock (DockBar *dockBar, DockInfo *newDockInfo)
 Event generated when the user start dragging the dockBar from this DockArea.

Private Member Functions

void addDockBar (DockBar *dockBar)
 Adds the dockBar in this DockArea.
void removeDockBar (DockBar *dockBar)
 Removes the dockBar from this DockArea.

Private Attributes

Side m_side

Friends

class DockBar


Constructor & Destructor Documentation

DockArea::DockArea ( Side  side,
Widget parent,
Style  style = DockAreaStyle 
)

DockArea::~DockArea (  )  [virtual]


Member Function Documentation

bool DockArea::isHorizontal (  ) 

bool DockArea::isVertical (  ) 

Side DockArea::getSide (  ) 

bool DockArea::isLayoutFree (  )  [virtual]

Returns true, because DockAreas are controlled by the Frame, not by the Layout manager.

See also:
Frame::layout

Reimplemented from Vaca::Widget.

virtual bool Vaca::DockArea::hitTest ( DockBar bar,
const Point cursor,
const Point anchor,
bool  fromInside 
) [pure virtual]

Returns true if the point pt is inside a valid rectangle to dock in this DockArea.

Parameters:
bar The DockBar to dock.
cursor Absolute position.
fromInside True means that we are already inside the DockArea, so try to use the more biggest are to return a true hit-test.

Implemented in Vaca::BandedDockArea, and Vaca::BasicDockArea.

virtual DockInfo* Vaca::DockArea::createDefaultDockInfo ( DockBar bar  )  [pure virtual]

Returns a default DockInfo for the floating DockBar that want to be docked by double-click by first-time.

Implemented in Vaca::BandedDockArea, and Vaca::BasicDockArea.

virtual DockInfo* Vaca::DockArea::createDockInfo ( DockBar bar,
const Point cursor,
const Point anchor 
) [pure virtual]

Returns:
A new created dockInfo (you must to delete this pointer).

Implemented in Vaca::BandedDockArea, and Vaca::BasicDockArea.

virtual void Vaca::DockArea::drawXorTracker ( Graphics g,
DockInfo dockInfo 
) [pure virtual]

Draws the tracker (generally a rectangle) in Xor mode that represents the specified dockInfo.

Implemented in Vaca::BandedDockArea, and Vaca::BasicDockArea.

virtual void Vaca::DockArea::layout (  )  [pure virtual]

Lays out all dock bars inside the dock area using the DockInfo of each DockBar.

See also:
DockBar, DockInfo

Reimplemented from Vaca::Widget.

Implemented in Vaca::BandedDockArea, and Vaca::BasicDockArea.

void DockArea::addDockBar ( DockBar dockBar  )  [private]

Adds the dockBar in this DockArea.

See also:
onAddDockBar

void DockArea::removeDockBar ( DockBar dockBar  )  [private]

Removes the dockBar from this DockArea.

See also:
onRemoveDockBar

virtual void Vaca::DockArea::onPreferredSize ( Size sz  )  [protected, pure virtual]

It should calculates the preferred size for this widget.

Parameters:
sz It's for input and output. You should put the preferred size in this value, but also you should read the input value to know if you must to fit the widget in some size. The possible values for sz are:
  • sz = Size(0, 0) to calculate the preferred size without restrictions.
  • sz = Size(width, 0) to calculate the preferred size with restricted <= width.
  • sz = Size(0, height) to calculate the preferred size with restricted <= height.

Reimplemented from Vaca::Widget.

Implemented in Vaca::BandedDockArea, and Vaca::BasicDockArea.

void DockArea::onAddDockBar ( DockBar dockBar  )  [protected, virtual]

You can use onAddDockBar to hook the addDockBar action.

 void MyDockArea::onAddDockBar(DockBar* dockBar)
 {
   // do something, like add the dockBar in
   // some internal structure...
 }

Reimplemented in Vaca::BandedDockArea.

void DockArea::onRemoveDockBar ( DockBar dockBar  )  [protected, virtual]

You can use onRemoveDockBar to hook the removeDockBar action.

 void MyDockArea::onRemoveDockBar(DockBar* dockBar)
 {
   // do something, like remove the dockBar from 
   // some internal structure...
 }

Reimplemented in Vaca::BandedDockArea.

void DockArea::onRedock ( DockBar dockBar,
DockInfo newDockInfo 
) [protected, virtual]

Event generated when the user start dragging the dockBar from this DockArea.

Event generated when the user finish the dragging of the dockBar that start from this DockArea.

Parameters:
newDockInfo The new dockInfo where the dockBar will be docked. NULL means that dockBar will be floating, or the drag operation was canceled.

Reimplemented in Vaca::BandedDockArea.


Friends And Related Function Documentation

friend class DockBar [friend]


Member Data Documentation