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