Vaca::BasicDockArea Class Reference

#include <BasicDockArea.h>

Inheritance diagram for Vaca::BasicDockArea:

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

List of all members.


Detailed Description

The most basic dock area management.

Public Member Functions

 BasicDockArea (Side side, Widget *parent, Style style=BasicDockAreaStyle)
virtual ~BasicDockArea ()
virtual bool hitTest (DockBar *bar, const Point &cursor, const Point &anchor, bool fromInside)
 Returns true if the point pt is inside a valid rectangle to dock in this DockArea.
virtual DockInfocreateDefaultDockInfo (DockBar *bar)
 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)
virtual void drawXorTracker (Graphics &g, DockInfo *dockInfo)
 Draws the tracker (generally a rectangle) in Xor mode that represents the specified dockInfo.
virtual void layout ()
 Lays out all dock bars inside the dock area using the DockInfo of each DockBar.

Protected Member Functions

virtual void onPreferredSize (Size &sz)
 It should calculates the preferred size for this widget.

Constructor & Destructor Documentation

BasicDockArea::BasicDockArea ( Side  side,
Widget parent,
Style  style = BasicDockAreaStyle 
)

BasicDockArea::~BasicDockArea (  )  [virtual]


Member Function Documentation

bool BasicDockArea::hitTest ( DockBar bar,
const Point cursor,
const Point anchor,
bool  fromInside 
) [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.

Implements Vaca::DockArea.

DockInfo * BasicDockArea::createDefaultDockInfo ( DockBar bar  )  [virtual]

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

Implements Vaca::DockArea.

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

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

Implements Vaca::DockArea.

void BasicDockArea::drawXorTracker ( Graphics g,
DockInfo dockInfo 
) [virtual]

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

Implements Vaca::DockArea.

void BasicDockArea::layout (  )  [virtual]

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

See also:
DockBar, DockInfo

Implements Vaca::DockArea.

void BasicDockArea::onPreferredSize ( Size sz  )  [protected, 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.

Implements Vaca::DockArea.