1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
6 // This program is part of the eCos host tools.
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)
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
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.
22 // ----------------------------------------------------------------------------
24 //####COPYRIGHTEND####
27 //===========================================================================
28 //#####DESCRIPTIONBEGIN####
31 // Contact(s): julians
35 // Description: Header file for the ConfigTool main window
42 //####DESCRIPTIONEND####
44 //===========================================================================
46 #ifndef _ECOS_MAINWIN_H_
47 #define _ECOS_MAINWIN_H_
50 #pragma interface "mainwin.h"
54 #include "wx/docview.h"
56 #include "splittree.h"
62 #define ecStatusPane 0
63 #define ecFailRulePane 3
67 class ecConfigTreeCtrl;
68 class ecShortDescriptionWindow;
69 class ecPropertyListCtrl;
70 class ecConflictListCtrl;
72 class WXDLLEXPORT wxSashLayoutWindow;
74 // Define a new frame type: this is going to be our main frame
75 class ecMainFrame : public wxDocParentFrame
77 friend class ecFindDialog;
81 ecMainFrame(wxDocManager *manager, const wxString& title, const wxPoint& pos, const wxSize& size);
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);
117 void OnNewRegion(wxCommandEvent& event);
118 void OnNewSection(wxCommandEvent& event);
119 void OnDeleteRegionOrSection(wxCommandEvent& event);
120 void OnRegionOrSectionProperties(wxCommandEvent& event);
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);
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);
154 void OnUpdateNewRegion(wxUpdateUIEvent& event);
155 void OnUpdateNewSection(wxUpdateUIEvent& event);
156 void OnUpdateDeleteRegionOrSection(wxUpdateUIEvent& event);
157 void OnUpdateRegionOrSectionProperties(wxUpdateUIEvent& event);
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);
167 // (Re)create the toolbar
168 void RecreateToolbar();
170 // Create the windows
171 void CreateWindows();
173 // Respond to a sash drag operation
174 void OnSashDrag(wxSashEvent& event);
176 // Enumerate the visible 'minor' sash windows,
177 // i.e. those in the top-right segment of the frame
178 void GetMinorWindows(wxList& list);
180 // Get all visible sash windows
181 void GetSashWindows(wxList& list);
183 // Divide the given space evenly amongst some windows
184 void DivideSpaceEvenly(wxList& list, const wxSize& space, int orient);
186 // Restore the sash window default size from the actual window size
187 void RestoreDefaultWindowSizes(wxList& list);
189 void SetFailRulePane(int nCount);
191 // Toggle the given window on or off
192 void ToggleWindow(int windowId);
194 // Update the title, either via the document's view or explicitly if no doc
195 void UpdateFrameTitle();
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; }
208 virtual bool ProcessEvent(wxEvent& event);
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;
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;
231 DECLARE_EVENT_TABLE()