Contents Up Previous Next

wxFrameLayout

wxFrameLayout manages containment and docking of control bars, which can be docked along the top, bottom, right, or left side of the parent frame.

Derived from

wxEvtHandler

Include files

<wx/fl/controlbar.h>

Data structures

Members

wxFrameLayout::wxFrameLayout
wxFrameLayout::~wxFrameLayout
wxFrameLayout::Activate
wxFrameLayout::AddBar
wxFrameLayout::AddPlugin
wxFrameLayout::AddPluginBefore
wxFrameLayout::ApplyBarProperties
wxFrameLayout::CanReparent
wxFrameLayout::CaptureEventsForPane
wxFrameLayout::CaptureEventsForPlugin
wxFrameLayout::CreateCursors
wxFrameLayout::CreateUpdatesManager
wxFrameLayout::Deactivate
wxFrameLayout::DestroyBarWindows
wxFrameLayout::DoSetBarState
wxFrameLayout::EnableFloating
wxFrameLayout::FindBarByName
wxFrameLayout::FindBarByWindow
wxFrameLayout::FindPlugin
wxFrameLayout::FirePluginEvent
wxFrameLayout::ForwardMouseEvent
wxFrameLayout::GetBarPane
wxFrameLayout::GetBars
wxFrameLayout::GetClientHeight
wxFrameLayout::GetClientRect
wxFrameLayout::GetClientWidth
wxFrameLayout::GetFrameClient
wxFrameLayout::GetPane
wxFrameLayout::GetPaneProperties
wxFrameLayout::GetPanesArray
wxFrameLayout::GetParentFrame
wxFrameLayout::GetPrevClientRect
wxFrameLayout::GetTopPlugin
wxFrameLayout::GetUpdatesManager
wxFrameLayout::HasTopPlugin
wxFrameLayout::HideBarWindows
wxFrameLayout::HitTestPane
wxFrameLayout::HitTestPanes
wxFrameLayout::HookUpToFrame
wxFrameLayout::InverseVisibility
wxFrameLayout::LocateBar
wxFrameLayout::OnActivate
wxFrameLayout::OnEraseBackground
wxFrameLayout::OnIdle
wxFrameLayout::OnKillFocus
wxFrameLayout::OnLButtonDown
wxFrameLayout::OnLButtonUp
wxFrameLayout::OnLDblClick
wxFrameLayout::OnMouseMove
wxFrameLayout::OnPaint
wxFrameLayout::OnRButtonDown
wxFrameLayout::OnRButtonUp
wxFrameLayout::OnSetFocus
wxFrameLayout::OnSize
wxFrameLayout::PopAllPlugins
wxFrameLayout::PopPlugin
wxFrameLayout::PositionClientWindow
wxFrameLayout::PositionPanes
wxFrameLayout::PushDefaultPlugins
wxFrameLayout::PushPlugin
wxFrameLayout::RecalcLayout
wxFrameLayout::RedockBar
wxFrameLayout::RefreshNow
wxFrameLayout::ReleaseEventsFromPane
wxFrameLayout::ReleaseEventsFromPlugin
wxFrameLayout::RemoveBar
wxFrameLayout::RemovePlugin
wxFrameLayout::ReparentWindow
wxFrameLayout::RepositionFloatedBar
wxFrameLayout::RouteMouseEvent
wxFrameLayout::SetBarState
wxFrameLayout::SetFrameClient
wxFrameLayout::SetMargins
wxFrameLayout::SetPaneBackground
wxFrameLayout::SetPaneProperties
wxFrameLayout::SetTopPlugin
wxFrameLayout::SetUpdatesManager
wxFrameLayout::ShowFloatedWindows
wxFrameLayout::UnhookFromFrame


wxFrameLayout::wxFrameLayout

wxFrameLayout(wxWindow* pParentFrame, wxWindow* pFrameClient = NULL, bool activateNow = TRUE)

Constructor, taking parent window, the (MDI) client of the parent if there is one, and flag specifying whether to activate the layout.

wxFrameLayout()

Default constructor, used only for serialization.


wxFrameLayout::~wxFrameLayout

~wxFrameLayout()

Destructor. It does not destroy the bar windows.


wxFrameLayout::Activate

void Activate()

Activate can be called after some other layout has been deactivated, and this one must take over the current contents of the frame window. Effectively hooks itself to the frame window, re-displays all non-hidden bar windows and repaints the decorations.


wxFrameLayout::AddBar

void AddBar(wxWindow* pBarWnd, const cbDimInfo& dimInfo, int alignment = FL_ALIGN_TOP, int rowNo = 0, int columnPos = 0, const wxString& name = "bar", bool spyEvents = FALSE, int state = wxCBAR_DOCKED_HORIZONTALLY)

Adds bar information to the frame layout. The appearance of the layout is not refreshed immediately; RefreshNow() can be called if necessary. Notes: the argument pBarWnd can by NULL, resulting in bar decorations to be drawn around the empty rectangle (filled with default background colour). Argument dimInfo can be reused for adding any number of bars, since it is not used directly - instead its members are copied. If the dimensions handler is present, its instance is shared (reference counted). The dimension handler should always be allocated on the heap. pBarWnd is the window to be managed. dimInfo contains dimension information. alignment is a value such as FL_ALIGN_TOP. rowNo is the vertical position or row in the pane (if in docked state). columnPos is the horizontal position within the row in pixels (if in docked state). name is a name by which the bar can be referred in layout customization dialogs. If spyEvents is TRUE, input events for the bar should be "spyed" in order to forward unhandled mouse clicks to the frame layout, for example to enable easy draggablity of toolbars just by clicking on their interior regions. For widgets like text/tree control this value should be FALSE, since there's no certain way to detect whether the event was actually handled. state is the initial state, such as wxCBAR_DOCKED_HORIZONTALLY, wxCBAR_FLOATING, wxCBAR_HIDDEN.


wxFrameLayout::AddPlugin

void AddPlugin(wxClassInfo* pPlInfo, int paneMask = wxALL_PANES)

An advanced methods for plugin configuration using their dynamic class information, for example CLASSINFO(pluginClass). First checks if the plugin of the given class is already "hooked up". If not, adds it to the top of the plugins chain.


wxFrameLayout::AddPluginBefore

void AddPluginBefore(wxClassInfo* pNextPlInfo, wxClassInfo* pPlInfo, int paneMask = wxALL_PANES)

First checks if the plugin of the given class is already hooked. If so, removes it, and then inserts it into the chain before the plugin of the class given by pNextPlInfo. Note: this method is handy in some cases where the order of the plugin-chain could be important, for example when one plugin overrides some functionality of another already-hooked plugin, so that the former plugin should be hooked before the one whose functionality is being overridden.


wxFrameLayout::ApplyBarProperties

void ApplyBarProperties(cbBarInfo* pBar)

Reflects changes in bar information structure visually. For example, moves the bar, changes its dimension information, or changes the pane to which it is docked.


wxFrameLayout::CanReparent

bool CanReparent()

Returns TRUE if the platform allows reparenting. This may not return TRUE for all platforms. Reparenting allows control bars to be floated.


wxFrameLayout::CaptureEventsForPane

void CaptureEventsForPane(cbDockPane* toPane)

Called by plugins; also captures the mouse in the parent frame.


wxFrameLayout::CaptureEventsForPlugin

void CaptureEventsForPlugin(cbPluginBase* pPlugin)

Captures user input events for the given plugin. Input events are: mouse movement, mouse clicks, keyboard input.


wxFrameLayout::CreateCursors

void CreateCursors()

Creates the cursors.


wxFrameLayout::CreateUpdatesManager

cbUpdatesManagerBase* CreateUpdatesManager()

Returns a new cbGCUpdatesMgr object.


wxFrameLayout::Deactivate

void Deactivate()

Deactivate unhooks itself from frame window, and hides all non-hidden windows. Note: two frame layouts should not be active at the same time in the same frame window, since it would cause messy overlapping of bar windows from both layouts.


wxFrameLayout::DestroyBarWindows

void DestroyBarWindows()

Destroys the bar windows.


wxFrameLayout::DoSetBarState

void DoSetBarState(cbBarInfo* pBar)

Applies the state to the window objects.


wxFrameLayout::EnableFloating

void EnableFloating(bool enable = TRUE)

Enables floating behaviour. By default floating of control bars is on.


wxFrameLayout::FindBarByName

cbBarInfo* FindBarByName(const wxString& name)

Finds the bar in the framelayout, by name.


wxFrameLayout::FindBarByWindow

cbBarInfo* FindBarByWindow(const wxWindow* pWnd)

Finds the bar in the framelayout, by window.


wxFrameLayout::FindPlugin

cbPluginBase* FindPlugin(wxClassInfo* pPlInfo)

Finds a plugin with the given class, or returns NULL if a plugin of the given class is not hooked.


wxFrameLayout::FirePluginEvent

void FirePluginEvent(cbPluginEvent& event)

This function should be used instead of passing the event to the ProcessEvent method of the top-level plugin directly. This method checks if events are currently captured and ensures that plugin-event is routed correctly.


wxFrameLayout::ForwardMouseEvent

void ForwardMouseEvent(wxMouseEvent& event, cbDockPane* pToPane, int eventType)

Delegated from "bar-spy".


wxFrameLayout::GetBarPane

cbDockPane* GetBarPane(cbBarInfo* pBar)

Returns the pane to which the given bar belongs.


wxFrameLayout::GetBars

BarArrayT& GetBars()

Gets an array of bars.


wxFrameLayout::GetClientHeight

int GetClientHeight()

Returns the client height.


wxFrameLayout::GetClientRect

wxRect& GetClientRect()

Returns the client's rectangle.


wxFrameLayout::GetClientWidth

int GetClientWidth()

Returns the client width.


wxFrameLayout::GetFrameClient

wxWindow* GetFrameClient()

Returns the frame client, or NULL if not present.


wxFrameLayout::GetPane

cbDockPane* GetPane(int alignment)

Returns a pane for the given alignment. See pane alignment types.


wxFrameLayout::GetPaneProperties

void GetPaneProperties(cbCommonPaneProperties& props, int alignment = FL_ALIGN_TOP)

Gets the pane properties for the given alignment.


wxFrameLayout::GetPanesArray

cbDockPane** GetPanesArray()

Returns an array of panes. Used by update managers.


wxFrameLayout::GetParentFrame

wxWindow& GetParentFrame()

Returns the parent frame.


wxFrameLayout::GetPrevClientRect

wxRect& GetPrevClientRect()

Returns the previous client window rectangle.


wxFrameLayout::GetTopPlugin

cbPluginBase& GetTopPlugin()

Returns the current top-level plugin (the one that receives events first, except if input events are currently captured by some other plugin).


wxFrameLayout::GetUpdatesManager

cbUpdatesManagerBase& GetUpdatesManager()

Returns a reference to the updates manager. Note: in future, the updates manager will become a normal plugin.


wxFrameLayout::HasTopPlugin

bool HasTopPlugin()

Returns true if there is a top plugin.


wxFrameLayout::HideBarWindows

void HideBarWindows()

Hides the bar windows, and also the client window if present.


wxFrameLayout::HitTestPane

bool HitTestPane(cbDockPane* pPane, int x, int y)

Returns TRUE if the position is within the given pane.


wxFrameLayout::HitTestPanes

cbDockPane* HitTestPanes(const wxRect& rect, cbDockPane* pCurPane)

Returns the pane for which the rectangle hit test succeeds, giving preference to the given pane if supplied.


wxFrameLayout::HookUpToFrame

void HookUpToFrame()

Hooks the layout up to the frame (pushes the layout onto the frame's event handler stack).


wxFrameLayout::InverseVisibility

void InverseVisibility(cbBarInfo* pBar)

Toggles the bar between visible and hidden.


wxFrameLayout::LocateBar

bool LocateBar(cbBarInfo* pBarInfo, cbRowInfo** ppRow, cbDockPane** ppPane)

The purpose of this function is unknown.


wxFrameLayout::OnActivate

void OnActivate(wxActivateEvent& event)

Handles activation events. Currently does nothing.


wxFrameLayout::OnEraseBackground

void OnEraseBackground(wxEraseEvent& event)

Handles background erase events. Currently does nothing.


wxFrameLayout::OnIdle

void OnIdle(wxIdleEvent& event)

Handles idle events.


wxFrameLayout::OnKillFocus

void OnKillFocus(wxFocusEvent& event)

Handles focus kill events. Currently does nothing.


wxFrameLayout::OnLButtonDown

void OnLButtonDown(wxMouseEvent& event)

Event handler for a left down button event.


wxFrameLayout::OnLButtonUp

void OnLButtonUp(wxMouseEvent& event)

Event handler for a left button up event.


wxFrameLayout::OnLDblClick

void OnLDblClick(wxMouseEvent& event)

Event handler for a left doubleclick button event.


wxFrameLayout::OnMouseMove

void OnMouseMove(wxMouseEvent& event)

Event handler for a mouse move event.


wxFrameLayout::OnPaint

void OnPaint(wxPaintEvent& event)

Handles paint events, calling PaintPane for each pane.


wxFrameLayout::OnRButtonDown

void OnRButtonDown(wxMouseEvent& event)

Event handler for a right button down event.


wxFrameLayout::OnRButtonUp

void OnRButtonUp(wxMouseEvent& event)

Event handler for a right button up event.


wxFrameLayout::OnSetFocus

void OnSetFocus(wxFocusEvent& event)

Handles focus set events. Currently does nothing.


wxFrameLayout::OnSize

void OnSize(wxSizeEvent& event)

Event handler for a size event.


wxFrameLayout::PopAllPlugins

void PopAllPlugins()

Pop all plugins.


wxFrameLayout::PopPlugin

void PopPlugin()

Similar to wxWindow's "push/pop-event-handler" methods, execept that the plugin is deleted upon "popping".


wxFrameLayout::PositionClientWindow

void PositionClientWindow()

Called to apply the calculated layout to window objects.


wxFrameLayout::PositionPanes

void PositionPanes()

Called to apply the calculated layout to window objects.


wxFrameLayout::PushDefaultPlugins

void PushDefaultPlugins()

Adds the default plugins. These are cbPaneDrawPlugin, cbRowLayoutPlugin, cbBarDragPlugin, cbAntiflickerPlugin, cbSimpleCustomizePlugin. This method is automatically invoked if no plugins were found upon firing of the first plugin-event, i.e. when wxFrameLayout configures itself.


wxFrameLayout::PushPlugin

void PushPlugin(cbPluginBase* pPugin)

Similar to wxWindow's "push/pop-event-handler" methods, execept that the plugin is deleted upon "popping".


wxFrameLayout::RecalcLayout

void RecalcLayout(bool repositionBarsNow = FALSE)

Recalculates the layout of panes, and all bars/rows in each pane.


wxFrameLayout::RedockBar

bool RedockBar(cbBarInfo* pBar, const wxRect& shapeInParent, cbDockPane* pToPane = NULL, bool updateNow = TRUE)

ReddockBar can be used for repositioning existing bars. The given bar is first removed from the pane it currently belongs to, and inserted into the pane, which "matches" the given rectangular area. If pToPane is not NULL, the bar is docked to this given pane. To dock a bar which is floating, use the wxFrameLayout::DockBar method.


wxFrameLayout::RefreshNow

void RefreshNow(bool recalcLayout = TRUE)

Recalculates layout and performs on-screen update of all panes.


wxFrameLayout::ReleaseEventsFromPane

void ReleaseEventsFromPane(cbDockPane* fromPane)

Called by plugins; also releases mouse in the parent frame.


wxFrameLayout::ReleaseEventsFromPlugin

void ReleaseEventsFromPlugin(cbPluginBase* pPlugin)

Releases user input events for the given plugin. Input events are: mouse movement, mouse clicks, keyboard input


wxFrameLayout::RemoveBar

void RemoveBar(cbBarInfo* pBar)

Removes the bar from the layout permanently, and hides its corresponding window if present.


wxFrameLayout::RemovePlugin

void RemovePlugin(wxClassInfo* pPlInfo)

Checks if the plugin of the given class is hooked, and removes it if found.


wxFrameLayout::ReparentWindow

void ReparentWindow(wxWindow* pChild, wxWindow* pNewParent)

Reparents pChild to have parent pNewParent.


wxFrameLayout::RepositionFloatedBar

void RepositionFloatedBar(cbBarInfo* pBar)

Applies the calculated layout to a floating bar.


wxFrameLayout::RouteMouseEvent

void RouteMouseEvent(wxMouseEvent& event, int pluginEvtType)

Routes the mouse event to the appropriate pane.


wxFrameLayout::SetBarState

void SetBarState(cbBarInfo* pBar, int newStatem, bool updateNow)

Changes the bar's docking state (see possible control bar states).


wxFrameLayout::SetFrameClient

void SetFrameClient(wxWindow* pFrameClient)

Passes the client window (e.g. MDI client window) to be controlled by frame layout, the size and position of which should be adjusted to be surrounded by controlbar panes, whenever the frame is resized or the dimensions of control panes change.


wxFrameLayout::SetMargins

void SetMargins(int top, int bottom, int left, int right, int paneMask = wxALL_PANES)

Sets the margins for the given panes. The margins should go into cbCommonPaneProperties in the future. Note: this method should be called before any custom plugins are attached.


wxFrameLayout::SetPaneBackground

void SetPaneBackground(const wxColour& colour)

Sets the pane background colour.


wxFrameLayout::SetPaneProperties

void SetPaneProperties(const cbCommonPaneProperties& props, int paneMask = wxALL_PANES)

Sets the pane properties for the given alignment. Note: changing properties of panes does not result immediate on-screen update.


wxFrameLayout::SetTopPlugin

void SetTopPlugin(cbPluginBase* pPlugin)

Hooking custom plugins to frame layout. Note: when hooking one plugin on top of the other, use SetNextHandler or similar methods of wxEvtHandler class to compose the chain of plugins, than pass the left-most handler in this chain to the above methods (assuming that events are delegated from left-most towards right-most handler). This secenario is very inconvenient and "low-level", so use the Add/Push/PopPlugin methods instead.


wxFrameLayout::SetUpdatesManager

void SetUpdatesManager(cbUpdatesManagerBase* pUMgr)

Destroys the previous manager if any, and sets the new one.


wxFrameLayout::ShowFloatedWindows

void ShowFloatedWindows(bool show)

Shows all floated windows.


wxFrameLayout::UnhookFromFrame

void UnhookFromFrame()

Unhooks the layout from the frame.