1 //####COPYRIGHTBEGIN####
3 // ----------------------------------------------------------------------------
4 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc.
5 // Copyright (C) 2003 John Dallaway
7 // This program is part of the eCos host tools.
9 // This program is free software; you can redistribute it and/or modify it
10 // under the terms of the GNU General Public License as published by the Free
11 // Software Foundation; either version 2 of the License, or (at your option)
14 // This program is distributed in the hope that it will be useful, but WITHOUT
15 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 // You should have received a copy of the GNU General Public License along with
20 // this program; if not, write to the Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 // ----------------------------------------------------------------------------
25 //####COPYRIGHTEND####
28 //===========================================================================
29 //#####DESCRIPTIONBEGIN####
31 // Author(s): julians, jld
32 // Contact(s): julians, jld
36 // Description: Implementation file for the ConfigTool main window
43 //####DESCRIPTIONEND####
45 //===========================================================================
47 // ============================================================================
49 // ============================================================================
51 // ----------------------------------------------------------------------------
53 // ----------------------------------------------------------------------------
55 #pragma implementation "mainwin.h"
58 // Includes other headers for precompiled compilation
65 #include "wx/cshelp.h"
66 #include "wx/wxhtml.h"
67 #include "wx/filedlg.h"
68 #include "wx/wfstream.h"
71 #include "configtool.h"
72 #include "configtree.h"
73 #include "propertywin.h"
74 #include "conflictwin.h"
76 #include "outputwin.h"
77 #include "shortdescrwin.h"
78 #include "conflictsdlg.h"
81 #include "settingsdlg.h"
82 #include "platformsdlg.h"
83 #include "buildoptionsdlg.h"
84 #include "templatesdlg.h"
86 #include "packagesdlg.h"
87 #include "configtooldoc.h"
88 #include "configtoolview.h"
89 #include "folderdlg.h"
91 #include "docsystem.h"
95 #include "wx/msw/winundef.h"
98 // ----------------------------------------------------------------------------
100 // ----------------------------------------------------------------------------
101 // the application icon
102 #if defined(__WXGTK__) || defined(__WXMOTIF__)
103 #include "bitmaps/configtool.xpm"
104 #include "bitmaps/new.xpm"
105 #include "bitmaps/open.xpm"
106 #include "bitmaps/save.xpm"
107 #include "bitmaps/copy.xpm"
108 #include "bitmaps/paste.xpm"
109 #include "bitmaps/cut.xpm"
110 #include "bitmaps/delete.xpm"
111 #include "bitmaps/help.xpm"
112 #include "bitmaps/cshelp.xpm"
113 #include "bitmaps/search.xpm"
114 #include "bitmaps/stopbuild.xpm"
115 #include "bitmaps/buildlibrary.xpm"
116 #include "bitmaps/newregion.xpm"
117 #include "bitmaps/newsection.xpm"
118 #include "bitmaps/properties.xpm"
121 // ----------------------------------------------------------------------------
122 // event tables and other macros for wxWindows
123 // ----------------------------------------------------------------------------
125 BEGIN_EVENT_TABLE(ecMainFrame, wxDocParentFrame)
126 EVT_MENU(wxID_EXIT, ecMainFrame::OnQuit)
127 EVT_MENU(wxID_ABOUT, ecMainFrame::OnAbout)
128 EVT_MENU(ecID_REPOSITORY_INFO, ecMainFrame::OnRepositoryInfo)
129 EVT_MENU(wxID_FIND, ecMainFrame::OnFind)
130 EVT_MENU(ecID_FIND_NEXT, ecMainFrame::OnFindNext)
131 EVT_SASH_DRAGGED_RANGE(ecID_CONFIG_SASH_WINDOW, ecID_OUTPUT_SASH_WINDOW, ecMainFrame::OnSashDrag)
132 EVT_SIZE(ecMainFrame::OnSize)
133 EVT_IDLE(ecMainFrame::OnIdle)
134 EVT_CLOSE(ecMainFrame::OnCloseWindow)
135 EVT_MENU(ecID_TOGGLE_CONFLICTS, ecMainFrame::OnToggleWindow)
136 EVT_MENU(ecID_TOGGLE_PROPERTIES, ecMainFrame::OnToggleWindow)
137 EVT_MENU(ecID_TOGGLE_MEMORY, ecMainFrame::OnToggleWindow)
138 EVT_MENU(ecID_TOGGLE_SHORT_DESCR, ecMainFrame::OnToggleWindow)
139 EVT_MENU(ecID_TOGGLE_OUTPUT, ecMainFrame::OnToggleWindow)
140 EVT_MENU(ecID_TOOLBARS, ecMainFrame::OnToggleToolbar)
141 EVT_MENU(ecID_CONFIGTOOL_HELP, ecMainFrame::OnHelpConfigtool)
142 EVT_MENU(ecID_ECOS_HELP, ecMainFrame::OnHelpEcos)
143 EVT_MENU(ecID_CONTEXT_HELP, ecMainFrame::OnHelpContext)
144 EVT_MENU(ecID_RESOLVE_CONFLICTS, ecMainFrame::OnResolveConflicts)
145 EVT_UPDATE_UI(ecID_RESOLVE_CONFLICTS, ecMainFrame::OnUpdateResolveConflicts)
146 EVT_MENU(ecID_SETTINGS, ecMainFrame::OnSettings)
147 EVT_MENU(ecID_PLATFORMS, ecMainFrame::OnPlatforms)
148 EVT_MENU(ecID_BUILD_OPTIONS, ecMainFrame::OnBuildOptions)
149 EVT_MENU(ecID_PATHS_BUILD_TOOLS, ecMainFrame::OnBuildToolsPath)
150 EVT_MENU(ecID_PATHS_USER_TOOLS, ecMainFrame::OnUserToolsPath)
151 EVT_MENU(ecID_BUILD_TEMPLATES, ecMainFrame::OnTemplates)
152 EVT_MENU(ecID_ADMINISTRATION, ecMainFrame::OnAdmin)
153 EVT_MENU(ecID_BUILD_PACKAGES, ecMainFrame::OnPackages)
154 EVT_MENU(ecID_RUN_TESTS, ecMainFrame::OnRunTests)
155 EVT_MENU(ecID_BUILD_REPOSITORY, ecMainFrame::OnChooseRepository)
156 EVT_MENU(ecID_WHATS_THIS, ecMainFrame::OnWhatsThis)
157 EVT_MENU(ecID_SAVE_OUTPUT, ecMainFrame::OnSaveOutput)
158 EVT_MENU(ecID_IMPORT, ecMainFrame::OnImport)
159 EVT_MENU(ecID_EXPORT, ecMainFrame::OnExport)
160 EVT_MENU(ecID_REDHAT_WEB_HOME, ecMainFrame::OnWebRedHatHome)
161 EVT_MENU(ecID_REDHAT_WEB_ECOS, ecMainFrame::OnWebEcos)
162 EVT_MENU(ecID_REDHAT_WEB_NET_RELEASE, ecMainFrame::OnWebNetRelease)
163 EVT_MENU(ecID_REDHAT_WEB_UITRON, ecMainFrame::OnWebUitron)
164 EVT_MENU(ecID_STOP_BUILD, ecMainFrame::OnStopBuild)
165 EVT_MENU(ecID_BUILD_LIBRARY, ecMainFrame::OnBuildLibrary)
166 EVT_MENU(ecID_BUILD_TESTS, ecMainFrame::OnBuildTests)
167 EVT_MENU(ecID_CLEAN, ecMainFrame::OnClean)
168 EVT_MENU(ecID_SHELL, ecMainFrame::OnShell)
169 EVT_MENU(ecID_INDEX_DOCS, ecMainFrame::OnIndexDocs)
170 EVT_MENU(ecID_GENERATE_BUILD_TREE, ecMainFrame::OnGenerateBuildTree)
172 EVT_UPDATE_UI(ecID_PLATFORMS, ecMainFrame::OnUpdatePlatforms)
173 EVT_UPDATE_UI(ecID_BUILD_OPTIONS, ecMainFrame::OnUpdateBuildOptions)
174 EVT_UPDATE_UI(ecID_PATHS_BUILD_TOOLS, ecMainFrame::OnUpdateBuildToolsPath)
175 EVT_UPDATE_UI(ecID_PATHS_USER_TOOLS, ecMainFrame::OnUpdateUserToolsPath)
176 EVT_UPDATE_UI(ecID_BUILD_TEMPLATES, ecMainFrame::OnUpdateTemplates)
177 EVT_UPDATE_UI(ecID_ADMINISTRATION, ecMainFrame::OnUpdateAdmin)
178 EVT_UPDATE_UI(ecID_BUILD_PACKAGES, ecMainFrame::OnUpdatePackages)
179 EVT_UPDATE_UI(ecID_RUN_TESTS, ecMainFrame::OnUpdateRunTests)
180 EVT_UPDATE_UI(ecID_BUILD_REPOSITORY, ecMainFrame::OnUpdateChooseRepository)
181 EVT_UPDATE_UI(ecID_CLEAN, ecMainFrame::OnUpdateClean)
182 EVT_UPDATE_UI(ecID_REPOSITORY_INFO, ecMainFrame::OnUpdateRepositoryInfo)
183 EVT_UPDATE_UI(ecID_INDEX_DOCS, ecMainFrame::OnUpdateIndexDocs)
185 EVT_UPDATE_UI(ecID_TOGGLE_CONFLICTS, ecMainFrame::OnUpdateToggleWindow)
186 EVT_UPDATE_UI(ecID_TOGGLE_PROPERTIES, ecMainFrame::OnUpdateToggleWindow)
187 EVT_UPDATE_UI(ecID_TOGGLE_MEMORY, ecMainFrame::OnUpdateToggleWindow)
188 EVT_UPDATE_UI(ecID_TOGGLE_SHORT_DESCR, ecMainFrame::OnUpdateToggleWindow)
189 EVT_UPDATE_UI(ecID_TOGGLE_OUTPUT, ecMainFrame::OnUpdateToggleWindow)
190 EVT_UPDATE_UI(ecID_TOOLBARS, ecMainFrame::OnUpdateToggleToolbar)
192 // Disable commands that don't make sense immediately or are not yet implemented.
193 // Also, for text controls, disable if they are not being enabled by currently-focussed controls.
194 EVT_UPDATE_UI(wxID_COPY, ecMainFrame::OnUpdateDisable)
195 EVT_UPDATE_UI(wxID_CUT, ecMainFrame::OnUpdateDisable)
196 EVT_UPDATE_UI(wxID_PASTE, ecMainFrame::OnUpdateDisable)
197 EVT_UPDATE_UI(wxID_SELECTALL, ecMainFrame::OnUpdateSelectAll)
198 EVT_UPDATE_UI(wxID_CLEAR, ecMainFrame::OnUpdateClear)
200 EVT_UPDATE_UI(wxID_FIND, ecMainFrame::OnUpdateFind)
201 EVT_UPDATE_UI(ecID_FIND_NEXT, ecMainFrame::OnUpdateFindNext)
203 EVT_MENU(ecID_NEW_REGION, ecMainFrame::OnNewRegion)
204 EVT_MENU(ecID_NEW_SECTION, ecMainFrame::OnNewSection)
205 EVT_MENU(ecID_DELETE, ecMainFrame::OnDeleteRegionOrSection)
206 EVT_MENU(ecID_PROPERTIES, ecMainFrame::OnRegionOrSectionProperties)
208 EVT_UPDATE_UI(ecID_STOP_BUILD, ecMainFrame::OnUpdateStopBuild)
209 EVT_UPDATE_UI(ecID_BUILD_LIBRARY, ecMainFrame::OnUpdateBuildLibrary)
210 EVT_UPDATE_UI(ecID_BUILD_TESTS, ecMainFrame::OnUpdateBuildTests)
211 EVT_UPDATE_UI(ecID_GENERATE_BUILD_TREE, ecMainFrame::OnUpdateGenerateBuildTree)
213 EVT_UPDATE_UI(ecID_SHELL, ecMainFrame::OnUpdateShell)
215 EVT_UPDATE_UI(ecID_NEW_REGION, ecMainFrame::OnUpdateNewRegion)
216 EVT_UPDATE_UI(ecID_NEW_SECTION, ecMainFrame::OnUpdateNewSection)
217 EVT_UPDATE_UI(ecID_DELETE, ecMainFrame::OnUpdateDeleteRegionOrSection)
218 EVT_UPDATE_UI(ecID_PROPERTIES, ecMainFrame::OnUpdateRegionOrSectionProperties)
220 EVT_UPDATE_UI(ecID_IMPORT, ecMainFrame::OnUpdateImport)
221 EVT_UPDATE_UI(ecID_EXPORT, ecMainFrame::OnUpdateExport)
224 // ----------------------------------------------------------------------------
226 // ----------------------------------------------------------------------------
229 ecMainFrame::ecMainFrame(wxDocManager *manager, const wxString& title, const wxPoint& pos, const wxSize& size):
230 wxDocParentFrame(manager, (wxFrame *)NULL, ecID_MAIN_FRAME, title, pos, size, wxDEFAULT_FRAME_STYLE|wxCLIP_CHILDREN|wxNO_FULL_REPAINT_ON_RESIZE )
233 m_scrolledWindow = NULL;
235 m_configSashWindow = NULL;
236 m_valueWindow = NULL;
237 m_outputWindow = NULL;
238 m_shortDescrWindow = NULL;
239 m_conflictsSashWindow = NULL;
240 m_propertiesSashWindow = NULL;
241 m_memorySashWindow = NULL;
242 m_shortDescrSashWindow = NULL;
243 m_outputSashWindow = NULL;
244 m_propertyListWindow = NULL;
249 // we need this in order to allow the about menu relocation, since ABOUT is
250 // not the default id of the about menu
251 wxApp::s_macAboutMenuItemId = wxID_EXIT;
256 wxIcon mainIcon(wxICON(configtool));
257 wxGetApp().SetMainIcon(mainIcon);
259 // set the frame icon
265 wxMenu *fileMenu = new wxMenu(wxT(""), wxMENU_TEAROFF);
267 fileMenu->Append(wxID_NEW, _("&New\tCtrl+N"), _("Creates a new document"));
269 wxMenuItem* menuItem = new wxMenuItem(fileMenu, wxID_NEW, _("&New\tCtrl+N"), _("Creates a new document"));
270 menuItem->SetBitmaps(wxBITMAP(new));
271 fileMenu->Append(menuItem);
274 fileMenu->Append(wxID_OPEN, _("&Open\tCtrl+O"), _("Opens an existing document"));
275 fileMenu->Append(wxID_SAVE, _("&Save\tCtrl+S"), _("Saves the active document"));
276 fileMenu->Append(wxID_SAVEAS, _("Save &As..."), _("Saves the active document with a new name"));
277 fileMenu->AppendSeparator();
278 fileMenu->Append(ecID_IMPORT, _("&Import..."), _("Imports a minimal configuration exported from another configuration"));
279 fileMenu->Append(ecID_EXPORT, _("&Export..."), _("Exports a minimal configuration for importing into another configuration"));
280 fileMenu->AppendSeparator();
281 fileMenu->Append(wxID_EXIT, _("E&xit\tAlt+X"), _("Quits the application"));
283 // A history of files visited. Use this menu.
284 wxGetApp().GetDocManager()->FileHistoryUseMenu(fileMenu);
287 wxConfig config(wxGetApp().GetSettings().GetConfigAppName());
288 config.SetPath(wxT("FileHistory/"));
289 wxGetApp().GetDocManager()->FileHistoryLoad(config);
293 wxMenu* editMenu = new wxMenu(wxT(""), wxMENU_TEAROFF);
295 editMenu->Append(wxID_CUT, _("Cu&t\tCtrl+X"), _("Cuts the output pane selection and moves it to the Clipboard"));
296 editMenu->Append(wxID_COPY, _("&Copy\tCtrl+C"), _("Copies the output pane selection to the clipboard"));
297 editMenu->Append(wxID_PASTE, _("&Paste\tCtrl+V"), _("Inserts Clipboard contents"));
298 editMenu->Append(wxID_CLEAR, _("&Clear"), _("Erases everything in the output pane"));
299 editMenu->AppendSeparator();
300 editMenu->Append(wxID_SELECTALL, _("&Select All\tCtrl+A"), _("Selects the entire output pane"));
301 editMenu->AppendSeparator();
302 editMenu->Append(wxID_FIND, _("&Find...\tCtrl+F"), _("Finds the specified text"));
303 editMenu->Append(ecID_FIND_NEXT, _("Find &Next\tF3"), _("Finds the next item matching the Find text"));
304 editMenu->AppendSeparator();
305 editMenu->Append(ecID_SAVE_OUTPUT, _("Sa&ve Output..."), _("Saves the contents of the output pane"));
308 wxMenu* viewMenu = new wxMenu(wxT(""), wxMENU_TEAROFF);
310 viewMenu->Append(ecID_SETTINGS, _("&Settings...\tCtrl+T"), _("Shows the application settings dialog"));
311 viewMenu->AppendSeparator();
312 viewMenu->Append(ecID_TOOLBARS, _("&Toolbar"), _("Shows or hides the toolbar"), TRUE);
313 viewMenu->Append(ecID_TOGGLE_PROPERTIES, _("&Properties\tAlt+1"), _("Shows or hides the properties window"), TRUE);
314 viewMenu->Append(ecID_TOGGLE_OUTPUT, _("&Output\tAlt+2"), _("Shows the output window"), TRUE);
315 viewMenu->Append(ecID_TOGGLE_SHORT_DESCR, _("&Short Description\tAlt+3"), _("Shows or hides the short description window"), TRUE);
317 viewMenu->Append(ecID_TOGGLE_CONFLICTS, _("&Conflicts\tAlt+4"), _("Shows or hides the conflicts window"), TRUE);
319 viewMenu->Append(ecID_TOGGLE_MEMORY, _("&Memory Layout\tAlt+5"), _("Shows or hides the memory layout window"), TRUE);
320 //viewMenu->Enable(ecID_TOGGLE_MEMORY, FALSE);
323 // Not clear what these do, so let's not have them.
324 //viewMenu->Append(ecID_VIEW_NEXT, _("&Next\tAlt+F6"), _("Selects the next visible pane"));
325 //viewMenu->Append(ecID_VIEW_PREVIOUS, _("&Previous\tShift+Alt+F6"), _("Selects the previous visible pane"));
328 wxMenu* buildMenu = new wxMenu(wxT(""), wxMENU_TEAROFF);
330 buildMenu->Append(ecID_BUILD_LIBRARY, _("&Library\tF7"), _("Builds the library"));
331 buildMenu->Append(ecID_BUILD_TESTS, _("&Tests\tShift+F7"), _("Builds the tests"));
332 buildMenu->Append(ecID_CLEAN, _("&Clean"), _("Deletes intermediate and output files"));
333 buildMenu->Append(ecID_STOP_BUILD, _("&Stop"), _("Stops the build"));
334 buildMenu->AppendSeparator();
335 buildMenu->Append(ecID_GENERATE_BUILD_TREE, _("&Generate Build Tree"), _("Explicitly recreates the build tree"));
336 buildMenu->AppendSeparator();
337 buildMenu->Append(ecID_BUILD_OPTIONS, _("&Options..."), _("Changes build options"));
338 buildMenu->Append(ecID_BUILD_REPOSITORY, _("&Repository..."), _("Selects repository"));
339 buildMenu->Append(ecID_BUILD_TEMPLATES, _("&Templates..."), _("Selects the package templates"));
340 buildMenu->Append(ecID_BUILD_PACKAGES, _("&Packages..."), _("Selects individual packages"));
343 wxMenu* toolsMenu = new wxMenu(wxT(""), wxMENU_TEAROFF);
345 wxMenu* pathMenu = new wxMenu;
346 pathMenu->Append(ecID_PATHS_BUILD_TOOLS, _("&Build Tools..."), _("Specifies the folder containing the build tools"));
347 pathMenu->Append(ecID_PATHS_USER_TOOLS, _("&User Tools..."), _("Specifies the folder containing the user tools"));
348 toolsMenu->Append(ecID_PATHS, _("&Paths"), pathMenu);
350 toolsMenu->Append(ecID_SHELL, _("&Shell..."), _("Invokes a command shell"));
351 toolsMenu->Append(ecID_RUN_TESTS, _("&Run Tests...\tCtrl+F5"), _("Runs the configuration tests"));
352 toolsMenu->Append(ecID_PLATFORMS, _("&Platforms..."), _("Edits the platforms list"));
353 toolsMenu->Append(ecID_RESOLVE_CONFLICTS, _("Resolve &Conflicts..."), _("Resolves conflicts"));
354 toolsMenu->Append(ecID_ADMINISTRATION, _("&Administration..."), _("Performs repository administration tasks"));
356 toolsMenu->AppendSeparator();
357 toolsMenu->Append(ecID_TOOLS_OPTIONS, _("&Options..."), _("Changes configuration options"));
359 toolsMenu->Append(ecID_INDEX_DOCS, _("Regenerate Help &Index"), _("Regenerates the online help contents"));
362 wxMenu* helpMenu = new wxMenu;
363 helpMenu->Append(ecID_CONFIGTOOL_HELP, _("&Configuration Tool Help\tShift+F1"), _("Displays help"));
364 helpMenu->Append(ecID_ECOS_HELP, _("&eCos Documentation"), _("Displays the documentation home page"));
365 helpMenu->Append(ecID_CONTEXT_HELP, _("&Help On..."), _("Displays help for clicked-on windows"));
366 helpMenu->AppendSeparator();
368 wxMenu* webMenu = new wxMenu;
369 webMenu->Append(ecID_REDHAT_WEB_HOME, _("&Red Hat Home Page"), _("Opens the Red Hat home page"));
370 webMenu->Append(ecID_REDHAT_WEB_ECOS, _("&eCos Product Page"), _("Opens the eCos product page"));
371 webMenu->Append(ecID_REDHAT_WEB_NET_RELEASE, _("eCos &Net Release Page"), _("Opens the eCos net release page"));
372 webMenu->AppendSeparator();
373 webMenu->Append(ecID_REDHAT_WEB_UITRON, _("&ITRON"), _("Opens the ITRON specification page"));
375 // helpMenu->Append(ecID_REDHAT_WEB, _("&Red Hat on the Web"), webMenu);
376 // helpMenu->AppendSeparator();
377 helpMenu->Append(ecID_REPOSITORY_INFO, _("Repository &Information...\tCtrl+I"), _("Displays information about the current repository"));
378 helpMenu->Append(wxID_ABOUT, _("&About the Configuration Tool..."), _("Displays program information, version and copyright"));
380 wxMenuBar *menuBar = new wxMenuBar();
381 menuBar->Append(fileMenu, _("&File"));
382 menuBar->Append(editMenu, _("&Edit"));
383 menuBar->Append(viewMenu, _("&View"));
384 menuBar->Append(buildMenu, _("&Build"));
385 menuBar->Append(toolsMenu, _("&Tools"));
386 menuBar->Append(helpMenu, _("&Help"));
388 // ... and attach this menu bar to the frame
391 // Create the toolbar
394 if (!wxGetApp().GetSettings().m_showToolBar)
395 GetToolBar()->Show( FALSE );
397 // Create the status bar
398 CreateStatusBar(4, wxST_SIZEGRIP);
400 int* widths = new int[4];
401 widths[0] = -1; widths[1] = 100; widths[2] = 40; widths[3] = 80;
402 SetStatusWidths(4, widths);
405 SetStatusText(_("No conflicts"), ecFailRulePane);
406 SetStatusText(_("Ready"), ecStatusPane);
409 // Create the windows
410 void ecMainFrame::CreateWindows()
412 ecSettings& stg = wxGetApp().GetSettings();
414 // Create the sash layout windows first
416 // Sash window for the output window
417 m_outputSashWindow = new wxSashLayoutWindow(this, ecID_OUTPUT_SASH_WINDOW, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxCLIP_SIBLINGS);
418 m_outputSashWindow->SetDefaultSize(stg.m_outputSashSize);
419 m_outputSashWindow->SetOrientation(wxLAYOUT_HORIZONTAL);
420 m_outputSashWindow->SetAlignment(wxLAYOUT_BOTTOM);
421 m_outputSashWindow->SetSashVisible(wxSASH_TOP, TRUE);
422 m_outputWindow = new ecOutputWindow(m_outputSashWindow, ecID_OUTPUT_WINDOW, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxCLIP_CHILDREN|wxTE_READONLY|wxTE_RICH);
423 m_outputWindow->SetHelpText(_("The output window displays various warning and informational messages."));
425 // Sash window for the memory window
426 m_memorySashWindow = new wxSashLayoutWindow(this, ecID_MEMORY_SASH_WINDOW, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxSW_3D|wxCLIP_SIBLINGS);
427 m_memorySashWindow->SetDefaultSize(stg.m_memorySashSize);
428 m_memorySashWindow->SetOrientation(wxLAYOUT_HORIZONTAL);
429 m_memorySashWindow->SetAlignment(wxLAYOUT_BOTTOM);
430 m_memorySashWindow->SetSashVisible(wxSASH_TOP, TRUE);
431 //wxTextCtrl* memoryWindow = new wxTextCtrl(m_memorySashWindow, ecID_MEMORY_WINDOW, wxT("This will be the memory layout window."), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxCLIP_CHILDREN|wxTE_NO_VSCROLL|wxTE_READONLY);
432 m_mltWindow = new ecMemoryLayoutWindow(m_memorySashWindow, ecID_MEMORY_WINDOW, wxDefaultPosition, wxDefaultSize, wxCLIP_CHILDREN|wxSUNKEN_BORDER);
433 m_mltWindow->SetHelpText(_("The memory layout window presents a graphical view of the memory layout of the currently selected\ncombination of target architecture, platform and start-up type."));
435 // Sash window for the config tree
436 m_configSashWindow = new wxSashLayoutWindow(this, ecID_CONFIG_SASH_WINDOW, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxCLIP_CHILDREN/*|wxCLIP_SIBLINGS*/);
437 m_configSashWindow->SetDefaultSize(stg.m_treeSashSize);
438 m_configSashWindow->SetOrientation(wxLAYOUT_VERTICAL);
439 m_configSashWindow->SetAlignment(wxLAYOUT_LEFT);
440 m_configSashWindow->SetSashVisible(wxSASH_RIGHT, TRUE);
442 // Sash window for the conflicts window
443 m_conflictsSashWindow = new wxSashLayoutWindow(this, ecID_CONFLICTS_SASH_WINDOW, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxCLIP_SIBLINGS);
444 m_conflictsSashWindow->SetDefaultSize(stg.m_conflictsSashSize);
445 m_conflictsSashWindow->SetOrientation(wxLAYOUT_HORIZONTAL);
446 m_conflictsSashWindow->SetAlignment(wxLAYOUT_TOP);
447 m_conflictsSashWindow->SetSashVisible(wxSASH_BOTTOM, TRUE);
448 m_conflictsWindow = new ecConflictListCtrl(m_conflictsSashWindow, ecID_CONFLICTS_WINDOW, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxCLIP_CHILDREN|wxSUNKEN_BORDER);
449 m_conflictsWindow->SetHelpText(_("The conflicts window lists any outstanding conflicts in the configuration."));
451 // Sash window for the properties window
452 m_propertiesSashWindow = new wxSashLayoutWindow(this, ecID_PROPERTIES_SASH_WINDOW, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxCLIP_SIBLINGS);
453 m_propertiesSashWindow->SetDefaultSize(stg.m_propertiesSashSize);
454 m_propertiesSashWindow->SetOrientation(wxLAYOUT_HORIZONTAL);
455 m_propertiesSashWindow->SetAlignment(wxLAYOUT_TOP);
456 m_propertiesSashWindow->SetSashVisible(wxSASH_BOTTOM, TRUE);
457 // wxTextCtrl* propertiesWindow = new wxTextCtrl(m_propertiesSashWindow, ecID_PROPERTIES_WINDOW, wxT("This will be the properties window."), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxCLIP_CHILDREN|wxTE_NO_VSCROLL|wxTE_READONLY);
458 m_propertyListWindow = new ecPropertyListCtrl(m_propertiesSashWindow, ecID_PROPERTIES_WINDOW, wxDefaultPosition, wxDefaultSize, wxLC_REPORT|wxCLIP_CHILDREN|wxLC_VRULES|wxLC_HRULES|wxSUNKEN_BORDER);
459 m_propertyListWindow->SetHelpText(_("The properties window shows the properties of the selected configuration item."));
461 // Sash window for the short description window
462 m_shortDescrSashWindow = new wxSashLayoutWindow(this, ecID_SHORT_DESCR_SASH_WINDOW, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxCLIP_SIBLINGS);
463 m_shortDescrSashWindow->SetDefaultSize(stg.m_shortDescrSashSize);
464 m_shortDescrSashWindow->SetOrientation(wxLAYOUT_HORIZONTAL);
465 m_shortDescrSashWindow->SetAlignment(wxLAYOUT_TOP);
466 //m_shortDescrSashWindow->SetSashVisible(wxSASH_TOP, TRUE);
467 m_shortDescrWindow = new ecShortDescriptionWindow(m_shortDescrSashWindow, ecID_SHORT_DESCR_WINDOW, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxCLIP_CHILDREN/*|wxTE_NO_VSCROLL*/|wxTE_READONLY);
468 m_shortDescrWindow->SetBackgroundColour(wxColour(255, 255, 225));
469 m_shortDescrWindow->SetHelpText(_("The short description window displays brief help on a selected configuration item."));
471 // Create a composite widget to represent the scrolling config window
472 m_scrolledWindow = new ecSplitterScrolledWindow(m_configSashWindow, ecID_SCROLLED_WINDOW, wxDefaultPosition,
473 wxSize(400, 100), wxNO_BORDER | wxCLIP_CHILDREN | wxVSCROLL);
474 m_splitter = new wxThinSplitterWindow(m_scrolledWindow, ecID_SPLITTER_WINDOW, wxDefaultPosition,
475 wxSize(400, 100), wxSP_3DBORDER | wxCLIP_CHILDREN /* | wxSP_LIVE_UPDATE */);
476 m_splitter->SetSashSize(2);
477 m_tree = new ecConfigTreeCtrl(m_splitter, ecID_TREE_CTRL, wxDefaultPosition,
478 wxSize(200, 100), wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxNO_BORDER );
479 m_valueWindow = new ecValueWindow(m_splitter, ecID_VALUE_WINDOW, wxDefaultPosition,
480 wxSize(200, 100), wxNO_BORDER);
481 m_splitter->SplitVertically(m_tree, m_valueWindow);
482 m_splitter->SetMinimumPaneSize(100);
483 //m_splitter->AdjustScrollbars();
484 m_splitter->SetSashPosition(wxGetApp().GetSettings().m_configPaneWidth);
485 m_scrolledWindow->SetTargetWindow(m_tree);
486 m_scrolledWindow->EnableScrolling(FALSE, FALSE);
487 m_tree->SetHelpText(_("The configuration window is the principal window used to configure eCos.\nIt takes the form of a tree-based representation of the configuration items within the currently loaded eCos packages."));
488 m_valueWindow->SetHelpText(m_tree->GetHelpText());
490 // Let the two controls know about each other
491 m_valueWindow->SetTreeCtrl(m_tree);
492 m_tree->SetCompanionWindow(m_valueWindow);
494 // Set visibility according to config settings
495 if (!wxGetApp().GetSettings().m_showConflictsWindow)
496 m_conflictsSashWindow->Show(FALSE);
497 if (!wxGetApp().GetSettings().m_showPropertiesWindow)
498 m_propertiesSashWindow->Show(FALSE);
499 if (!wxGetApp().GetSettings().m_showShortDescrWindow)
500 m_shortDescrSashWindow->Show(FALSE);
501 if (!wxGetApp().GetSettings().m_showOutputWindow)
502 m_outputSashWindow->Show(FALSE);
503 if (!wxGetApp().GetSettings().m_showMemoryWindow)
504 m_memorySashWindow->Show(FALSE);
508 void ecMainFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
513 void ecMainFrame::OnFind(wxCommandEvent& event)
517 m_findDialog->Raise();
521 m_findDialog = new ecFindDialog (this, ecID_FIND_DIALOG, _("Find in configuration"));
522 m_findDialog->Show(TRUE);
524 // For some reason, under Windows, the text control doesn't get the focus if we set the focus
525 // and then call Show. We have to set the focus afterwards instead.
526 m_findDialog->FindWindow(ecID_FIND_DIALOG_WHAT)->SetFocus();
529 void ecMainFrame::OnFindNext(wxCommandEvent& event)
531 if (wxGetApp().GetConfigToolDoc())
533 ecConfigToolView* view = (ecConfigToolView*) wxGetApp().GetConfigToolDoc()->GetFirstView() ;
535 view->DoFind(wxGetApp().GetSettings().m_findText, this);
539 void ecMainFrame::OnUpdateFind(wxUpdateUIEvent& event)
541 event.Enable( wxGetApp().GetConfigToolDoc() != NULL );
544 void ecMainFrame::OnUpdateFindNext(wxUpdateUIEvent& event)
546 event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) && !wxGetApp().GetSettings().m_findText.IsEmpty() );
549 void ecMainFrame::OnAbout(wxCommandEvent& WXUNUSED(event))
551 // ecAboutDialog dialog(this, ecID_ABOUT_DIALOG, _("About eCos Configuration Tool"));
552 // dialog.ShowModal();
554 msg.Printf("eCos Configuration Tool %s (%s %s)\n\nCopyright (c) Red Hat, Inc. 1998-2002\nCopyright (c) John Dallaway 2003", ecCONFIGURATION_TOOL_VERSION, __DATE__, __TIME__);
555 wxMessageBox(msg, _("About eCos Configuration Tool"), wxICON_INFORMATION | wxOK);
558 void ecMainFrame::OnSize(wxSizeEvent& WXUNUSED(event))
560 // First, we need to resize the sash windows proportionately,
561 // or we may end up with negative sizes, etc.
562 wxRect rect = GetRect();
563 if (rect != wxGetApp().GetSettings().m_frameSize)
565 double factorX = ((double) rect.GetWidth() / (double) wxGetApp().GetSettings().m_frameSize.GetWidth());
566 double factorY = ((double) rect.GetHeight() / (double) wxGetApp().GetSettings().m_frameSize.GetHeight());
568 wxNode* node = GetChildren().First();
571 wxWindow* win = (wxWindow*) node->Data();
572 if (win->IsKindOf(CLASSINFO(wxSashLayoutWindow)))
574 wxSashLayoutWindow* sashWin = (wxSashLayoutWindow*) win;
575 wxSize sz = sashWin->GetSize();
576 sashWin->SetDefaultSize(wxSize((int) ((double) sz.x * factorX), (int) ((double) sz.y * factorY)));
582 wxLayoutAlgorithm layout;
583 layout.LayoutFrame(this);
585 wxGetApp().GetSettings().m_frameSize = rect;
588 void ecMainFrame::RecreateToolbar()
590 // delete and recreate the toolbar
591 wxToolBarBase *toolBar = GetToolBar();
598 long style = wxNO_BORDER | wxTB_FLAT | wxTB_HORIZONTAL | wxTB_DOCKABLE;
600 toolBar = CreateToolBar(style, ecID_TOOLBAR);
602 toolBar->SetMargins( 4, 4 );
605 wxBitmap toolBarBitmaps[20];
607 toolBarBitmaps[0] = wxBITMAP(new);
608 toolBarBitmaps[1] = wxBITMAP(open);
609 toolBarBitmaps[2] = wxBITMAP(save);
610 toolBarBitmaps[3] = wxBITMAP(copy);
611 toolBarBitmaps[4] = wxBITMAP(cut);
612 toolBarBitmaps[5] = wxBITMAP(paste);
613 toolBarBitmaps[6] = wxBITMAP(search);
614 toolBarBitmaps[7] = wxBITMAP(stopbuild);
615 toolBarBitmaps[8] = wxBITMAP(buildlibrary);
616 toolBarBitmaps[9] = wxBITMAP(help);
617 toolBarBitmaps[10] = wxBITMAP(newregion);
618 toolBarBitmaps[11] = wxBITMAP(newsection);
619 toolBarBitmaps[12] = wxBITMAP(delete);
620 toolBarBitmaps[13] = wxBITMAP(properties);
621 toolBarBitmaps[14] = wxBITMAP(cshelp);
623 toolBar->AddTool(wxID_NEW, toolBarBitmaps[0], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("New file"));
624 toolBar->AddTool(wxID_OPEN, toolBarBitmaps[1], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Open file"));
625 toolBar->AddTool(wxID_SAVE, toolBarBitmaps[2], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, wxT("Save file"));
627 toolBar->AddSeparator();
629 toolBar->AddTool(wxID_CUT, toolBarBitmaps[4], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Cut");
630 toolBar->AddTool(wxID_COPY, toolBarBitmaps[3], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Copy");
631 toolBar->AddTool(wxID_PASTE, toolBarBitmaps[5], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Paste");
632 toolBar->AddTool(wxID_FIND, toolBarBitmaps[6], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Search");
634 toolBar->AddSeparator();
636 toolBar->AddTool(ecID_STOP_BUILD, toolBarBitmaps[7], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Stop build");
637 toolBar->AddTool(ecID_BUILD_LIBRARY, toolBarBitmaps[8], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Build library");
639 toolBar->AddSeparator();
640 toolBar->AddTool(ecID_NEW_REGION, toolBarBitmaps[10], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "New region");
641 toolBar->AddTool(ecID_NEW_SECTION, toolBarBitmaps[11], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "New section");
642 toolBar->AddTool(ecID_DELETE, toolBarBitmaps[12], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Delete");
643 toolBar->AddTool(ecID_PROPERTIES, toolBarBitmaps[13], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Properties");
645 toolBar->AddSeparator();
646 toolBar->AddTool(ecID_CONTEXT_HELP, toolBarBitmaps[14], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Show help for clicked-on windows");
647 toolBar->AddTool(ecID_ECOS_HELP, toolBarBitmaps[9], wxNullBitmap, FALSE, -1, -1, (wxObject *) NULL, "Show help");
649 // after adding the buttons to the toolbar, must call Realize() to reflect
653 toolBar->SetHelpText(_("The toolbar allows quick access to commonly-used commands."));
656 // Toggle one of the windows
657 void ecMainFrame::OnToggleWindow(wxCommandEvent& event)
659 ToggleWindow(event.GetId());
662 // Toggle the given window on or off
663 void ecMainFrame::ToggleWindow(int windowId)
665 wxWindow* win = NULL;
666 bool *configSetting = NULL;
669 case ecID_TOGGLE_CONFLICTS:
670 win = m_conflictsSashWindow;
671 configSetting = & wxGetApp().GetSettings().m_showConflictsWindow;
673 case ecID_TOGGLE_PROPERTIES:
674 win = m_propertiesSashWindow;
675 configSetting = & wxGetApp().GetSettings().m_showPropertiesWindow;
677 case ecID_TOGGLE_MEMORY:
678 win = m_memorySashWindow;
679 configSetting = & wxGetApp().GetSettings().m_showMemoryWindow;
681 case ecID_TOGGLE_SHORT_DESCR:
682 win = m_shortDescrSashWindow;
683 configSetting = & wxGetApp().GetSettings().m_showShortDescrWindow;
685 case ecID_TOGGLE_OUTPUT:
686 win = m_outputSashWindow;
687 configSetting = & wxGetApp().GetSettings().m_showOutputWindow;
692 bool showing = !win->IsShown();
695 * configSetting = showing;
697 // Make sure we don't have ridiculous sizes
698 if (showing && (windowId == ecID_TOGGLE_CONFLICTS || windowId == ecID_TOGGLE_PROPERTIES || windowId == ecID_TOGGLE_SHORT_DESCR))
700 m_conflictsSashWindow->SetDefaultSize(wxSize(2000, 50));
701 m_propertiesSashWindow->SetDefaultSize(wxSize(2000, 50));
702 m_shortDescrSashWindow->SetDefaultSize(wxSize(2000, 50));
704 wxSize frameSize = GetClientSize();
705 wxSize configSize = m_configSashWindow->GetSize();
707 if ((frameSize.x - configSize.x) < 5)
709 // We must resize the config window
710 m_configSashWindow->SetDefaultSize(wxSize(frameSize.x/2, configSize.y));
714 wxLayoutAlgorithm layout;
715 layout.LayoutFrame(this);
719 void ecMainFrame::OnUpdateToggleWindow(wxUpdateUIEvent& event)
721 wxWindow* win = NULL;
722 switch (event.GetId())
724 case ecID_TOGGLE_CONFLICTS:
725 win = m_conflictsSashWindow;
727 case ecID_TOGGLE_PROPERTIES:
728 win = m_propertiesSashWindow;
730 case ecID_TOGGLE_MEMORY:
731 win = m_memorySashWindow;
733 case ecID_TOGGLE_SHORT_DESCR:
734 win = m_shortDescrSashWindow;
736 case ecID_TOGGLE_OUTPUT:
737 win = m_outputSashWindow;
742 event.Enable( TRUE );
743 event.Check( win->IsShown() );
747 if (event.GetId() == ecID_TOGGLE_MEMORY)
748 event.Enable( FALSE );
753 void ecMainFrame::OnUpdateDisable(wxUpdateUIEvent& event)
755 event.Enable( FALSE );
758 void ecMainFrame::OnToggleToolbar(wxCommandEvent& event)
760 GetToolBar()->Show( ! GetToolBar()->IsShown() );
762 wxSizeEvent sizeEvent(GetSize(), GetId());
763 GetEventHandler()->ProcessEvent(sizeEvent);
765 GtkOnSize( GetPosition().x, GetPosition().y, GetSize().x, GetSize().y);
769 void ecMainFrame::OnUpdateToggleToolbar(wxUpdateUIEvent& event)
771 event.Check( GetToolBar()->IsShown() );
774 // Respond to a sash drag operation, by setting the new size
775 // for this window and then recalculating the layout.
776 void ecMainFrame::OnSashDrag(wxSashEvent& event)
778 if (event.GetDragStatus() == wxSASH_STATUS_OUT_OF_RANGE)
781 switch (event.GetId())
783 case ecID_CONFIG_SASH_WINDOW:
785 m_configSashWindow->SetDefaultSize(wxSize(event.GetDragRect().width, 2000));
788 case ecID_CONFLICTS_SASH_WINDOW:
790 // Change the height of the properties window so we don't affect the
791 // short description window
792 int deltaY = event.GetDragRect().height - m_conflictsSashWindow->GetSize().y;
793 int propertiesHeight = 0;
794 if (m_propertiesSashWindow->IsShown())
796 propertiesHeight = m_propertiesSashWindow->GetSize().y - deltaY ;
797 if (propertiesHeight <= 0)
800 m_propertiesSashWindow->SetDefaultSize(wxSize(2000, propertiesHeight));
802 m_conflictsSashWindow->SetDefaultSize(wxSize(2000, event.GetDragRect().height));
805 case ecID_PROPERTIES_SASH_WINDOW:
807 m_propertiesSashWindow->SetDefaultSize(wxSize(2000, event.GetDragRect().height));
810 case ecID_SHORT_DESCR_SASH_WINDOW:
812 m_shortDescrSashWindow->SetDefaultSize(wxSize(2000, event.GetDragRect().height));
815 case ecID_MEMORY_SASH_WINDOW:
817 m_memorySashWindow->SetDefaultSize(wxSize(2000, event.GetDragRect().height));
820 case ecID_OUTPUT_SASH_WINDOW:
822 m_outputSashWindow->SetDefaultSize(wxSize(2000, event.GetDragRect().height));
827 wxFAIL_MSG( _("Shouldn't get here.") );
832 if (event.GetId() == ecID_MEMORY_SASH_WINDOW || event.GetId() == ecID_OUTPUT_SASH_WINDOW)
834 // Special processing so we don't spoil the layout of the
835 // conflicts/properties/short description windows
837 GetMinorWindows(minorWindows);
839 int memoryLayoutHeight = m_memorySashWindow->IsShown() ? m_memorySashWindow->GetSize().y : 0;
840 int outputHeight = m_memorySashWindow->IsShown() ? m_outputSashWindow->GetSize().y : 0;
842 GetClientSize(& cx, & cy);
844 // Calculate how much space will be left after this drag operation.
846 if (event.GetId() == ecID_MEMORY_SASH_WINDOW)
847 heightLeft = cy - outputHeight - event.GetDragRect().height;
849 heightLeft = cy - memoryLayoutHeight - event.GetDragRect().height;
851 DivideSpaceEvenly(minorWindows, wxSize(0, heightLeft), wxVERTICAL);
852 RestoreDefaultWindowSizes(minorWindows);
855 wxLayoutAlgorithm layout;
856 if (!layout.LayoutFrame(this))
858 // If layout failed, restored default sizes.
859 wxNode* node = GetChildren().First();
862 wxWindow* win = (wxWindow*) node->Data();
863 if (win->IsKindOf(CLASSINFO(wxSashLayoutWindow)))
865 wxSashLayoutWindow* sashWin = (wxSashLayoutWindow*) win;
866 wxSize sz = sashWin->GetSize();
867 sashWin->SetDefaultSize(sz);
875 void ecMainFrame::OnIdle(wxIdleEvent& event)
877 // Normal idle processing
878 wxFrame::OnIdle(event);
882 text = GetStatusBar()->GetStatusText(0);
884 // Set the title if we have no document
885 if (!wxGetApp().GetConfigToolDoc() && GetTitle() != wxGetApp().GetSettings().GetAppName())
886 SetTitle(wxGetApp().GetSettings().GetAppName());
888 if ( wxGetApp().m_pipedProcess && wxGetApp().m_pipedProcess->HasInput() )
893 if ( wxGetApp().m_pipedProcess )
895 if (text != _("Building..."))
896 SetStatusText(_("Building..."), 0);
898 else if (text != _("Ready"))
899 SetStatusText(_("Ready"), 0);
902 void ecMainFrame::OnCloseWindow(wxCloseEvent& event)
906 if (!wxGetApp().GetDocManager()->Clear(FALSE) && event.CanVeto())
911 if (wxGetApp().m_pipedProcess)
912 wxGetApp().m_pipedProcess->Detach();
915 m_findDialog->Close(TRUE);
917 wxGetApp().DestroyHelpController();
920 wxGetApp().GetSettings().m_frameStatus = ecSHOW_STATUS_MAXIMIZED ;
921 else if (IsIconized())
922 wxGetApp().GetSettings().m_frameStatus = ecSHOW_STATUS_MINIMIZED ;
924 wxGetApp().GetSettings().m_frameStatus = ecSHOW_STATUS_NORMAL ;
926 if (!IsMaximized() && !IsIconized())
927 wxGetApp().GetSettings().m_frameSize = GetRect();
929 wxGetApp().GetSettings().m_showToolBar = GetToolBar()->IsShown();
931 wxGetApp().GetSettings().m_treeSashSize = m_configSashWindow->GetSize();
932 wxGetApp().GetSettings().m_propertiesSashSize = m_propertiesSashWindow->GetSize();
933 wxGetApp().GetSettings().m_conflictsSashSize = m_conflictsSashWindow->GetSize();
934 wxGetApp().GetSettings().m_shortDescrSashSize = m_shortDescrSashWindow->GetSize();
935 wxGetApp().GetSettings().m_memorySashSize = m_memorySashWindow->GetSize();
936 wxGetApp().GetSettings().m_outputSashSize = m_outputSashWindow->GetSize();
937 wxGetApp().GetSettings().m_configPaneWidth = m_splitter->GetSashPosition();
942 // Enumerate the visible 'minor' sash windows,
943 // i.e. those in the top-right segment of the frame
944 void ecMainFrame::GetMinorWindows(wxList& list)
946 if (m_conflictsSashWindow->IsShown())
947 list.Append(m_conflictsSashWindow);
948 if (m_propertiesSashWindow->IsShown())
949 list.Append(m_propertiesSashWindow);
950 if (m_shortDescrSashWindow->IsShown())
951 list.Append(m_shortDescrSashWindow);
954 // Get all visible sash windows
955 void ecMainFrame::GetSashWindows(wxList& list)
957 wxNode* node = GetChildren().First();
960 wxWindow* win = (wxWindow*) node->Data();
961 if (win->IsKindOf(CLASSINFO(wxSashLayoutWindow)) && win->IsShown())
969 // Divide the given space evenly amongst some windows
970 void ecMainFrame::DivideSpaceEvenly(wxList& list, const wxSize& space, int orient)
972 if (list.Number() == 0)
975 // Find total size first
977 double proportion = 0.0;
978 wxNode* node = list.First();
981 wxWindow* win = (wxWindow*) node->Data();
982 wxSize sz = win->GetSize();
983 if (orient == wxHORIZONTAL)
989 if (orient == wxHORIZONTAL)
994 proportion = ((double) space.x / (double) totalSize);
1001 proportion = ((double) space.y / (double) totalSize);
1003 node = list.First();
1006 wxWindow* win = (wxWindow*) node->Data();
1007 wxSize sz = win->GetSize();
1008 if (orient == wxHORIZONTAL)
1009 sz.x = (int) (sz.x * proportion);
1011 sz.y = (int) (sz.y * proportion);
1013 node = node->Next();
1017 // Restore the sash window default size from the actual window size
1018 void ecMainFrame::RestoreDefaultWindowSizes(wxList& list)
1020 wxNode* node = list.First();
1023 wxSashLayoutWindow* sashWin = (wxSashLayoutWindow*) node->Data();
1024 wxSize sz = sashWin->GetSize();
1025 sashWin->SetDefaultSize(sz);
1026 node = node->Next();
1030 void ecMainFrame::OnHelpEcos(wxCommandEvent& event)
1032 ecConfigToolDoc* doc = wxGetApp().GetConfigToolDoc();
1035 wxString strURL(wxT("index.html"));
1036 doc->QualifyDocURL(strURL, FALSE);
1037 switch (wxGetApp().GetSettings().m_eUseCustomBrowser)
1041 if (wxGetApp().HasHelpController())
1042 wxGetApp().GetHelpController().DisplayContents();
1047 doc->ShowURL(strURL);
1053 void ecMainFrame::OnHelpConfigtool(wxCommandEvent& event)
1055 //wxString strURL(wxT("redirect/the-ecos-configuration-tool.html"));
1056 wxString strURL(wxGetApp().GetFullAppPath(wxT("manual/user-guides.2.html")));
1057 if (!wxFileExists(strURL))
1058 strURL = wxT("user-guide/the-ecos-configuration-tool.html");
1060 if (wxGetApp().GetConfigToolDoc())
1062 wxGetApp().GetConfigToolDoc()->ShowURL(strURL);
1066 void ecMainFrame::OnHelpContext(wxCommandEvent& event)
1068 wxContextHelp contextHelp;
1071 void ecMainFrame::OnResolveConflicts(wxCommandEvent& event)
1074 ecResolveConflictsDialog dialog(this);
1077 if ( ecConfigToolDoc::NotDone == wxGetApp().GetConfigToolDoc()->ResolveGlobalConflicts() )
1079 // Global inference handler was never invoked. Say something
1081 msg.Printf(_("No solutions can be automatically determined for the current set of conflicts."));
1082 wxMessageBox(msg, wxGetApp().GetSettings().GetAppName(), wxICON_EXCLAMATION|wxOK);
1086 void ecMainFrame::OnUpdateResolveConflicts(wxUpdateUIEvent& event)
1088 if (!wxGetApp().GetConfigToolDoc() || !wxGetApp().GetConfigToolDoc()->GetCdlInterpreter())
1090 event.Enable(FALSE);
1094 event.Enable(wxGetApp().GetConfigToolDoc()->GetCdlInterpreter()->get_toplevel()->get_all_conflicts().size()>0);
1097 void ecMainFrame::OnSettings(wxCommandEvent& event)
1099 ecSettingsDialog dialog(this);
1103 void ecMainFrame::OnPlatforms(wxCommandEvent& event)
1105 ecPlatformsDialog dialog(this);
1106 if (dialog.ShowModal() == wxID_OK)
1108 CeCosTestPlatform::RemoveAllPlatforms();
1110 for(i=0; i < dialog.PlatformCount();i++){
1111 CeCosTestPlatform::Add(*dialog.Platform(i));
1113 CeCosTestPlatform::Save();
1117 void ecMainFrame::OnBuildOptions(wxCommandEvent& event)
1119 ecBuildOptionsDialog dialog(this);
1123 void ecMainFrame::OnTemplates(wxCommandEvent& event)
1125 ecTemplatesDialog dialog(this);
1126 if (dialog.ShowModal() == wxID_OK)
1129 // Ensure display gets updated
1130 ::UpdateWindow((HWND) GetHWND());
1133 ecConfigToolDoc* doc = wxGetApp().GetConfigToolDoc();
1135 doc->SelectHardware(dialog.GetSelectedHardware());
1136 doc->SelectTemplate(dialog.GetSelectedTemplate(), dialog.GetSelectedTemplateVersion());
1140 void ecMainFrame::OnAdmin(wxCommandEvent& event)
1142 ecConfigToolDoc* doc = wxGetApp().GetConfigToolDoc();
1146 if (wxYES == wxMessageBox(_("This command will close the current document.\n\nDo you wish to continue?"),
1147 wxGetApp().GetAppName(), wxYES_NO, this))
1149 wxString shellCommands;
1150 // ensure that the user tools are on the path for use by ecosadmin.tcl
1151 // TODO: need to something else for Linux (since it returns settings in shellCommands)
1152 if (wxGetApp().PrepareEnvironment(FALSE, & shellCommands))
1154 // make sure we use doc data before the doc is destroyed
1156 ecAdminDialog dlg(this, doc->GetPackagesDir(), wxGetApp().GetSettings().GetUserToolsDir());
1158 if (dlg.ShowModal() == wxID_OK)
1160 // Create new document
1161 wxGetApp().GetDocManager()->CreateDocument(wxEmptyString, wxDOC_NEW);
1167 void ecMainFrame::OnPackages(wxCommandEvent& event)
1169 ecConfigToolDoc* doc = wxGetApp().GetConfigToolDoc();
1171 doc->SelectPackages();
1174 void ecMainFrame::OnRunTests(wxCommandEvent& event)
1176 ecConfigToolDoc* doc = wxGetApp().GetConfigToolDoc();
1181 void ecMainFrame::OnChooseRepository(wxCommandEvent& event)
1183 ecConfigToolDoc* doc = wxGetApp().GetConfigToolDoc();
1184 if (doc && !doc->OnSaveModified())
1189 doc = (ecConfigToolDoc*) wxGetApp().GetDocManager()->CreateDocument(wxString(""), wxDOC_NEW|ecDOC_PROMPT_FOR_REPOSITORY);
1194 doc->m_bRepositoryOpen = FALSE;
1196 if (wxGetApp().GetConfigToolDoc()->OpenRepository(wxEmptyString, TRUE))
1200 // reset the document title as shown in the frame window
1201 GetDocTemplate ()->SetDefaultTitle (this);
1203 // load the memory layout for the default target-platform-startup from the new repository
1204 NewMemoryLayout (CFileName (m_strPackagesDir, m_strMemoryLayoutFolder, _T("include\\pkgconf")));
1207 doc->UpdateAllViews(NULL);
1208 doc->UpdateFailingRuleCount();
1213 doc->m_bRepositoryOpen = TRUE;
1217 void ecMainFrame::OnBuildToolsPath(wxCommandEvent& event)
1219 ecConfigToolDoc* doc = wxGetApp().GetConfigToolDoc();
1223 // add the current build tools dir to the drop-down list box
1224 wxArrayString arstrPaths;
1225 if (!wxGetApp().GetSettings().m_buildToolsDir.IsEmpty())
1226 arstrPaths.Add(wxGetApp().GetSettings().m_buildToolsDir);
1228 // also add the sub-directory containing tools for the current command prefix
1230 wxStringToStringMap& map = wxGetApp().GetSettings().GetBinDirs();
1231 const wxString strPrefix(doc->GetCurrentTargetPrefix());
1232 if (map.Find(strPrefix, value) && (wxNOT_FOUND == arstrPaths.Index(value)))
1233 arstrPaths.Add(value);
1236 msg.Printf(_("Enter the location of the %s build tools\n"
1237 "folder. You can type in a path or use the\n"
1238 "Browse button to navigate to a folder."),
1239 (const wxChar*) (strPrefix.IsEmpty() ? wxString(wxT("native")) : strPrefix));
1240 wxString caption(_("Build Tools Path"));
1242 ecFolderDialog dialog(wxGetApp().GetSettings().m_buildToolsDir, arstrPaths, msg, this, ecID_BUILD_TOOLS_DIALOG, caption);
1243 if (dialog.ShowModal() == wxID_OK)
1245 wxString path (dialog.GetPath());
1247 // look for *objcopy under the user-specified build tools directory
1248 wxArrayString objcopyFiles;
1249 wxString objcopyFileSpec(wxT("objcopy"));
1251 objcopyFileSpec += wxT(".exe");
1253 size_t objcopyCount = wxDir::GetAllFiles(path, &objcopyFiles, wxT("*") + objcopyFileSpec, wxDIR_FILES | wxDIR_DIRS);
1254 bool bPrefixFound = false;
1255 for (int count=0; count < objcopyCount; count++)
1257 wxFileName file (objcopyFiles [count]);
1258 wxString new_prefix (file.GetFullName().Left (file.GetFullName().Find(objcopyFileSpec)));
1259 if ((! new_prefix.IsEmpty()) && ('-' == new_prefix.Last()))
1260 new_prefix = new_prefix.Left (new_prefix.Len() - 1); // strip off trailing hyphen
1261 if (new_prefix == strPrefix)
1262 bPrefixFound = true;
1266 msg.Printf(wxT("%s does not appear to contain the build tools - use this folder anyway?"), (const wxChar*) path);
1269 (wxYES == wxMessageBox(msg, wxGetApp().GetSettings().GetAppName(), wxICON_QUESTION|wxYES_NO)))
1271 for (int count=0; count < objcopyCount; count++)
1273 wxFileName file (objcopyFiles [count]);
1274 wxString new_prefix (file.GetFullName().Left (file.GetFullName().Find(objcopyFileSpec)));
1275 if ((! new_prefix.IsEmpty()) && ('-' == new_prefix.Last()))
1276 new_prefix = new_prefix.Left (new_prefix.Len() - 1); // strip off trailing hyphen
1277 map.Set(new_prefix, file.GetPath(wxPATH_GET_VOLUME));
1279 wxGetApp().GetSettings().m_buildToolsDir = path;
1284 void ecMainFrame::OnUserToolsPath(wxCommandEvent& event)
1286 ecConfigToolDoc* doc = wxGetApp().GetConfigToolDoc();
1290 wxArrayString paths = wxGetApp().GetSettings().m_userToolPaths;
1291 if (!wxGetApp().GetSettings().m_userToolsDir.IsEmpty())
1292 paths.Add(wxGetApp().GetSettings().m_userToolsDir);
1294 wxString msg(_("Enter the location of the user tools folder,\n"
1295 "which should contain cat and ls. You can type in\n"
1296 "a path or use the Browse button to navigate to a\n"
1299 wxString caption(_("User Tools Path"));
1300 wxString defaultPath(wxGetApp().GetSettings().m_userToolsDir);
1302 ecFolderDialog dialog(defaultPath, paths, msg, this, ecID_USER_TOOLS_DIALOG, caption);
1303 if (dialog.ShowModal() == wxID_OK)
1305 wxString path(dialog.GetPath());
1306 ecFileName strFile(path);
1309 wxString exeSuffix(wxT(".exe"));
1311 wxString exeSuffix(wxEmptyString);
1313 wxString prog(wxString(wxT("ls")) + exeSuffix);
1315 strFile += (const wxChar*) prog;
1318 msg.Printf(wxT("%s does not appear to contain the user tools - use this folder anyway?"), (const wxChar*) path);
1320 if(strFile.Exists() ||
1321 (wxYES == wxMessageBox(msg, wxGetApp().GetSettings().GetAppName(), wxICON_QUESTION|wxYES_NO)))
1323 wxGetApp().GetSettings().m_userToolsDir = path;
1328 // Process events for the window with the focus first.
1329 bool ecMainFrame::ProcessEvent(wxEvent& event)
1331 static wxEvent* s_lastEvent = NULL;
1333 if (& event == s_lastEvent)
1336 if (event.IsCommandEvent() && !event.IsKindOf(CLASSINFO(wxChildFocusEvent)))
1338 s_lastEvent = & event;
1340 wxWindow* focusWin = wxFindFocusDescendant(this);
1341 bool success = FALSE;
1344 //long windowId = focusWin->GetId();
1345 //wxLogDebug("Found focus window %d", windowId);
1346 success = focusWin->GetEventHandler()->ProcessEvent(event);
1349 success = wxDocParentFrame::ProcessEvent(event);
1356 return wxDocParentFrame::ProcessEvent(event);
1360 void ecMainFrame::SetFailRulePane(int nCount)
1366 strCount = wxT("No conflicts");
1369 strCount = wxT("1 conflict");
1372 strCount.Printf (_("%d conflicts"), nCount);
1377 GetStatusBar()->SetStatusText(strCount, ecFailRulePane);
1381 // Update the title, either via the document's view or explicitly if no doc
1382 void ecMainFrame::UpdateFrameTitle()
1384 if (wxGetApp().GetConfigToolDoc())
1385 wxGetApp().GetConfigToolDoc()->GetFirstView()->OnChangeFilename();
1387 SetTitle(wxGetApp().GetSettings().GetAppName());
1390 void ecMainFrame::OnUpdatePlatforms(wxUpdateUIEvent& event)
1395 void ecMainFrame::OnUpdateBuildOptions(wxUpdateUIEvent& event)
1397 event.Enable(wxGetApp().GetConfigToolDoc() != NULL);
1400 void ecMainFrame::OnUpdateBuildToolsPath(wxUpdateUIEvent& event)
1402 event.Enable(wxGetApp().GetConfigToolDoc() != NULL);
1405 void ecMainFrame::OnUpdateUserToolsPath(wxUpdateUIEvent& event)
1407 event.Enable(wxGetApp().GetConfigToolDoc() != NULL);
1410 void ecMainFrame::OnUpdateTemplates(wxUpdateUIEvent& event)
1412 event.Enable(wxGetApp().GetConfigToolDoc() != NULL);
1415 void ecMainFrame::OnUpdateAdmin(wxUpdateUIEvent& event)
1417 event.Enable(wxGetApp().GetConfigToolDoc() != NULL);
1420 void ecMainFrame::OnUpdatePackages(wxUpdateUIEvent& event)
1422 event.Enable(wxGetApp().GetConfigToolDoc() != NULL);
1425 void ecMainFrame::OnUpdateRunTests(wxUpdateUIEvent& event)
1427 event.Enable(wxGetApp().GetConfigToolDoc() != NULL && !wxGetApp().GetConfigToolDoc()->GetInstallTree().IsEmpty() && (wxGetApp().m_pipedProcess == NULL));
1430 void ecMainFrame::OnUpdateChooseRepository(wxUpdateUIEvent& event)
1435 void ecMainFrame::OnWhatsThis(wxCommandEvent& event)
1437 wxGetApp().OnWhatsThis(event);
1440 void ecMainFrame::OnSaveOutput(wxCommandEvent& event)
1442 ecOutputWindow* win = GetOutputWindow();
1446 wxFileDialog dialog(this, _("Choose a file for saving the output window contents"),
1447 wxT(""), wxT("output.txt"), wxT("*.txt"), wxSAVE|wxOVERWRITE_PROMPT);
1448 if (dialog.ShowModal() == wxID_OK)
1450 if (!win->SaveFile(dialog.GetPath()))
1452 wxMessageBox(_("Sorry, there was a problem saving the file."), wxGetApp().GetSettings().GetAppName(),
1453 wxICON_EXCLAMATION|wxID_OK);
1458 void ecMainFrame::OnUpdateSelectAll(wxUpdateUIEvent& event)
1460 wxWindow* win = wxWindow::FindFocus();
1461 event.Enable (win && win->IsKindOf(CLASSINFO(wxTextCtrl)) );
1464 void ecMainFrame::OnUpdateClear(wxUpdateUIEvent& event)
1466 wxWindow* win = wxWindow::FindFocus();
1467 event.Enable (win && win->IsKindOf(CLASSINFO(wxTextCtrl)) );
1470 void ecMainFrame::OnImport(wxCommandEvent& event)
1472 if (wxGetApp().GetConfigToolDoc())
1474 wxGetApp().GetConfigToolDoc()->ImportFile();
1478 void ecMainFrame::OnExport(wxCommandEvent& event)
1480 if (wxGetApp().GetConfigToolDoc())
1482 wxGetApp().GetConfigToolDoc()->ExportFile();
1486 void ecMainFrame::OnUpdateImport(wxUpdateUIEvent& event)
1488 event.Enable ( wxGetApp().GetConfigToolDoc() != NULL );
1491 void ecMainFrame::OnUpdateExport(wxUpdateUIEvent& event)
1493 event.Enable ( wxGetApp().GetConfigToolDoc() != NULL );
1496 void ecMainFrame::OnWebRedHatHome(wxCommandEvent& event)
1498 wxString strURL(wxT("http://www.redhat.com"));
1499 if (wxGetApp().GetConfigToolDoc())
1500 wxGetApp().GetConfigToolDoc()->ShowURL(strURL);
1503 void ecMainFrame::OnWebEcos(wxCommandEvent& event)
1505 wxString strURL(wxT("http://www.redhat.com/products/ecos"));
1506 if (wxGetApp().GetConfigToolDoc())
1507 wxGetApp().GetConfigToolDoc()->ShowURL(strURL);
1510 void ecMainFrame::OnWebNetRelease(wxCommandEvent& event)
1512 wxString strURL(wxT("http://sources.redhat.com/ecos"));
1513 if (wxGetApp().GetConfigToolDoc())
1514 wxGetApp().GetConfigToolDoc()->ShowURL(strURL);
1517 void ecMainFrame::OnWebUitron(wxCommandEvent& event)
1519 wxString strURL(wxT("http://www.itron.gr.jp/"));
1520 if (wxGetApp().GetConfigToolDoc())
1521 wxGetApp().GetConfigToolDoc()->ShowURL(strURL);
1524 void ecMainFrame::OnBuildLibrary(wxCommandEvent& event)
1526 // TODO: possibly add wxT("clean build") to ensure library is
1527 // cleanly built. No, can't do that because it would clean
1528 // out any user code too :-(
1530 bool regenerateBuildTree = FALSE;
1532 if (wxGetApp().GetSettings().m_editSaveFileOnly)
1534 int ans = wxMessageBox(wxT("Running in --edit-only mode so there may not be an up-to-date build tree.\nBuild the tree now?"), wxGetApp().GetSettings().GetAppName(), wxICON_QUESTION|wxYES_NO|wxCANCEL);
1538 regenerateBuildTree = TRUE;
1540 else if (ans == wxCANCEL)
1544 if (regenerateBuildTree)
1546 ecConfigToolDoc* pDoc = wxGetApp().GetConfigToolDoc();
1550 if (!pDoc->GenerateBuildTree())
1557 void ecMainFrame::OnBuildTests(wxCommandEvent& event)
1559 bool regenerateBuildTree = FALSE;
1561 if (wxGetApp().GetSettings().m_editSaveFileOnly)
1563 int ans = wxMessageBox(wxT("Running in --edit-only mode so there may not be an up-to-date build tree.\nBuild the tree now?"), wxGetApp().GetSettings().GetAppName(), wxICON_QUESTION|wxYES_NO|wxCANCEL);
1567 regenerateBuildTree = TRUE;
1569 else if (ans == wxCANCEL)
1573 if (regenerateBuildTree)
1575 ecConfigToolDoc* pDoc = wxGetApp().GetConfigToolDoc();
1579 if (!pDoc->GenerateBuildTree())
1583 wxGetApp().Build(wxT("tests"));
1586 void ecMainFrame::OnStopBuild(wxCommandEvent& event)
1588 if (wxGetApp().m_pipedProcess)
1590 long pid = wxGetApp().m_pipedProcess->GetPid();
1591 wxGetApp().m_pipedProcess->Detach();
1593 wxProcessKiller pKiller(pid);
1598 void ecMainFrame::OnClean(wxCommandEvent& event)
1600 wxGetApp().Build(wxT("clean"));
1603 void ecMainFrame::OnShell(wxCommandEvent& event)
1605 ecConfigToolDoc *pDoc=wxGetApp().GetConfigToolDoc();
1609 wxString variableSettings;
1610 if (wxGetApp().PrepareEnvironment(TRUE, & variableSettings))
1613 wxString currentDir = wxGetCwd();
1614 wxSetWorkingDirectory(pDoc->GetBuildTree());
1616 wxExecute("bash.exe");
1618 if (!currentDir.IsEmpty()) // if the current directory was changed
1620 wxSetWorkingDirectory(currentDir); // restore the previous current directory
1623 wxString cmdLine = wxString(wxT("xterm"));
1625 // TODO: query an appropriate variable, and/or have a setting for this
1631 void ecMainFrame::OnUpdateBuildLibrary(wxUpdateUIEvent& event)
1633 event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) && (wxGetApp().m_pipedProcess == NULL ));
1636 void ecMainFrame::OnUpdateBuildTests(wxUpdateUIEvent& event)
1638 event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) && (wxGetApp().m_pipedProcess == NULL ));
1641 void ecMainFrame::OnUpdateStopBuild(wxUpdateUIEvent& event)
1643 event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) && (wxGetApp().m_pipedProcess != NULL ));
1646 void ecMainFrame::OnUpdateClean(wxUpdateUIEvent& event)
1648 event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) && (wxGetApp().m_pipedProcess == NULL ));
1651 void ecMainFrame::OnRepositoryInfo(wxCommandEvent& event)
1653 ecRepositoryInfoDialog dialog(this, ecID_REPOSITORY_INFO, _("Repository Information"));
1657 void ecMainFrame::OnUpdateShell(wxUpdateUIEvent& event)
1659 event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) );
1662 void ecMainFrame::OnUpdateRepositoryInfo(wxUpdateUIEvent& event)
1664 event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) );
1667 void ecMainFrame::OnNewRegion(wxCommandEvent& event)
1673 void ecMainFrame::OnNewSection(wxCommandEvent& event)
1679 void ecMainFrame::OnDeleteRegionOrSection(wxCommandEvent& event)
1685 void ecMainFrame::OnRegionOrSectionProperties(wxCommandEvent& event)
1691 void ecMainFrame::OnUpdateNewRegion(wxUpdateUIEvent& event)
1695 event.Enable( FALSE );
1699 void ecMainFrame::OnUpdateNewSection(wxUpdateUIEvent& event)
1703 event.Enable( FALSE );
1707 void ecMainFrame::OnUpdateDeleteRegionOrSection(wxUpdateUIEvent& event)
1711 event.Enable( FALSE );
1715 void ecMainFrame::OnUpdateRegionOrSectionProperties(wxUpdateUIEvent& event)
1719 event.Enable( FALSE );
1723 void ecMainFrame::OnIndexDocs(wxCommandEvent& event)
1725 ecConfigToolDoc* doc = wxGetApp().GetConfigToolDoc();
1728 doc->RebuildHelpIndex(TRUE) ;
1732 void ecMainFrame::OnUpdateIndexDocs(wxUpdateUIEvent& event)
1734 event.Enable( wxGetApp().GetConfigToolDoc() != NULL );
1737 void ecMainFrame::OnGenerateBuildTree(wxCommandEvent& event)
1739 if (wxGetApp().GetConfigToolDoc() && wxGetApp().GetConfigToolDoc()->CanGenerateBuildTree())
1741 if (!wxGetApp().GetConfigToolDoc()->GenerateBuildTree())
1743 // Error probably already reported
1748 void ecMainFrame::OnUpdateGenerateBuildTree(wxUpdateUIEvent& event)
1750 event.Enable( (wxGetApp().GetConfigToolDoc() != NULL) && wxGetApp().GetConfigToolDoc()->CanGenerateBuildTree());