#include <DockArea.h>
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 DockInfo * | createDefaultDockInfo (DockBar *bar)=0 |
Returns a default DockInfo for the floating DockBar that want to be docked by double-click by first-time. | |
virtual DockInfo * | createDockInfo (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 |
DockArea::~DockArea | ( | ) | [virtual] |
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.
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.
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.
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] |
Implemented in Vaca::BandedDockArea, and Vaca::BasicDockArea.
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.
Reimplemented from Vaca::Widget.
Implemented in Vaca::BandedDockArea, and Vaca::BasicDockArea.
void DockArea::addDockBar | ( | DockBar * | dockBar | ) | [private] |
void DockArea::removeDockBar | ( | DockBar * | dockBar | ) | [private] |
virtual void Vaca::DockArea::onPreferredSize | ( | Size & | sz | ) | [protected, pure virtual] |
It should calculates the preferred size for this widget.
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:
|
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.
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.
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.
friend class DockBar [friend] |
Side Vaca::DockArea::m_side [private] |