]>
Commit | Line | Data |
---|---|---|
1 | ///////////////////////////////////////////////////////////////////////////// | |
2 | // Name: frmview.h | |
3 | // Purpose: wxFrameView and wxFrameManager classes. | |
4 | // Author: Aleksandras Gluchovas | |
5 | // Modified by: | |
6 | // Created: 02/01/99 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Aleksandras Gluchovas | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef __FRMVIEW_G__ | |
13 | #define __FRMVIEW_G__ | |
14 | ||
15 | #include "wx/module.h" | |
16 | ||
17 | #if 0 | |
18 | #include "wx/fl/objstore.h" | |
19 | #endif | |
20 | ||
21 | class wxObjectStorage; | |
22 | ||
23 | #include "wx/fl/controlbar.h" | |
24 | ||
25 | class wxFrameManager; | |
26 | ||
27 | /* | |
28 | It is not clear what this class does. It is not used elsewhere in FL. | |
29 | */ | |
30 | ||
31 | class WXDLLIMPEXP_FL wxFrameView : public wxEvtHandler | |
32 | { | |
33 | protected: | |
34 | wxStringList mTopMenus; | |
35 | wxFrameLayout* mpLayout; | |
36 | wxFrameManager* mpFrameMgr; | |
37 | bool mDoToolUpdates; | |
38 | ||
39 | friend class wxFrameManager; | |
40 | friend class wxFrameViewSerializer; | |
41 | ||
42 | protected: | |
43 | void OnIdle( wxIdleEvent& event); | |
44 | ||
45 | public: | |
46 | wxFrameView(); | |
47 | ~wxFrameView(); | |
48 | ||
49 | virtual void Activate(); | |
50 | virtual void Deactivate(); | |
51 | ||
52 | wxFrame* GetParentFrame(); | |
53 | wxWindow* GetClientWindow(); | |
54 | ||
55 | wxFrameManager& GetFrameManager(); | |
56 | ||
57 | void RegisterMenu( const wxString& topMenuName ); | |
58 | ||
59 | void CreateLayout(); | |
60 | wxFrameLayout* GetLayout(); | |
61 | void SetLayout( wxFrameLayout* pLayout ); | |
62 | void SetToolUpdates( bool doToolUpdates = true ); | |
63 | ||
64 | ||
65 | // hooks for specific frame-views | |
66 | ||
67 | virtual void OnInit() {} | |
68 | ||
69 | virtual void OnSerialize( wxObjectStorage& WXUNUSED(store) ) {} | |
70 | virtual void OnActiveate() {} | |
71 | virtual void OnDeactivate() {} | |
72 | ||
73 | // imp. is mandatory | |
74 | virtual void OnRecreate() {} | |
75 | virtual void OnInitMenus() {} | |
76 | ||
77 | DECLARE_EVENT_TABLE() | |
78 | }; | |
79 | ||
80 | class wxFrame; | |
81 | ||
82 | /* | |
83 | It is not clear what this class does. It is not used elsewhere in FL. | |
84 | */ | |
85 | ||
86 | class WXDLLIMPEXP_FL wxFrameManager : public wxObject | |
87 | { | |
88 | protected: | |
89 | wxList mViews; | |
90 | wxWindow* mpFrameWnd; | |
91 | int mActiveViewNo; | |
92 | wxWindow* mpClientWnd; | |
93 | ||
94 | #if 0 | |
95 | wxObjectStorage mStore; | |
96 | #endif | |
97 | ||
98 | wxString mSettingsFile; | |
99 | ||
100 | protected: | |
101 | void DoSerialize( wxObjectStorage& store ); | |
102 | void DestroyViews(); | |
103 | int GetViewNo( wxFrameView* pView ); | |
104 | void EnableMenusForView( wxFrameView* pView, bool enable ); | |
105 | void SyncAllMenus(); | |
106 | ||
107 | public: | |
108 | wxFrameManager(); | |
109 | ~wxFrameManager(); | |
110 | ||
111 | // if file name is empty, views are are not saved/loaded | |
112 | ||
113 | virtual void Init( wxWindow* pMainFrame, | |
114 | const wxString& settingsFile = wxEmptyString ); | |
115 | ||
116 | // synonyms | |
117 | wxFrame* GetParentFrame(); | |
118 | wxWindow* GetParentWindow(); | |
119 | ||
120 | int GetActiveViewNo(); | |
121 | wxFrameView* GetActiveView(); | |
122 | wxObjectList::compatibility_iterator GetActiveViewNode(); | |
123 | ||
124 | wxFrameView* GetView( int viewNo ); | |
125 | ||
126 | void SetClinetWindow( wxWindow* pFrameClient ); | |
127 | wxWindow* GetClientWindow(); | |
128 | ||
129 | void AddView( wxFrameView* pFrmView ); | |
130 | void RemoveView( wxFrameView* pFrmView ); | |
131 | ||
132 | void ActivateView( int viewNo ); | |
133 | void ActivateView( wxFrameView* pFrmView ); | |
134 | void DeactivateCurrentView(); | |
135 | ||
136 | wxObjectStorage& GetObjectStore(); | |
137 | ||
138 | void SaveViewsNow(); | |
139 | bool ReloadViews(); | |
140 | ||
141 | bool ViewsAreLoaded(); | |
142 | }; | |
143 | ||
144 | #endif /* __FRMVIEW_G__ */ | |
145 |