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