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