]> git.kernelconcepts.de Git - karo-tx-redboot.git/blob - tools/src/tools/configtool/standalone/wxwin/mainwin.h
unified MX27, MX25, MX37 trees
[karo-tx-redboot.git] / tools / src / tools / configtool / standalone / wxwin / mainwin.h
1 //####COPYRIGHTBEGIN####
2 //
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
5 //
6 // This program is part of the eCos host tools.
7 //
8 // This program is free software; you can redistribute it and/or modify it
9 // under the terms of the GNU General Public License as published by the Free
10 // Software Foundation; either version 2 of the License, or (at your option)
11 // any later version.
12 //
13 // This program is distributed in the hope that it will be useful, but WITHOUT
14 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
16 // more details.
17 //
18 // You should have received a copy of the GNU General Public License along with
19 // this program; if not, write to the Free Software Foundation, Inc.,
20 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
21 //
22 // ----------------------------------------------------------------------------
23 //
24 //####COPYRIGHTEND####
25 // mainwin.h :
26 //
27 //===========================================================================
28 //#####DESCRIPTIONBEGIN####
29 //
30 // Author(s):   julians
31 // Contact(s):  julians
32 // Date:        2000/08/24
33 // Version:     $Id$
34 // Purpose:
35 // Description: Header file for the ConfigTool main window
36 // Requires:
37 // Provides:
38 // See also:
39 // Known bugs:
40 // Usage:
41 //
42 //####DESCRIPTIONEND####
43 //
44 //===========================================================================
45
46 #ifndef _ECOS_MAINWIN_H_
47 #define _ECOS_MAINWIN_H_
48
49 #ifdef __GNUG__
50 #pragma interface "mainwin.h"
51 #endif
52
53 #include "wx/wx.h"
54 #include "wx/docview.h"
55
56 #include "splittree.h"
57
58 /*
59  * Status bar panes
60  */
61
62 #define ecStatusPane            0
63 #define ecFailRulePane          3
64
65 class ecValueWindow;
66 class ecOutputWindow;
67 class ecConfigTreeCtrl;
68 class ecShortDescriptionWindow;
69 class ecPropertyListCtrl;
70 class ecConflictListCtrl;
71 class ecFindDialog;
72 class WXDLLEXPORT wxSashLayoutWindow;
73
74 // Define a new frame type: this is going to be our main frame
75 class ecMainFrame : public wxDocParentFrame
76 {
77     friend class ecFindDialog;
78
79 public:
80 // Ctor(s)
81     ecMainFrame(wxDocManager *manager, const wxString& title, const wxPoint& pos, const wxSize& size);
82
83 //// Event handlers
84
85     void OnQuit(wxCommandEvent& event);
86     void OnAbout(wxCommandEvent& event);
87     void OnFind(wxCommandEvent& event);
88     void OnFindNext(wxCommandEvent& event);
89     void OnSize(wxSizeEvent& event);
90     void OnIdle(wxIdleEvent& event);
91     void OnCloseWindow(wxCloseEvent& event);
92     void OnHelpEcos(wxCommandEvent& event);
93     void OnHelpConfigtool(wxCommandEvent& event);
94     void OnHelpContext(wxCommandEvent& event);
95     void OnResolveConflicts(wxCommandEvent& event);
96     void OnSettings(wxCommandEvent& event);
97     void OnPlatforms(wxCommandEvent& event);
98     void OnBuildOptions(wxCommandEvent& event);
99     void OnTemplates(wxCommandEvent& event);
100     void OnAdmin(wxCommandEvent& event);
101     void OnPackages(wxCommandEvent& event);
102     void OnRunTests(wxCommandEvent& event);
103     void OnChooseRepository(wxCommandEvent& event);
104     void OnBuildToolsPath(wxCommandEvent& event);
105     void OnUserToolsPath(wxCommandEvent& event);
106     void OnWhatsThis(wxCommandEvent& event);
107     void OnSaveOutput(wxCommandEvent& event);
108     void OnImport(wxCommandEvent& event);
109     void OnExport(wxCommandEvent& event);
110     void OnBuildLibrary(wxCommandEvent& event);
111     void OnBuildTests(wxCommandEvent& event);
112     void OnStopBuild(wxCommandEvent& event);
113     void OnClean(wxCommandEvent& event);
114     void OnShell(wxCommandEvent& event);
115     void OnGenerateBuildTree(wxCommandEvent& event);
116
117     void OnNewRegion(wxCommandEvent& event);
118     void OnNewSection(wxCommandEvent& event);
119     void OnDeleteRegionOrSection(wxCommandEvent& event);
120     void OnRegionOrSectionProperties(wxCommandEvent& event);
121
122     void OnWebRedHatHome(wxCommandEvent& event);
123     void OnWebEcos(wxCommandEvent& event);
124     void OnWebNetRelease(wxCommandEvent& event);
125     void OnWebUitron(wxCommandEvent& event);
126     void OnRepositoryInfo(wxCommandEvent& event);
127     void OnIndexDocs(wxCommandEvent& event);
128
129     void OnUpdatePlatforms(wxUpdateUIEvent& event);
130     void OnUpdateBuildOptions(wxUpdateUIEvent& event);
131     void OnUpdateBuildToolsPath(wxUpdateUIEvent& event);
132     void OnUpdateUserToolsPath(wxUpdateUIEvent& event);
133     void OnUpdateTemplates(wxUpdateUIEvent& event);
134     void OnUpdateAdmin(wxUpdateUIEvent& event);
135     void OnUpdatePackages(wxUpdateUIEvent& event);
136     void OnUpdateRunTests(wxUpdateUIEvent& event);
137     void OnUpdateChooseRepository(wxUpdateUIEvent& event);
138     void OnUpdateResolveConflicts(wxUpdateUIEvent& event);
139     void OnUpdateSelectAll(wxUpdateUIEvent& event);
140     void OnUpdateClear(wxUpdateUIEvent& event);
141     void OnUpdateImport(wxUpdateUIEvent& event);
142     void OnUpdateExport(wxUpdateUIEvent& event);
143     void OnUpdateBuildLibrary(wxUpdateUIEvent& event);
144     void OnUpdateBuildTests(wxUpdateUIEvent& event);
145     void OnUpdateStopBuild(wxUpdateUIEvent& event);
146     void OnUpdateClean(wxUpdateUIEvent& event);
147     void OnUpdateRepositoryInfo(wxUpdateUIEvent& event);
148     void OnUpdateShell(wxUpdateUIEvent& event);
149     void OnUpdateFind(wxUpdateUIEvent& event);
150     void OnUpdateFindNext(wxUpdateUIEvent& event);
151     void OnUpdateIndexDocs(wxUpdateUIEvent& event);
152     void OnUpdateGenerateBuildTree(wxUpdateUIEvent& event);
153
154     void OnUpdateNewRegion(wxUpdateUIEvent& event);
155     void OnUpdateNewSection(wxUpdateUIEvent& event);
156     void OnUpdateDeleteRegionOrSection(wxUpdateUIEvent& event);
157     void OnUpdateRegionOrSectionProperties(wxUpdateUIEvent& event);
158
159   // Toggle windows
160     void OnToggleWindow(wxCommandEvent& event);
161     void OnUpdateToggleWindow(wxUpdateUIEvent& event);
162     void OnToggleToolbar(wxCommandEvent& event);
163     void OnUpdateToggleToolbar(wxUpdateUIEvent& event);
164     void OnUpdateDisable(wxUpdateUIEvent& event);
165
166 //// Operations
167         // (Re)create the toolbar
168         void RecreateToolbar();
169
170     // Create the windows
171     void CreateWindows();
172
173     // Respond to a sash drag operation
174     void OnSashDrag(wxSashEvent& event);
175
176     // Enumerate the visible 'minor' sash windows,
177     // i.e. those in the top-right segment of the frame
178     void GetMinorWindows(wxList& list);
179
180     // Get all visible sash windows
181     void GetSashWindows(wxList& list);
182
183     // Divide the given space evenly amongst some windows
184     void DivideSpaceEvenly(wxList& list, const wxSize& space, int orient);
185
186     // Restore the sash window default size from the actual window size
187     void RestoreDefaultWindowSizes(wxList& list);
188
189     void SetFailRulePane(int nCount);
190
191     // Toggle the given window on or off
192     void ToggleWindow(int windowId);
193
194     // Update the title, either via the document's view or explicitly if no doc
195     void UpdateFrameTitle();
196
197 //// Accessors
198     ecOutputWindow* GetOutputWindow() const { return m_outputWindow; }
199     ecConfigTreeCtrl* GetTreeCtrl() const { return m_tree; }
200     ecValueWindow* GetValueWindow() const { return m_valueWindow; }
201     ecShortDescriptionWindow* GetShortDescriptionWindow() const { return m_shortDescrWindow; }
202     ecPropertyListCtrl* GetPropertyListWindow() const { return m_propertyListWindow; }
203     ecConflictListCtrl* GetConflictsWindow() const { return m_conflictsWindow; }
204     ecMemoryLayoutWindow* GetMemoryLayoutWindow() const { return m_mltWindow; }
205
206 //// Overrides
207
208     virtual bool ProcessEvent(wxEvent& event);
209
210 protected:
211     ecConfigTreeCtrl*               m_tree;
212     wxThinSplitterWindow*           m_splitter;
213     wxSplitterScrolledWindow*       m_scrolledWindow;
214     ecValueWindow*                  m_valueWindow;
215     ecOutputWindow*                 m_outputWindow;
216     ecShortDescriptionWindow*       m_shortDescrWindow;
217     ecPropertyListCtrl*             m_propertyListWindow;
218     ecConflictListCtrl*             m_conflictsWindow;
219     ecFindDialog*                   m_findDialog;
220     ecMemoryLayoutWindow*           m_mltWindow;
221
222     // Sash layout windows, that contain the 'real' windows
223     wxSashLayoutWindow*             m_configSashWindow;
224     wxSashLayoutWindow*             m_conflictsSashWindow;
225     wxSashLayoutWindow*             m_propertiesSashWindow;
226     wxSashLayoutWindow*             m_memorySashWindow;
227     wxSashLayoutWindow*             m_shortDescrSashWindow;
228     wxSashLayoutWindow*             m_outputSashWindow;
229
230 private:
231     DECLARE_EVENT_TABLE()
232 };
233
234
235 #endif
236         // _ECOS_MAINWIN_H_