Main Page | Namespace List | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

wxLayoutManager Class Reference

#include <layoutmanager.h>

Collaboration diagram for wxLayoutManager:

Collaboration graph
[legend]
List of all members.

Detailed Description

One of the main classes of wxDockIt.

It handles all the XXXX

Definition at line 109 of file layoutmanager.h.

Public Member Functions

 wxLayoutManager (wxWindow *pOwnerWindow)
 ~wxLayoutManager ()
void Init ()
void SetLayout (unsigned int flags, wxWindow *pAutoLayoutClientWindow=NULL)
void SetWindowMenu (wxMenu *menu)
void AddDefaultHosts ()
void AddDockHost (wxDirection dir, int initialSize=wxINITIAL_HOST_SIZE, const wxString &name=wxT("guessname"))
wxDockHostGetDockHost (const wxString &name)
wxDockHostGetDockHost (const wxDirection &_dir)
void AddDockWindow (wxDockWindowBase *pDockWindow)
void DockWindow (wxDockWindowBase *pDockWindow, wxHostInfo &hi, bool noHideOperation=false)
void UndockWindow (wxDockWindowBase *pDockWindow, bool noShowOperation=false)
bool SaveToStream (wxOutputStream &stream)
bool LoadFromStream (wxInputStream &stream)
bool SaveToXML (const wxString &filename)
 SaveToXML allows the layout manager to save the current window layout and host setup into an XML document for reloading later.
bool LoadFromXML (const wxString &filename)
 LoadFromXML will retrieve the layout from the specified XML document and apply it to the current dock windows and hosts.
bool SaveToConfig (wxConfigBase *, const wxString &key) const
bool LoadFromConfig (wxConfigBase *, const wxString &key)
wxHostInfo TestForHost (int sx, int sy)
wxRect TrimDockArea (wxDockHost *pDockHost, wxRect &dockArea)
bool IsPrimaryDockHost (wxDockHost *pDockHost)
void SetDockArea (wxRect &rect)
wxRect GetDockArea ()
wxRect RectToScreen (wxRect &rect)
wxPoint PointFromScreen (wxPoint &point)
unsigned int GetFlags ()
void UpdateAllHosts (bool sizeChange, wxDockHost *pIgnoreHost=NULL)
void OnSize ()
void OnMove ()
void OnUpdateLayout ()
void OnMenuToggle (int entryId)

Private Member Functions

wxDockHostfindDockHost (const wxString &name)
wxDockWindowBasefindDockWindow (const wxString &name)
void settingsChanged ()

Private Attributes

DockHostList dockHosts_
DockWindowList dockWindows_
wxWindow * pOwnerWindow_
wxOwnerEventHandler frameEventHandler_
unsigned int flags_
wxWindow * pAutoLayoutClientWindow_
wxRect dockArea_
wxMenu * pWindowMenu_


Constructor & Destructor Documentation

wxLayoutManager::wxLayoutManager wxWindow *  pOwnerWindow  ) 
 

Definition at line 89 of file layoutmanager.cpp.

wxLayoutManager::~wxLayoutManager  ) 
 

Definition at line 98 of file layoutmanager.cpp.

References dockWindows_, and pOwnerWindow_.


Member Function Documentation

void wxLayoutManager::AddDefaultHosts  ) 
 

Definition at line 126 of file layoutmanager.cpp.

References AddDockHost().

void wxLayoutManager::AddDockHost wxDirection  dir,
int  initialSize = wxINITIAL_HOST_SIZE,
const wxString &  name = wxT("guessname")
 

Definition at line 134 of file layoutmanager.cpp.

References dockHosts_, wxDockHost::GetDirection(), pOwnerWindow_, wxDockHost::SetAreaSize(), wxDockHost::SetLayoutManager(), wxDEFAULT_BOTTOM_HOST, wxDEFAULT_LEFT_HOST, wxDEFAULT_RIGHT_HOST, and wxDEFAULT_TOP_HOST.

Referenced by AddDefaultHosts().

void wxLayoutManager::AddDockWindow wxDockWindowBase pDockWindow  ) 
 

Definition at line 202 of file layoutmanager.cpp.

References dockWindows_.

void wxLayoutManager::DockWindow wxDockWindowBase pDockWindow,
wxHostInfo hi,
bool  noHideOperation = false
 

Definition at line 308 of file layoutmanager.cpp.

References wxDockWindowBase::ActualShow(), wxDockHost::DockPanel(), wxDockPanel::GetDockedHost(), wxDockWindowBase::GetDockPanel(), wxHostInfo::pHost, wxHostInfo::pPanel, wxDockWindowBase::SetDocked(), wxDockWindowBase::SetDockingInfo(), UndockWindow(), UpdateAllHosts(), and wxHostInfo::valid.

Referenced by wxDockWindowBase::applyLastDock(), LoadFromStream(), LoadFromXML(), and wxDockWindowBase::StopDragging().

wxDockHost * wxLayoutManager::findDockHost const wxString &  name  )  [private]
 

Definition at line 430 of file layoutmanager.cpp.

References dockHosts_.

Referenced by LoadFromStream(), and LoadFromXML().

wxDockWindowBase * wxLayoutManager::findDockWindow const wxString &  name  )  [private]
 

Definition at line 443 of file layoutmanager.cpp.

References dockWindows_.

Referenced by LoadFromStream(), and LoadFromXML().

wxRect wxLayoutManager::GetDockArea  ) 
 

Definition at line 304 of file layoutmanager.cpp.

References dockArea_.

Referenced by wxDockHost::CalcHostPlacement(), and wxExSplitter::SetBoundaries().

wxDockHost * wxLayoutManager::GetDockHost const wxDirection &  _dir  ) 
 

Definition at line 186 of file layoutmanager.cpp.

References dockHosts_.

wxDockHost * wxLayoutManager::GetDockHost const wxString &  name  ) 
 

Definition at line 174 of file layoutmanager.cpp.

References dockHosts_.

unsigned int wxLayoutManager::GetFlags  ) 
 

Definition at line 286 of file layoutmanager.cpp.

References flags_.

Referenced by wxDockHost::SettingsChanged().

void wxLayoutManager::Init  ) 
 

Definition at line 110 of file layoutmanager.cpp.

References dockHosts_, dockWindows_, flags_, pAutoLayoutClientWindow_, pWindowMenu_, and wxDWF_SPLITTER_BORDERS.

bool wxLayoutManager::IsPrimaryDockHost wxDockHost pDockHost  ) 
 

Definition at line 290 of file layoutmanager.cpp.

References dockHosts_.

Referenced by wxDockHost::OnCalculateLayout().

bool wxLayoutManager::LoadFromConfig wxConfigBase *  ,
const wxString &  key
 

Definition at line 1123 of file layoutmanager.cpp.

bool wxLayoutManager::LoadFromStream wxInputStream &  stream  ) 
 

Definition at line 548 of file layoutmanager.cpp.

References wxDockWindowBase::Appear(), wxDockWindowBase::ClearDockingInfo(), DockWindow(), dockWindows_, findDockHost(), findDockWindow(), wxDockWindowBase::GetDockPanel(), wxDockPanel::LockAreaValue(), wxDockHost::LockPanelValue(), wxUtil::ReadString(), wxDockWindowBase::Remove(), wxDockHost::SetAreaSize(), wxDockWindowBase::SetDocked(), wxDockWindowBase::SetDockingInfo(), wxDockHost::SetPanelArea(), STREAM_VERSION, and UpdateAllHosts().

bool wxLayoutManager::LoadFromXML const wxString &  filename  ) 
 

LoadFromXML will retrieve the layout from the specified XML document and apply it to the current dock windows and hosts.

TODO: need to error-check the xmlFindNode() return value properly TODO: figure out a way to handle existing windows that do not exist in the saved layout

Author:
Landon Bradshaw <landon@phazeforward.com>
Parameters:
const wxString& filename The XML file to load the layout from
Returns:
bool true means there were no errors, false means the load failed

Definition at line 942 of file layoutmanager.cpp.

References wxDockWindowBase::Appear(), wxDockWindowBase::ClearDockingInfo(), DockWindow(), dockWindows_, findDockHost(), findDockWindow(), wxDockWindowBase::GetDockPanel(), wxDockPanel::LockAreaValue(), wxDockHost::LockPanelValue(), wxDockWindowBase::Remove(), wxDockHost::SetAreaSize(), wxDockWindowBase::SetDocked(), wxDockWindowBase::SetDockingInfo(), wxDockHost::SetPanelArea(), STREAM_VERSION, UpdateAllHosts(), and xmlFindNode().

void wxLayoutManager::OnMenuToggle int  entryId  ) 
 

Definition at line 370 of file layoutmanager.cpp.

References dockWindows_, wxDockWindowBase::GetTitle(), pWindowMenu_, wxDockWindowBase::Show(), and UpdateAllHosts().

Referenced by wxOwnerEventHandler::OnMenu().

void wxLayoutManager::OnMove  ) 
 

Definition at line 362 of file layoutmanager.cpp.

Referenced by wxOwnerEventHandler::OnMove().

void wxLayoutManager::OnSize  ) 
 

Definition at line 357 of file layoutmanager.cpp.

References UpdateAllHosts().

void wxLayoutManager::OnUpdateLayout  ) 
 

Definition at line 366 of file layoutmanager.cpp.

References UpdateAllHosts().

Referenced by wxOwnerEventHandler::OnUpdateLayout().

wxPoint wxLayoutManager::PointFromScreen wxPoint &  point  ) 
 

Definition at line 281 of file layoutmanager.cpp.

References pOwnerWindow_.

Referenced by wxDockWindowBase::OnMouseMove().

wxRect wxLayoutManager::RectToScreen wxRect &  rect  ) 
 

Definition at line 272 of file layoutmanager.cpp.

References pOwnerWindow_.

Referenced by wxDockHost::GetScreenArea(), and wxDockWindowBase::OnMouseMove().

bool wxLayoutManager::SaveToConfig wxConfigBase *  ,
const wxString &  key
const
 

Definition at line 1118 of file layoutmanager.cpp.

bool wxLayoutManager::SaveToStream wxOutputStream &  stream  ) 
 

Definition at line 471 of file layoutmanager.cpp.

References dockHosts_, dockWindows_, wxDockHost::GetAreaSize(), wxDockWindowBase::GetDockingInfo(), wxDockWindowBase::GetDockPanel(), wxDockHost::GetDockWindowList(), wxDockHost::GetPanelArea(), wxDockWindowBase::IsDocked(), wxHostInfo::pHost, STREAM_VERSION, and wxUtil::WriteString().

bool wxLayoutManager::SaveToXML const wxString &  filename  ) 
 

SaveToXML allows the layout manager to save the current window layout and host setup into an XML document for reloading later.

This XML tree will contain three main sections, windows, hosts and slidebars, though the slidebars have a similiar function to save their state separately.

TODO: only change existing nodes, currently conflicts with wxSlideBar::SaveToXML()

Author:
Landon Bradshaw <landon@phazeforward.com>
Parameters:
const wxString& filename Filename to use for the XML file
Returns:
bool true for success, false on error

Definition at line 807 of file layoutmanager.cpp.

References dockHosts_, dockWindows_, eNode(), wxDockPanel::GetArea(), wxDockHost::GetAreaSize(), wxDockWindowBase::GetDockingInfo(), wxDockWindowBase::GetDockPanel(), wxDockHost::GetDockWindowList(), wxDockHost::GetPanelArea(), wxDockWindowBase::IsDocked(), wxHostInfo::pHost, and STREAM_VERSION.

void wxLayoutManager::SetDockArea wxRect &  rect  ) 
 

Definition at line 300 of file layoutmanager.cpp.

References dockArea_.

Referenced by wxDockHost::OnCalculateLayout().

void wxLayoutManager::SetLayout unsigned int  flags,
wxWindow *  pAutoLayoutClientWindow = NULL
 

Definition at line 118 of file layoutmanager.cpp.

References flags_, pAutoLayoutClientWindow_, and settingsChanged().

void wxLayoutManager::settingsChanged  )  [private]
 

Definition at line 456 of file layoutmanager.cpp.

References dockHosts_, and wxDockHost::SettingsChanged().

Referenced by SetLayout().

void wxLayoutManager::SetWindowMenu wxMenu *  menu  )  [inline]
 

Definition at line 120 of file layoutmanager.h.

wxHostInfo wxLayoutManager::TestForHost int  sx,
int  sy
 

Definition at line 216 of file layoutmanager.cpp.

References dockHosts_, and wxDockHost::TestForPanel().

Referenced by wxDockWindowBase::OnMouseMove().

wxRect wxLayoutManager::TrimDockArea wxDockHost pDockHost,
wxRect &  dockArea
 

Definition at line 228 of file layoutmanager.cpp.

References dockHosts_, wxDockHost::GetClientArea(), wxDockHost::GetDirection(), and wxDockHost::IsEmpty().

Referenced by wxDockHost::GetScreenArea().

void wxLayoutManager::UndockWindow wxDockWindowBase pDockWindow,
bool  noShowOperation = false
 

Definition at line 335 of file layoutmanager.cpp.

References wxDockWindowBase::ActualShow(), wxDockPanel::GetDockedHost(), wxDockWindowBase::GetDockPanel(), wxDockWindowBase::IsDocked(), wxDockWindowBase::SetDocked(), wxDockHost::UndockPanel(), and UpdateAllHosts().

Referenced by DockWindow(), wxDockPanel::OnGripDblClick(), wxDockWindowBase::Remove(), and wxDockWindowBase::StopDragging().

void wxLayoutManager::UpdateAllHosts bool  sizeChange,
wxDockHost pIgnoreHost = NULL
 

Definition at line 392 of file layoutmanager.cpp.

References dockWindows_, wxDockWindowBase::GetTitle(), wxDockWindowBase::IsVisible(), pAutoLayoutClientWindow_, pOwnerWindow_, and pWindowMenu_.

Referenced by DockWindow(), LoadFromStream(), LoadFromXML(), OnMenuToggle(), wxDockPanel::OnPaneClose(), OnSize(), wxDockHost::OnSize(), OnUpdateLayout(), and UndockWindow().


Member Data Documentation

wxRect wxLayoutManager::dockArea_ [private]
 

Definition at line 180 of file layoutmanager.h.

Referenced by GetDockArea(), and SetDockArea().

DockHostList wxLayoutManager::dockHosts_ [private]
 

Definition at line 172 of file layoutmanager.h.

Referenced by AddDockHost(), findDockHost(), GetDockHost(), Init(), IsPrimaryDockHost(), SaveToStream(), SaveToXML(), settingsChanged(), TestForHost(), and TrimDockArea().

DockWindowList wxLayoutManager::dockWindows_ [private]
 

Definition at line 173 of file layoutmanager.h.

Referenced by AddDockWindow(), findDockWindow(), Init(), LoadFromStream(), LoadFromXML(), OnMenuToggle(), SaveToStream(), SaveToXML(), UpdateAllHosts(), and ~wxLayoutManager().

unsigned int wxLayoutManager::flags_ [private]
 

Definition at line 178 of file layoutmanager.h.

Referenced by GetFlags(), Init(), and SetLayout().

wxOwnerEventHandler wxLayoutManager::frameEventHandler_ [private]
 

Definition at line 176 of file layoutmanager.h.

wxWindow* wxLayoutManager::pAutoLayoutClientWindow_ [private]
 

Definition at line 179 of file layoutmanager.h.

Referenced by Init(), SetLayout(), and UpdateAllHosts().

wxWindow* wxLayoutManager::pOwnerWindow_ [private]
 

Definition at line 175 of file layoutmanager.h.

Referenced by AddDockHost(), PointFromScreen(), RectToScreen(), UpdateAllHosts(), and ~wxLayoutManager().

wxMenu* wxLayoutManager::pWindowMenu_ [private]
 

Definition at line 181 of file layoutmanager.h.

Referenced by Init(), OnMenuToggle(), and UpdateAllHosts().


The documentation for this class was generated from the following files:
Generated on Sat May 14 14:54:39 2005 for wxDockIt by  doxygen 1.4.2