Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site













SourceForge.net Logo

DockWindow

DockWindowis the 'base' or 'container' class of the window docking framework. It is resposible for managing the client windows and user interface and contains almost all of the methods necessary for setting up and controlling the framework.

 

There are three steps necessary to initialise the framework:

Create a window class that inherits from DockWindow (instead of TopWindow)

Overide DockInit

Register or otherwise add DockableCtrls using the methods provided.

 

A very simple implementaion could look like this:

 

class MyDockWindow : public DockableWindow

{

private:

   ArrayCtrl array;

 

   virtual void DockInit()

   {

       DockLeft(Dockable(array, "Dockable ArrayCtrl").SizeHint(300, 200));

   }

};

 

 

class DockWindow : public TopWindow

 

virtual void DockInit()

 This should be overloaded by the implementing window to allow correct initialization of DockableCtrls.

 

virtual void State(int reason)

 Used to detect window opening. To ensure correct initialization you should call DockWindow::State(reason) if you ever overload this.

 

DockableCtrl & Dockable(Ctrl &ctrl, WString title)

 A quick way to add ctrls to the interface. Adds ctrl to and internally managed DockableCtrl, set it's title to title and returns a referencefor further manipulation.

 

DockableCtrl & Dockable(Ctrl &ctrl, const char *title = 0)

 A quick way to add ctrls to the interface. Adds ctrl to and internally managed DockableCtrl, set it's title to title and returns a reference for further manipulation.

 

void DockLeft(DockableCtrl &dc, int pos = -1)

 Docks dc to the left docking frame, before the window indicated by pos. pos is always counted from left/top to right/bottom starting at 0.

 

void DockTop(DockableCtrl &dc, int pos = -1)

 Docks dc to the top docking frame, before the window indicated by pos. pos is always counted from left/top to right/bottom starting at 0.

 

void DockRight(DockableCtrl &dc, int pos = -1)

 Docks dc to the right docking frame, before the window indicated by pos. pos is always counted from left/top to right/bottom starting at 0.

 

void DockBottom(DockableCtrl &dc, int pos = -1)

 Docks dc to the bottom docking frame, before the window indicated by pos. pos is always counted from left/top to right/bottom starting at 0.

 

void Dock(int align, DockableCtrl &dc, int pos = -1)

 Docks dc to the docking frame specified by align, before the window indicated by pos. pos is always counted from left/top to right/bottom starting at 0.

 

void Tabify(DockableCtrl &target, DockableCtrl &dc)

 Adds target as tab, sharing the same window as dc (wherever .dc is positioned).

 

void Float(DockableCtrl &dc, Point p = Null)

 Floats (opens as a normal child window) dc and if specified locates it at position p.

 

void Float(DockableCtrl &dc, const char *title, Point p = Null)

 As above, but also sets dc's title.

 

void AutoHide(DockableCtrl &dc)

 Auto-Hides (hides with a tab on the DockWindow) dc. If docked dc will be hidden on the side of the window it is docked to, otherwise it will be hidden at the top of the DockWindow.

 

void AutoHide(int align, DockableCtrl &dc)

 Auto-Hides (hides with a tab on the DockWindow) dc with the tab appearing at the spcified alignment.

 

void Close(DockableCtrl &dc)

 Closes dc.

 

void DockGroup(int align, String group, int pos = -1)

 Docks all windows in group to the given align at position pos. See Dock.

 

void FloatGroup(String group)

 Floats all windows in group. See Float

 

void AutoHideGroup(int align, String group)

 Auto-Hides all window in group at the specified align. See AutoHide.

 

void TabDockGroup(int align, String group, int pos = -1)

 Tabify all windows in group and dock them at the specified align and pos. See Dock, Tabify.

 

void TabFloatGroup(String group)

 Tabify all windows in group and float them as one window. See Float, Tabify.

 

void CloseGroup(String group)

 Close all windows in group.

 

bool IsDockVisible(int alignconst

 Determines if the dock frame at align is visible.

 

void SetFrameSize(int align, int size)

 Sets the size of the frame at align to size (pixels).

 

DockWindow & AnimateDelay(int ms)

 Sets the delay before UI animation starts to ms (milliseconds).

 

DockWindow & Animate(bool highlight = true, bool window = true, int ticks = 10, int interval = 20)

 Enables/Disables animation and controls animation speed. You may wish to change the defaults to improve the performance or appearance of animations.

highlight determines whether the visual indicator of a possible docking target is animated.

window determines whether floating window are animations are applied before docking.

ticks sets the number of steps/frames involved in animation

interval sets the number of milliseconds between animation steps/frames.

 

DockWindow & NoAnimate()

 Disables both highlight and window animation.

 

bool IsAnimated() const

 Returns true if any animation is enabled.

 

bool IsAnimatedWindows() const

 Returns true only if window animation is enabled.

 

bool IsAnimatedHighlight() const

 Returns true only if highlight animation is enabled.

 

DockWindow & Tabbing(bool _tabbing = true)

 Enables/Disables window tabbing for the user.

 

DockWindow & NoTabbing()

 Disables window tabbing for the user.

 

bool IsTabbing() const

 Returns true if window tabbing is enabled.

 

DockWindow & NestedTabs(bool _nestedtabs = true)

 Sets the default behaviour when a tabbed window is added as a tab to another window. If _nestedtabs is true the inserting window will be nested as a single tab, if false all of it's tabs will be added to the target window. The user may alternate between these modes using a customizable key. See SetNestedToggleKey.

.

DockWindow & NoNestedTabs()

 Equivalent to calling NestedTabs(false).

 

bool IsNestedTabs() const

 Returns true if nested tabs is the default behaviour and false otherwise.

 

DockWindow & Grouping(bool grouping = true)

 Enable/Disables group-based options in the user interface. Affects all DockableCtrls.

 

DockWindow & NoGrouping()

 Disables grouping

 

bool IsGrouping() const

 Returns true if grouping is enabled.

 

DockWindow & AllowDockAll()

 Allows docking of windows to all alignments.

 

DockWindow & AllowDockNone()

 Denys docking of windows to all alignments.

 

DockWindow & AllowDockLeft(bool v = true)

 Allows/Denys docking of windows to left dock frame.

 

DockWindow & AllowDockTop(bool v = true)

 Allows/Denys docking of windows to top dock frame.

 

DockWindow & AllowDockRight(bool v = true)

 Allows/Denys docking of windows to right dock frame.

 

DockWindow & AllowDockBottom(bool v = true)

 Allows/Denys docking of windows to bottom dock frame.

 

DockWindow & AllowDock(int a, bool v = true)

   Allows/Denys docking of windows to dock frame specified by alignment a.

 

bool IsDockAllowed(int align)

 Returns true if docking is allowed to the dock frame indicated by align.

 

bool IsDockAllowed(int align, DockableCtrl &dc)

 DockableCtrls may have docking permissions set independently of the DockWindow. This function compares the permissions of dc and the DockWindow and returns true if both allow docking to the dock frame specified by align.

 

DockWindow & AutoHide(bool v = true)

 Enables/Disables auto-hide options in the user interface. Affects all DockableCtrls.

 

bool IsAutoHide()

 Returns true if auto-hiding is enabled.

 

dword NestedToggleKey()

 Returns the key (or key combination) used to alternate between tab nesting modes. See NestedTabs.

 

dword SetNestedToggleKey(dword key)

   Sets the key (or key combination) used to alternate between tab nesting modes to key. Default value is K_CTRL | K_SHIFT (ctrl or shift key). Setting to 0 will prevent the user from changing mode. See NestedTabs.

 

DockWindow & WindowButtons(bool menu, bool hide, bool close)

 Hide/Shows button type on all DockableCtrls.

 

bool HasMenuButtons() const

 Returns true if window menu buttons are currently shown.

 

bool HasHideButtons() const

 Returns true if auto-hide buttons are currently shown.

 

bool HasCloseButtons() const

 Returns true if close buttons are currently shown.

 

DockableCtrl & Register(DockableCtrl &dc)

 Registers dc without assigning it a state or position. This makes it available for Serialization and user interaction via the Window Manager of menus.

 

void Deregister(DockableCtrl &dc)

 The opposite of Register.

 

const Vector<DockableCtrl *> &GetDockableCtrls() const

 Returns a Vector containing pointers to all DockableCtrls currently managed by this DockWindow.

 

void DockManager()

 Displays the default Window Manager dialog. This allows users to save/load layouts, create/delete/manage groups and adjust various global options.

 

void DockWindowMenu(Bar &bar)

 Adds the default window menu to bar. This contains a list of windows (if Grouping is enabled, organised by group) and an option to open Window Manager option. windows can be manipulated via sub-menus.

 

void SerializeWindow(Stream &s)

 Serializes all window settings and layouts (includeing saved layouts) to Stream s.

 

void SerializeLayout(Stream &s, bool withsavedlayouts = true)

 Serializes the current layout to Stream s. If withsavedlayouts = true layout saved by the user will also be serialized.

 

int SaveLayout(String name)

 Saves the current layout as name.

 

void LoadLayout(int ix)

 Load the saved layout number ix. Use LayoutCount to find the upper limit for ix.

 

void LoadLayout(String name)

 Loads a saved layout by name.

 

void DeleteLayout(String name)

 Deletes a saved layout by name.

 

String GetLayoutName(int ixconst

 Returns the name of layout number ix. Use LayoutCount to find the upper limit for ix.

 

int LayoutCount() const

 Returns the number of saved layouts.

 

const ArrayMap<String, String> & GetLayouts() const

 Returns list of the saved layouts if the form ArrayMap<name, layout string>.

 

void DisableFloating()

 Disables all floating windows. When manipulating windows from a modal dialog you may need to call this after Floating a DockableCtrl to ensure correct modal behaviour.

 

void EnableFloating(bool enable = true)

 Enables/Disables all floating windows.

 

void SetHighlightStyle(DockableCtrl::Style &s)

 Sets the style used by UI highlight of possible docking targets to s.

 

void DockLayout()

 Prepares the window for user interaction by adding the required docking frames. This is called automatically when the window is opened, so should not normally be need to be called unless some unusual frame organization is required.

 

DockWindow()

 Class Contructor.

 

 

Last edit by cxl on 12/02/2017. Do you want to contribute?. T++