MatOCAD Logo

Main Page | Class Hierarchy | Class List | Directories | File List | Class Members | File Members | Related Pages

wxInterfaceManager Class Reference

#include <manager.h>

Collaboration diagram for wxInterfaceManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 wxInterfaceManager (wxWindow *parent, wxWindow *content=NULL)
 ~wxInterfaceManager ()
wxWindow * GetParent () const
const wxRect & GetInterfaceRect () const
void SetInterfaceRect (const wxRect &rect)
void ResetInterfaceRect ()
void SetContentWindow (wxWindow *content)
wxWindow * GetContentWindow () const
bool Initialize (bool defaultPlugins=true, int flags=IFM_DEFAULT_FLAGS)
void Shutdown ()
void SetFlags (int flags)
 Sets flags.
int GetFlags () const
bool AddChild (wxIFMChildDataBase *data, bool update=false)
void ShowChild (wxWindow *child, bool show, bool update=true)
void HideChild (wxWindow *child, bool update=true)
bool IsChildVisible (wxWindow *child)
void SetChildSize (wxWindow *child, const wxSize &desired, const wxSize &min=IFM_USE_CURRENT_SIZE, const wxSize &max=IFM_USE_CURRENT_SIZE, bool update=true)
 Change the minimum, maximum, and desired size of the given child window.
void CaptureInput (wxIFMComponent *component)
void ReleaseInput ()
bool IsInputCaptured () const
wxIFMComponentGetCapturedComponent () const
wxWindow * GetCapturedWindow () const
void Update (wxRect rect=IFM_DEFAULT_RECT, bool floating=false)
void AddPendingUpdate (wxRect rect=IFM_DEFAULT_RECT, bool floating=false)
void SetStatusMessagePane (int pane)
void DisplayStatusMessage (const wxString &message)
void ResetStatusMessage ()

Private Member Functions

int AddInterfacePlugin (wxIFMInterfacePluginBase *plugin, bool select=true)
void SetActiveInterface (int plugin)
void RemoveInterfacePlugin (int interface_index=IFM_INTERFACE_ACTIVE)
void RemoveAllInterfacePlugins ()
wxIFMInterfacePluginBaseGetActiveIP () const
bool AddExtensionPlugin (wxIFMExtensionPluginBase *plugin)
void RemoveExtensionPlugin ()
void RemoveAllExtensionPlugins ()

Private Attributes

bool m_initialized
int m_flags
wxWindow * m_parent
wxWindow * m_content
wxIFMInterfacePluginArray m_interfacePlugins
int m_activeInterface
wxIFMComponentm_capturedComponent
 indentifies which component has captured input, if any
int m_capturedType
 specifies the type of the component that has captured input
wxRect m_updateRect
bool m_useUpdateRect
int m_statusbarPane
bool m_statusMessageDisplayed
wxString m_oldStatusMessage

Detailed Description

Main interace management object. Mediates between application window and the IFM system.

Definition at line 135 of file manager.h.


Constructor & Destructor Documentation

wxInterfaceManager::wxInterfaceManager wxWindow *  parent,
wxWindow *  content = NULL
 

Parameters:
parent Parent window of the interface
content Content window to be managed by the interface

Definition at line 53 of file manager.cpp.

References IFM_CANFLOAT, IFM_DEFAULT_FLAGS, IFM_DISABLE_STATUS_MESSAGES, and m_parent.

wxInterfaceManager::~wxInterfaceManager  ) 
 

Definition at line 70 of file manager.cpp.


Member Function Documentation

bool wxInterfaceManager::AddChild wxIFMChildDataBase data,
bool  update = false
 

Adds a child window to be managed by the interface. This child window will be added to all interface plugins.

Parameters:
data Pointer to child data.
update If true, the interface will be updated immediately. Otherwise, the interface will not be updated (and the child not sized or moved) until the next SizeEvent is generated by the parent frame, or until wxInterfaceManager::Update is called.

Definition at line 165 of file manager.cpp.

References GetActiveIP(), wxIFMAddChildEvent::GetSuccess(), IFM_CHILDTYPE_UNDEFINED, wxIFMChildDataBase::m_child, m_initialized, wxIFMChildDataBase::m_type, wxIFMInterfacePluginBase::ProcessPluginEvent(), and Update().

Referenced by MainFrm::CreateGUIControls().

bool wxInterfaceManager::AddExtensionPlugin wxIFMExtensionPluginBase plugin  )  [private]
 

Adds an extension plugin to a given interface plugin

Parameters:
plugin The extension plugin to add
interface_index Interface plugin to add this extension to
Note:
This function will initialize the plugin before adding it.

Definition at line 277 of file manager.cpp.

References GetActiveIP(), and wxIFMInterfacePluginBase::PushExtensionPlugin().

int wxInterfaceManager::AddInterfacePlugin wxIFMInterfacePluginBase plugin,
bool  select = true
[private]
 

Adds an interface plugin to the interface manager

Parameters:
plugin The interface plugin to add
select If true, the plugin will also be selected as the active interface plugin
Returns:
The index of the interface plugin. Use this value to select this interface plugin with wxInterfaceManager::SetActiveInterface. A return value of -1 indicates there was an error during plugin initialization, and that the plugin should be deleted.

Definition at line 212 of file manager.cpp.

References wxIFMInterfacePluginBase::Initialize(), m_interfacePlugins, and SetActiveInterface().

Referenced by Initialize().

void wxInterfaceManager::AddPendingUpdate wxRect  rect = IFM_DEFAULT_RECT,
bool  floating = false
 

This function is identical to the wxInterfaceManager::Update function, except that the interface is not updated immediately. An event is posted to the event que and the interface will be updated when this event is processed.

Parameters:
rect Default value implies the entire client area should be used for the update. Otherwise, the specified area will be used.
floating If true, floating windows will also be updated

Definition at line 369 of file manager.cpp.

References GetActiveIP(), IFM_DEFAULT_RECT, m_content, m_parent, m_updateRect, and m_useUpdateRect.

Referenced by wxIFMDefaultPlugin::OnShowComponent().

void wxInterfaceManager::CaptureInput wxIFMComponent component  ) 
 

Called by plugins to allow for individual components to "capture" mouse and keyboard messages.

Parameters:
component The component capturing input

Definition at line 292 of file manager.cpp.

References wxIFMComponent::GetType(), IFM_GET_EXTENSION_DATA, m_capturedComponent, m_capturedType, and m_parent.

Referenced by wxIFMDefaultDockingPlugin::OnDragInit(), and wxIFMDefaultResizePlugin::OnLeftDown().

void wxInterfaceManager::DisplayStatusMessage const wxString &  message  ) 
 

Used by plugins to display a status message to the user in the parent frames status bar using the pane set earlier by wxInterfaceManager::SetStatusPane

Parameters:
message Message to be displayed.
Note:
This function will do nothing if displaying status bar messages is currently disabled by called SetStatusMessagePane with the parameter of IFM_DISABLE_STATUS_MESSAGES, or if the window that this object is managing is not a frame (or a frame derivative).

Definition at line 398 of file manager.cpp.

References IFM_DISABLE_STATUS_MESSAGES, m_oldStatusMessage, m_parent, m_statusbarPane, and m_statusMessageDisplayed.

Referenced by wxIFMDefaultDockingPlugin::OnDragBegin().

wxIFMInterfacePluginBase * wxInterfaceManager::GetActiveIP  )  const [private]
 

Definition at line 121 of file manager.cpp.

References m_activeInterface, and m_interfacePlugins.

Referenced by AddChild(), AddExtensionPlugin(), AddPendingUpdate(), IsChildVisible(), RemoveAllExtensionPlugins(), RemoveExtensionPlugin(), SetChildSize(), ShowChild(), and Update().

wxIFMComponent * wxInterfaceManager::GetCapturedComponent  )  const
 

Returns:
The component which has captured input, or NULL if no componet has

Definition at line 131 of file manager.cpp.

References m_capturedComponent.

Referenced by wxIFMInterfacePluginBase::OnKeyDown(), wxIFMInterfacePluginBase::OnKeyUp(), and wxIFMInterfacePluginBase::OnMouseEvent().

wxWindow * wxInterfaceManager::GetCapturedWindow  )  const
 

Returns:
The wxWindow object that has currently captured mouse input or NULL if input is not captured. Use this window for client to screen and back conversions.

Definition at line 332 of file manager.cpp.

References m_capturedComponent, and m_parent.

Referenced by wxIFMDefaultDockingPlugin::OnDrag(), wxIFMDefaultDockingPlugin::OnDragBegin(), wxIFMDefaultDockingPlugin::OnDragInit(), wxIFMDefaultResizePlugin::OnLeftDown(), wxIFMDefaultDockingPlugin::OnMouseMove(), wxIFMDefaultResizePlugin::OnResizeBegin(), and wxIFMDefaultResizePlugin::OnResizing().

wxWindow * wxInterfaceManager::GetContentWindow  )  const
 

Returns:
Content window managed by the interface

Definition at line 96 of file manager.cpp.

References m_content.

int wxInterfaceManager::GetFlags  )  const
 

Returns:
Flags being used

Definition at line 111 of file manager.cpp.

References m_flags.

Referenced by wxIFMInterfacePluginBase::OnSize().

const wxRect & wxInterfaceManager::GetInterfaceRect  )  const
 

Returns:
The rect currently available to the interface manager
Plugins should use this function to figure out how much space an interface has to work with instead of assuming they have the whole client area.

Definition at line 80 of file manager.cpp.

References m_updateRect.

Referenced by wxIFMDefaultDockingPlugin::CreateTargetButtons(), wxIFMDefaultInterfacePlugin::OnGetContentRect(), and wxIFMDefaultDockingPlugin::OnShowDropTargets().

wxWindow * wxInterfaceManager::GetParent  )  const
 

Returns:
Parent window this interface manages

Definition at line 75 of file manager.cpp.

References m_parent.

Referenced by wxIFMDefaultDockingPlugin::CreateTargetButtons(), wxIFMInterfacePluginBase::GetComponentByPos(), wxIFMComponent::GetParentWindow(), wxIFMDefaultPanelPlugin::OnDock(), wxIFMInterfacePluginBase::OnPaint(), wxIFMDefaultDockingPlugin::OnShowDropTargets(), wxIFMDefaultInterfacePlugin::OnUpdate(), wxIFMDefaultDockingPlugin::ShowComponentDropButtons(), and wxIFMDefaultDockingPlugin::ShowFrameDropButtons().

void wxInterfaceManager::HideChild wxWindow *  child,
bool  update = true
 

Hides a child window that is managed by this interface

Parameters:
child The child window to show or hide
update If true, the interface will be updated immediately. Otherwise, changes to the interface will not be reflected until a call to Update(), or the frame size changes.

Definition at line 116 of file manager.cpp.

References ShowChild().

Referenced by MainFrm::CreateGUIControls().

bool wxInterfaceManager::Initialize bool  defaultPlugins = true,
int  flags = IFM_DEFAULT_FLAGS
 

Performs necessary actions to ready the interface to recieve and manage children.

Parameters:
defaultPlugins If false, the default (essential functionality!) plugins will not be loaded.
flags Specifies any flags.
Currently the only flag is IFM_NO_RESIZE_UPDATE. If set, the interface will not be automatically updated in response to an EVT_SIZE event sent to its parent frame. It is the responsability of the parent frame to call wxInterfaceManager::Update in response to EVT_SIZE to update the interface.

Warning:
If you are not going to be using the default plugins, you must add your desired interface plugin(s) before calling this function.
Returns:
true if initialization was succesful, false if not.

Definition at line 136 of file manager.cpp.

References AddInterfacePlugin(), m_flags, m_initialized, and m_parent.

Referenced by MainFrm::CreateGUIControls().

bool wxInterfaceManager::IsChildVisible wxWindow *  child  ) 
 

Returns:
True if this child is not hidden within the interface.

Definition at line 195 of file manager.cpp.

References GetActiveIP(), wxIFMQueryChildEvent::IsVisible(), and wxIFMInterfacePluginBase::ProcessPluginEvent().

Referenced by MainFrm::BtnUpdateTreeClick(), and MainFrm::OnMenuOpen().

bool wxInterfaceManager::IsInputCaptured  )  const
 

Returns:
True if a component has captured input, false otherwise

Definition at line 126 of file manager.cpp.

References m_capturedComponent.

Referenced by wxIFMInterfacePluginBase::OnMouseEvent().

void wxInterfaceManager::ReleaseInput  ) 
 

Releases input if it is captured by a certain component

Definition at line 312 of file manager.cpp.

References IFM_COMPONENT_UNDEFINED, m_capturedComponent, m_capturedType, and m_parent.

Referenced by wxIFMDefaultResizePlugin::OnKeyDown(), wxIFMDefaultDockingPlugin::OnKeyDown(), wxIFMDefaultResizePlugin::OnLeftUp(), and wxIFMDefaultDockingPlugin::OnLeftUp().

void wxInterfaceManager::RemoveAllExtensionPlugins  )  [private]
 

Removes and deletes all extension plugins for the given interface plugin

Parameters:
interface_index plugin to remove extensions from
Note:
If an interface plugin adds extension plugins to itself during initialization, those plugins will be removed by this function.

Definition at line 287 of file manager.cpp.

References GetActiveIP(), and wxIFMInterfacePluginBase::PopAllExtensionPlugins().

void wxInterfaceManager::RemoveAllInterfacePlugins  )  [private]
 

Removes and deletes all interface plugins.

Definition at line 271 of file manager.cpp.

References m_interfacePlugins, and RemoveInterfacePlugin().

Referenced by Shutdown().

void wxInterfaceManager::RemoveExtensionPlugin  )  [private]
 

Removes and deletes the most recently added extension plugin for the given interface plugin

Parameters:
interface_index plugin to remove an extension from
Note:
If an interface plugin adds extension plugins to itself during initialization, those plugins will be removed by this function.

Definition at line 282 of file manager.cpp.

References GetActiveIP(), and wxIFMInterfacePluginBase::PopExtensionPlugin().

void wxInterfaceManager::RemoveInterfacePlugin int  interface_index = IFM_INTERFACE_ACTIVE  )  [private]
 

Removes and deletes the specified interface plugin.

Parameters:
Interface plugin to remove
Note:
If the active interface plugin is removed, no new interface plugin will be selected until a call to SetActiveInterface is made.

Definition at line 253 of file manager.cpp.

References m_interfacePlugins.

Referenced by RemoveAllInterfacePlugins().

void wxInterfaceManager::ResetInterfaceRect  ) 
 

Calling this function will prevent the interface from being restricted to the rect previously set by SetInterfaceRect.

Definition at line 91 of file manager.cpp.

References m_useUpdateRect.

void wxInterfaceManager::ResetStatusMessage  ) 
 

Used by plugins to reset the status display message to the message that was present before they called wxInterfaceManager::DisplayStatusMessage. The first time DisplayStatusMessage is called (or the first time it is called after calling ResetStatusMessage) the current status bar pane message will be saved. Future calls to DisplayStatusMessage will not change the saved string until ResetStatusMessage is called.

For example, if the status bar pane contained the text "Ready" and DisplayStatusMessage was called two times with two different messages, ResetStatusMessage will change the status bar pane's text back to "Ready". A second call to ResetStatusMessage will do nothing.

Note:
This function will do nothing if displaying status bar messages is currently disabled by called SetStatusMessagePane with the parameter of IFM_DISABLE_STATUS_MESSAGES, or if the window that this object is managing is not a frame (or a frame derivative).

Definition at line 421 of file manager.cpp.

References IFM_DISABLE_STATUS_MESSAGES, m_oldStatusMessage, m_parent, m_statusbarPane, and m_statusMessageDisplayed.

Referenced by wxIFMDefaultDockingPlugin::OnDragEnd().

void wxInterfaceManager::SetActiveInterface int  plugin  )  [private]
 

Sets the active interface plugin

Parameters:
plugin Index of the plugin to activate

Definition at line 235 of file manager.cpp.

References m_activeInterface, and m_interfacePlugins.

Referenced by AddInterfacePlugin().

void wxInterfaceManager::SetChildSize wxWindow *  child,
const wxSize &  desired,
const wxSize &  min = IFM_USE_CURRENT_SIZE,
const wxSize &  max = IFM_USE_CURRENT_SIZE,
bool  update = true
 

Change the minimum, maximum, and desired size of the given child window.

Note:
If the width or height value of any of the given sizes is IFM_USE_CURRENT_VALUE, the current min, max, or desired width or height will be used. Passing IFM_USE_CURRENT_SIZE for any of the sizes will not alter that given size.
Parameters:
child Window whos sizes to change
desired New desired size of the window. Note that the window is not gaurenteed to actually be this size after calling this function.
min New minimum size
max New maximum size
update If true, the interface will update immeditely. Otherwise, changes in window sizes will not be reflected until the next interface update.

Definition at line 204 of file manager.cpp.

References GetActiveIP(), and wxIFMInterfacePluginBase::ProcessPluginEvent().

void wxInterfaceManager::SetContentWindow wxWindow *  content  ) 
 

Sets the content window that the interface will manage.

Parameters:
content Content window

Definition at line 101 of file manager.cpp.

References m_content.

Referenced by MainFrm::CreateGUIControls().

void wxInterfaceManager::SetFlags int  flags  ) 
 

Sets flags.

Definition at line 106 of file manager.cpp.

References m_flags.

void wxInterfaceManager::SetInterfaceRect const wxRect &  rect  ) 
 

Specifies a rectangle for the interface to occupy. The interface will restrict itself to this rect for all subsequent updates. To allow the interface to use the client size while updating, call ResetInterfaceRect.

Note:
If you call this function, and later call Update() and specify a different rect, the rect specified will be used as the new interface rect for all subsequent updates.
Parameters:
rect The rect to use

Definition at line 85 of file manager.cpp.

References m_updateRect, and m_useUpdateRect.

void wxInterfaceManager::SetStatusMessagePane int  pane  ) 
 

This function is used to specify which pane of the managed frame's status bar will be used by wxIFM to display messages to the user.

Parameters:
pane The pane to use to display messages. If IFM_DISABLE_STATUS_MESSAGES is specified, status messages will not be displayed.
Note:
By default, the displaying of status bar messages is disabled.

If you call this function while a status message is being displayed with DisplayStatusMessage, the new pane will not recieve the status message until another call to DisplayStatusMessage is made. Calls to ResetStatusMessage will not change the message of the original pane, but of the new one instead. If you change the pane used for display at an arbitrary time during your applications life span, be sure to clean up the message on the original pane yourself.

This function will do nothing if the window that this object is managing is not a frame (or a frame derivitive)

Definition at line 393 of file manager.cpp.

References m_statusbarPane.

Referenced by MainFrm::CreateGUIControls().

void wxInterfaceManager::ShowChild wxWindow *  child,
bool  show,
bool  update = true
 

Shows or hides a child window that is managed by this interface

Parameters:
show True to show the child, false to hide it
child The child window to show or hide
update If true, the interface will be updated immediately. Otherwise, changes to the interface will not be reflected until a call to Update(), or the frame size changes.

Definition at line 188 of file manager.cpp.

References GetActiveIP(), and wxIFMInterfacePluginBase::ProcessPluginEvent().

Referenced by MainFrm::BtnUpdateTreeClick(), HideChild(), MainFrm::OnMenu(), and MainFrm::OnShowAll().

void wxInterfaceManager::Shutdown  ) 
 

Performs necessary cleanup to ready the interface for deletion.

Note:
This function will remove (and delete) all plugins from the interface.

Definition at line 157 of file manager.cpp.

References m_initialized, m_parent, and RemoveAllInterfacePlugins().

Referenced by MainFrm::MainFrmClose().

void wxInterfaceManager::Update wxRect  rect = IFM_DEFAULT_RECT,
bool  floating = false
 

Immediately updates the interface, repositioning child windows. Floating windows are not included in this update unless specified.

Note:
If you specify a rect to use for sizing with this function, SetInterfaceRect() will be called, and the rect specified will be used for all subsequent updates unless ResetInterfaceRect() is called.
Parameters:
rect Default value implies the entire client area should be used for the update. Otherwise, the specified area will be used.
floating If true, floating windows will also be updated

Definition at line 345 of file manager.cpp.

References GetActiveIP(), IFM_DEFAULT_RECT, m_content, m_parent, m_updateRect, m_useUpdateRect, and wxIFMInterfacePluginBase::ProcessPluginEvent().

Referenced by AddChild(), MainFrm::CreateGUIControls(), wxIFMDefaultDockingPlugin::OnDragBegin(), wxIFMDefaultDockingPlugin::OnDragEnd(), wxIFMDefaultResizePlugin::OnResizeEnd(), wxIFMDefaultPlugin::OnSetChildSize(), MainFrm::OnShowAll(), wxIFMInterfacePluginBase::OnSize(), and MainFrm::OnSize().


Member Data Documentation

int wxInterfaceManager::m_activeInterface [private]
 

Definition at line 145 of file manager.h.

Referenced by GetActiveIP(), and SetActiveInterface().

wxIFMComponent* wxInterfaceManager::m_capturedComponent [private]
 

indentifies which component has captured input, if any

Definition at line 147 of file manager.h.

Referenced by CaptureInput(), GetCapturedComponent(), GetCapturedWindow(), IsInputCaptured(), and ReleaseInput().

int wxInterfaceManager::m_capturedType [private]
 

specifies the type of the component that has captured input

Definition at line 148 of file manager.h.

Referenced by CaptureInput(), and ReleaseInput().

wxWindow * wxInterfaceManager::m_content [private]
 

Definition at line 142 of file manager.h.

Referenced by AddPendingUpdate(), GetContentWindow(), SetContentWindow(), and Update().

int wxInterfaceManager::m_flags [private]
 

Definition at line 140 of file manager.h.

Referenced by GetFlags(), Initialize(), and SetFlags().

bool wxInterfaceManager::m_initialized [private]
 

Definition at line 139 of file manager.h.

Referenced by AddChild(), Initialize(), and Shutdown().

wxIFMInterfacePluginArray wxInterfaceManager::m_interfacePlugins [private]
 

Definition at line 144 of file manager.h.

Referenced by AddInterfacePlugin(), GetActiveIP(), RemoveAllInterfacePlugins(), RemoveInterfacePlugin(), and SetActiveInterface().

wxString wxInterfaceManager::m_oldStatusMessage [private]
 

Definition at line 158 of file manager.h.

Referenced by DisplayStatusMessage(), and ResetStatusMessage().

wxWindow* wxInterfaceManager::m_parent [private]
 

Definition at line 142 of file manager.h.

Referenced by AddPendingUpdate(), CaptureInput(), DisplayStatusMessage(), GetCapturedWindow(), GetParent(), Initialize(), ReleaseInput(), ResetStatusMessage(), Shutdown(), Update(), and wxInterfaceManager().

int wxInterfaceManager::m_statusbarPane [private]
 

Definition at line 156 of file manager.h.

Referenced by DisplayStatusMessage(), ResetStatusMessage(), and SetStatusMessagePane().

bool wxInterfaceManager::m_statusMessageDisplayed [private]
 

Definition at line 157 of file manager.h.

Referenced by DisplayStatusMessage(), and ResetStatusMessage().

wxRect wxInterfaceManager::m_updateRect [private]
 

Definition at line 153 of file manager.h.

Referenced by AddPendingUpdate(), GetInterfaceRect(), SetInterfaceRect(), and Update().

bool wxInterfaceManager::m_useUpdateRect [private]
 

Definition at line 154 of file manager.h.

Referenced by AddPendingUpdate(), ResetInterfaceRect(), SetInterfaceRect(), and Update().


The documentation for this class was generated from the following files:

 

SourceForge Logo