]>
git.saurik.com Git - wxWidgets.git/blob - utils/framelayout/src/frmview.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Contrib. demo
4 // Author: Aleksandras Gluchovas
8 // Copyright: (c) Aleksandras Gluchovas
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
15 #include "wx/module.h"
21 class wxObjectStorage
;
23 #include "controlbar.h"
27 class wxFrameView
: public wxEvtHandler
30 wxStringList mTopMenus
;
31 wxFrameLayout
* mpLayout
;
32 wxFrameManager
* mpFrameMgr
;
35 friend class wxFrameManager
;
36 friend class wxFrameViewSerializer
;
39 void OnIdle( wxIdleEvent
& event
);
45 virtual void Activate();
46 virtual void Deactivate();
48 wxFrame
* GetParentFrame();
49 wxWindow
* GetClientWindow();
51 wxFrameManager
& GetFrameManager();
53 void RegisterMenu( const wxString
& topMenuName
);
56 wxFrameLayout
* GetLayout();
57 void SetLayout( wxFrameLayout
* pLayout
);
58 void SetToolUpdates( bool doToolUpdates
= TRUE
);
61 // hooks for specific frame-views
63 virtual void OnInit() {}
65 virtual void OnSerialize( wxObjectStorage
& store
) {}
66 virtual void OnActiveate() {}
67 virtual void OnDeactivate() {}
70 virtual void OnRecreate() {}
71 virtual void OnInitMenus() {}
78 class wxFrameManager
: wxObject
84 wxWindow
* mpClientWnd
;
87 wxObjectStorage mStore
;
90 wxString mSettingsFile
;
93 void DoSerialize( wxObjectStorage
& store
);
95 int GetViewNo( wxFrameView
* pView
);
96 void EnableMenusForView( wxFrameView
* pView
, bool enable
);
103 // if file name is empty, views are are not saved/loaded
105 virtual void Init( wxWindow
* pMainFrame
, const wxString
& settingsFile
= "" );
108 wxFrame
* GetParentFrame();
109 wxWindow
* GetParentWindow();
111 int GetActiveViewNo();
112 wxFrameView
* GetActiveView();
113 wxNode
* GetActiveViewNode();
115 wxFrameView
* GetView( int viewNo
);
117 void SetClinetWindow( wxWindow
* pFrameClient
);
118 wxWindow
* GetClientWindow();
120 void AddView( wxFrameView
* pFrmView
);
121 void RemoveView( wxFrameView
* pFrmView
);
123 void ActivateView( int viewNo
);
124 void ActivateView( wxFrameView
* pFrmView
);
125 void DeactivateCurrentView();
127 wxObjectStorage
& GetObjectStore();
132 bool ViewsAreLoaded();