]>
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 | ||
2b5f62a0 | 35 | class WXFL_DECLSPEC 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 ); | |
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 | |
4cbc57f0 JS |
73 | virtual void OnSerialize( wxObjectStorage& store ) {} |
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 | ||
2b5f62a0 | 90 | class WXFL_DECLSPEC wxFrameManager : 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 | |
4cbc57f0 | 117 | virtual void Init( wxWindow* pMainFrame, const wxString& settingsFile = "" ); |
8e08b761 | 118 | |
4cbc57f0 JS |
119 | // synonyms |
120 | wxFrame* GetParentFrame(); | |
121 | wxWindow* GetParentWindow(); | |
8e08b761 | 122 | |
4cbc57f0 JS |
123 | int GetActiveViewNo(); |
124 | wxFrameView* GetActiveView(); | |
125 | wxNode* GetActiveViewNode(); | |
8e08b761 | 126 | |
4cbc57f0 | 127 | wxFrameView* GetView( int viewNo ); |
8e08b761 | 128 | |
4cbc57f0 JS |
129 | void SetClinetWindow( wxWindow* pFrameClient ); |
130 | wxWindow* GetClientWindow(); | |
8e08b761 | 131 | |
4cbc57f0 JS |
132 | void AddView( wxFrameView* pFrmView ); |
133 | void RemoveView( wxFrameView* pFrmView ); | |
8e08b761 | 134 | |
4cbc57f0 JS |
135 | void ActivateView( int viewNo ); |
136 | void ActivateView( wxFrameView* pFrmView ); | |
137 | void DeactivateCurrentView(); | |
8e08b761 | 138 | |
4cbc57f0 | 139 | wxObjectStorage& GetObjectStore(); |
8e08b761 | 140 | |
4cbc57f0 JS |
141 | void SaveViewsNow(); |
142 | bool ReloadViews(); | |
8e08b761 | 143 | |
4cbc57f0 | 144 | bool ViewsAreLoaded(); |
8e08b761 JS |
145 | }; |
146 | ||
147 | #endif /* __FRMVIEW_G__ */ | |
148 |