1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
10 /////////////////////////////////////////////////////////////////////////////
18 #include "wx/html/htmlwin.h"
19 #include "wx/notebook.h"
20 #include "wx/splitter.h"
21 #include "wx/clipbrd.h"
22 #include "wx/cshelp.h"
24 #include "wxconfigtool.h"
25 #include "mainframe.h"
26 #include "appsettings.h"
28 #include "configtree.h"
29 #include "propeditor.h"
30 #include "configtooldoc.h"
31 #include "configtoolview.h"
33 #include "bitmaps/wxconfigtool.xpm"
35 #include "bitmaps/copy.xpm"
36 #include "bitmaps/cut.xpm"
37 #include "bitmaps/paste.xpm"
38 #include "bitmaps/open.xpm"
39 #include "bitmaps/save.xpm"
40 #include "bitmaps/new.xpm"
41 #include "bitmaps/help.xpm"
42 #include "bitmaps/undo.xpm"
43 #include "bitmaps/redo.xpm"
44 #include "bitmaps/helpcs.xpm"
46 IMPLEMENT_CLASS(ctMainFrame
, wxDocParentFrame
)
48 BEGIN_EVENT_TABLE(ctMainFrame
, wxDocParentFrame
)
49 EVT_CLOSE(ctMainFrame::OnCloseWindow
)
50 EVT_MENU(wxID_ABOUT
, ctMainFrame::OnAbout
)
51 EVT_MENU(wxID_OPEN
, ctMainFrame::OnOpen
)
52 EVT_MENU(wxID_NEW
, ctMainFrame::OnNew
)
53 EVT_MENU(wxID_EXIT
, ctMainFrame::OnExit
)
54 EVT_MENU(ctID_SETTINGS
, ctMainFrame::OnSettings
)
55 EVT_MENU(ctID_SHOW_TOOLBAR
, ctMainFrame::OnShowToolbar
)
56 EVT_MENU(wxID_HELP
, ctMainFrame::OnHelp
)
57 EVT_MENU(ctID_REFERENCE_CONTENTS
, ctMainFrame::OnReferenceHelp
)
58 EVT_MENU(wxID_HELP_CONTEXT
, ctMainFrame::OnContextHelp
)
60 EVT_UPDATE_UI(ctID_ADD_ITEM_CHECKBOX
, ctMainFrame::OnUpdateDisable
)
61 EVT_UPDATE_UI(ctID_ADD_ITEM_RADIOBUTTON
, ctMainFrame::OnUpdateDisable
)
62 EVT_UPDATE_UI(ctID_ADD_ITEM_GROUP
, ctMainFrame::OnUpdateDisable
)
63 EVT_UPDATE_UI(ctID_ADD_ITEM_CHECK_GROUP
, ctMainFrame::OnUpdateDisable
)
64 EVT_UPDATE_UI(ctID_ADD_ITEM_RADIO_GROUP
, ctMainFrame::OnUpdateDisable
)
65 EVT_UPDATE_UI(ctID_ADD_ITEM_STRING
, ctMainFrame::OnUpdateDisable
)
66 EVT_UPDATE_UI(ctID_DELETE_ITEM
, ctMainFrame::OnUpdateDisable
)
67 EVT_UPDATE_UI(ctID_RENAME_ITEM
, ctMainFrame::OnUpdateDisable
)
68 EVT_UPDATE_UI(wxID_COPY
, ctMainFrame::OnUpdateDisable
)
69 EVT_UPDATE_UI(wxID_CUT
, ctMainFrame::OnUpdateDisable
)
70 EVT_UPDATE_UI(wxID_PASTE
, ctMainFrame::OnUpdateDisable
)
71 EVT_UPDATE_UI(ctID_ITEM_HELP
, ctMainFrame::OnUpdateDisable
)
73 EVT_UPDATE_UI(ctID_ADD_CUSTOM_PROPERTY
, ctMainFrame::OnUpdateDisable
)
74 EVT_UPDATE_UI(ctID_EDIT_CUSTOM_PROPERTY
, ctMainFrame::OnUpdateDisable
)
75 EVT_UPDATE_UI(ctID_DELETE_CUSTOM_PROPERTY
, ctMainFrame::OnUpdateDisable
)
77 EVT_UPDATE_UI(ctID_SAVE_SETUP_FILE
, ctMainFrame::OnUpdateDisable
)
78 EVT_UPDATE_UI(ctID_SAVE_CONFIGURE_COMMAND
, ctMainFrame::OnUpdateDisable
)
81 // Define my frame constructor
82 ctMainFrame::ctMainFrame(wxDocManager
*manager
, wxFrame
*parent
, wxWindowID id
, const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
,
84 wxDocParentFrame(manager
, parent
, id
, title
, pos
, size
, style
)
88 m_configurePage
= NULL
;
90 m_mainNotebook
= NULL
;
92 m_treeSplitterWindow
= new wxSplitterWindow(this, -1, wxDefaultPosition
, wxSize(400, 300),
93 wxSP_3DSASH
|wxSP_3DBORDER
);
95 m_configTreeCtrl
= new ctConfigTreeCtrl(m_treeSplitterWindow
, -1, wxDefaultPosition
, wxDefaultSize
,
96 wxTR_HAS_BUTTONS
|wxNO_BORDER
);
98 m_mainNotebook
= new wxNotebook(m_treeSplitterWindow
, -1, wxDefaultPosition
, wxSize(300, 300));
100 m_propertyEditor
= new ctPropertyEditor(m_mainNotebook
, -1, wxDefaultPosition
, wxSize(300, 200),
102 m_setupPage
= new ctOutputWindow(m_mainNotebook
, -1, wxDefaultPosition
, wxSize(300, 200),
104 m_configurePage
= new ctOutputWindow(m_mainNotebook
, -1, wxDefaultPosition
, wxSize(300, 200),
106 m_mainNotebook
->AddPage(m_propertyEditor
, _T("Properties"));
107 m_mainNotebook
->AddPage(m_setupPage
, _T("setup.h"));
108 m_mainNotebook
->AddPage(m_configurePage
, _T("configure"));
110 // Need to do this afterwards since wxWin sets the XP background
112 m_propertyEditor
->GetDescriptionWindow()->SetBackgroundColour(ctDESCRIPTION_BACKGROUND_COLOUR
);
114 int sashPos
= wxGetApp().GetSettings().m_mainSashSize
;
115 m_treeSplitterWindow
->SplitVertically(m_configTreeCtrl
, m_mainNotebook
, sashPos
);
117 SetIcon(wxIcon(wxconfigtool_xpm
));
121 wxMenuBar
* menuBar
= CreateMenuBar();
124 CreateToolBar(wxNO_BORDER
|wxTB_FLAT
|wxTB_HORIZONTAL
);
125 InitToolBar(GetToolBar());
127 if (wxGetApp().GetSettings().m_showToolBar
)
129 menuBar
->Check(ctID_SHOW_TOOLBAR
, TRUE
);
133 menuBar
->Check(ctID_SHOW_TOOLBAR
, FALSE
);
134 GetToolBar()->Show(FALSE
);
139 void ctMainFrame::OnCloseWindow(wxCloseEvent
& event
)
143 if (!GetDocument()->DeleteAllViews() && event
.CanVeto())
153 wxGetApp().GetSettings().m_frameStatus
= ctSHOW_STATUS_MAXIMIZED
;
154 else if (IsIconized())
155 wxGetApp().GetSettings().m_frameStatus
= ctSHOW_STATUS_MINIMIZED
;
157 wxGetApp().GetSettings().m_frameStatus
= ctSHOW_STATUS_NORMAL
;
159 // Must delete this now since the DLL loading library will be
160 // uninitialised by the time the app object is deleted
161 wxGetApp().ClearHelpControllers();
163 if (!IsMaximized() && !IsIconized())
165 wxGetApp().GetSettings().m_frameSize
= GetRect();
166 wxGetApp().GetSettings().m_mainSashSize
= m_treeSplitterWindow
->GetSashPosition();
172 void ctMainFrame::OnAbout(wxCommandEvent
& event
)
174 wxString msg
= wxGetApp().GetSettings().GetAppName() + wxT(" (c) Julian Smart");
175 wxString caption
= wxT("About ") + wxGetApp().GetSettings().GetAppName();
176 wxMessageBox(msg
, caption
, wxID_OK
|wxICON_INFORMATION
);
179 void ctMainFrame::OnOpen(wxCommandEvent
& event
)
181 wxGetApp().GetDocManager()->OnFileOpen(event
);
184 void ctMainFrame::OnNew(wxCommandEvent
& event
)
186 wxGetApp().GetDocManager()->OnFileNew(event
);
189 void ctMainFrame::OnExit(wxCommandEvent
& event
)
194 void ctMainFrame::OnSettings(wxCommandEvent
& event
)
196 wxGetApp().GetSettings().ShowSettingsDialog();
199 void ctMainFrame::InitToolBar(wxToolBar
* toolBar
)
201 toolBar
->SetHelpText(wxT("The toolbar gives you easy access to commonly used commands."));
204 wxBitmap toolBarBitmaps
[20];
206 toolBarBitmaps
[0] = wxBitmap(new_xpm
);
207 toolBarBitmaps
[1] = wxBitmap(open_xpm
);
208 toolBarBitmaps
[2] = wxBitmap(save_xpm
);
209 toolBarBitmaps
[3] = wxBitmap(copy_xpm
);
210 toolBarBitmaps
[4] = wxBitmap(cut_xpm
);
211 toolBarBitmaps
[5] = wxBitmap(paste_xpm
);
212 toolBarBitmaps
[6] = wxBitmap(print_xpm
);
213 toolBarBitmaps
[7] = wxBitmap(help_xpm
);
214 toolBarBitmaps
[10] = wxBitmap(undo_xpm
);
215 toolBarBitmaps
[11] = wxBitmap(redo_xpm
);
216 toolBarBitmaps
[12] = wxBitmap(help_xpm
);
217 toolBarBitmaps
[13] = wxBitmap(helpcs_xpm
);
219 toolBar
->AddTool(wxID_NEW
, toolBarBitmaps
[0], wxNullBitmap
, FALSE
, -1, -1, (wxObject
*) NULL
, wxT("New project"));
220 toolBar
->AddTool(wxID_OPEN
, toolBarBitmaps
[1], wxNullBitmap
, FALSE
, -1, -1, (wxObject
*) NULL
, wxT("Open project"));
221 toolBar
->AddTool(wxID_SAVE
, toolBarBitmaps
[2], wxNullBitmap
, FALSE
, -1, -1, (wxObject
*) NULL
, wxT("Save project"));
223 toolBar
->AddSeparator();
224 toolBar
->AddTool(wxID_CUT
, toolBarBitmaps
[4], wxNullBitmap
, FALSE
, -1, -1, (wxObject
*) NULL
, wxT("Cut"));
225 toolBar
->AddTool(wxID_COPY
, toolBarBitmaps
[3], wxNullBitmap
, FALSE
, -1, -1, (wxObject
*) NULL
, wxT("Copy"));
226 toolBar
->AddTool(wxID_PASTE
, toolBarBitmaps
[5], wxNullBitmap
, FALSE
, -1, -1, (wxObject
*) NULL
, wxT("Paste"));
227 toolBar
->AddSeparator();
228 toolBar
->AddTool(wxID_UNDO
, toolBarBitmaps
[10], wxNullBitmap
, FALSE
, -1, -1, (wxObject
*) NULL
, wxT("Undo"));
229 toolBar
->AddTool(wxID_REDO
, toolBarBitmaps
[11], wxNullBitmap
, FALSE
, -1, -1, (wxObject
*) NULL
, wxT("Redo"));
230 toolBar
->AddSeparator();
231 toolBar
->AddTool(ctID_ITEM_HELP
, toolBarBitmaps
[12], wxNullBitmap
, FALSE
, -1, -1, (wxObject
*) NULL
, wxT("Show help for this option"));
232 toolBar
->AddTool(wxID_HELP_CONTEXT
, toolBarBitmaps
[13], wxNullBitmap
, FALSE
, -1, -1, (wxObject
*) NULL
, wxT("Show help on the clicked item"));
234 // after adding the buttons to the toolbar, must call Realize() to reflect
239 wxMenuBar
* ctMainFrame::CreateMenuBar()
242 wxMenu
*fileMenu
= new wxMenu
;
244 wxGetApp().GetFileHistory().UseMenu(fileMenu
);
246 fileMenu
->Append(wxID_NEW
, wxT("&New...\tCtrl+N"), wxT("Create a new settings document"));
247 fileMenu
->Append(wxID_OPEN
, wxT("&Open...\tCtrl+O"), wxT("Open a settings document"));
248 fileMenu
->Append(wxID_CLOSE
, wxT("&Close\tCtrl+W"), wxT("Close the current settings document"));
249 fileMenu
->AppendSeparator();
250 fileMenu
->Append(wxID_SAVE
, wxT("&Save\tCtrl+S"), wxT("Save the settings document"));
251 fileMenu
->Append(wxID_SAVEAS
, wxT("&Save As..."), wxT("Save the settings document under a new filename"));
252 fileMenu
->AppendSeparator();
253 fileMenu
->Append(ctID_SAVE_SETUP_FILE
, wxT("Save Setup.&h...\tCtrl+H"), wxT("Save the setup.h file"));
254 fileMenu
->Append(ctID_SAVE_CONFIGURE_COMMAND
, wxT("Save Configure Script...\tCtrl+G"), wxT("Save the configure script file"));
255 fileMenu
->AppendSeparator();
256 fileMenu
->Append(wxID_EXIT
, wxT("E&xit\tAlt+F4"), wxT("Exit the application"));
258 wxGetApp().GetDocManager()->FileHistoryUseMenu(fileMenu
);
260 wxMenu
*editMenu
= new wxMenu
;
262 editMenu
->Append(wxID_UNDO
, _("&Undo\tCtrl+Z"));
263 editMenu
->Append(wxID_REDO
, _("&Redo\tCtrl+Y"));
264 editMenu
->AppendSeparator();
265 editMenu
->Append(wxID_COPY
, _("&Copy\tCtrl+C"));
266 editMenu
->Append(wxID_CUT
, _("Cu&t\tCtrl+X"));
267 editMenu
->Append(wxID_PASTE
, _("&Paste\tCtrl+V"));
268 editMenu
->AppendSeparator();
270 wxMenu
* itemMenu
= new wxMenu
;
271 itemMenu
->Append(ctID_ADD_ITEM_CHECKBOX
, _("Add &Checkbox Option"), _("Add a checkbox configuration option"));
272 itemMenu
->Append(ctID_ADD_ITEM_RADIOBUTTON
, _("Add &Radio Button Option"), _("Add a radio button configuration option"));
273 // TODO. However we can also simply use custom properties;
274 // but then the C++ code has to be special-cased.
275 // itemMenu->Append(ctID_ADD_ITEM_STRING, _("Add &String Option"), _("Add a string configuration option"));
276 itemMenu
->Append(ctID_ADD_ITEM_GROUP
, _("Add &Group Option"), _("Add a group configuration option"));
277 itemMenu
->Append(ctID_ADD_ITEM_CHECK_GROUP
, _("Add Chec&k Group Option"), _("Add a check group configuration option"));
278 itemMenu
->Append(ctID_ADD_ITEM_RADIO_GROUP
, _("Add Rad&io Group Option"), _("Add a radio group configuration option"));
280 editMenu
->Append(ctID_ADD_ITEM
, wxT("Add &Option"), itemMenu
, _("Add a configuration option"));
281 editMenu
->AppendSeparator();
283 wxMenu
* propertyMenu
= new wxMenu
;
284 propertyMenu
->Append(ctID_ADD_CUSTOM_PROPERTY
, _("&Add Custom Property"), _("Adds a custom property to the current option"));
285 propertyMenu
->Append(ctID_EDIT_CUSTOM_PROPERTY
, _("&Edit Custom Property"), _("Edits the currently selected custom property"));
286 propertyMenu
->Append(ctID_DELETE_CUSTOM_PROPERTY
, _("&Delete Custom Property"), _("Deletes the currently selected custom property"));
287 editMenu
->Append(ctID_CUSTOM_PROPERTY
, _("Custom P&roperty"), propertyMenu
, _("Custom property commands"));
289 editMenu
->AppendSeparator();
290 editMenu
->Append(ctID_DELETE_ITEM
, _("&Delete Option"), _("Delete a configuration option"));
291 editMenu
->Append(ctID_RENAME_ITEM
, _("&Rename Option"), _("Rename a configuration option"));
293 // Save for the command processor.
294 m_editMenu
= editMenu
;
296 wxMenu
*viewMenu
= new wxMenu
;
297 viewMenu
->Append(ctID_SHOW_TOOLBAR
, wxT("Show &Toolbar"), wxT("Toggle the toolbar on and off"),
299 viewMenu
->Append(ctID_SETTINGS
, wxT("&Settings...\tCtrl+T"), wxT("Show application settings"));
301 wxMenu
*helpMenu
= new wxMenu
;
302 helpMenu
->Append(wxID_HELP
, wxT("&Help Contents"), wxT("Show Configuration Tool help"));
303 helpMenu
->Append(ctID_REFERENCE_CONTENTS
, wxT("&wxWindows Help Contents"), wxT("Show wxWindows reference"));
304 helpMenu
->AppendSeparator();
305 helpMenu
->Append(ctID_ITEM_HELP
, wxT("&Configuration Option Help\tF1"), wxT("Show help for the selected option"));
306 helpMenu
->Append(wxID_HELP_CONTEXT
, wxT("&What's this?"), wxT("Show help on the clicked item"));
307 helpMenu
->AppendSeparator();
308 helpMenu
->Append(wxID_ABOUT
, wxT("&About..."), wxT("Show details about this application"));
310 wxMenuBar
*menuBar
= new wxMenuBar
;
312 menuBar
->Append(fileMenu
, wxT("&File"));
313 menuBar
->Append(editMenu
, wxT("&Edit"));
314 menuBar
->Append(viewMenu
, wxT("&View"));
315 menuBar
->Append(helpMenu
, wxT("&Help"));
318 wxConfig
config(wxGetApp().GetSettings().GetAppName(), wxT("wxWindows"));
319 config
.SetPath(wxT("FileHistory/"));
320 wxGetApp().GetDocManager()->FileHistoryLoad(config
);
326 /// Handles the Show Toolbar menu event.
327 void ctMainFrame::OnShowToolbar(wxCommandEvent
& event
)
329 wxGetApp().GetSettings().m_showToolBar
= !wxGetApp().GetSettings().m_showToolBar
;
330 GetToolBar()->Show(wxGetApp().GetSettings().m_showToolBar
);
334 /// Handles the Help Contents menu event.
335 void ctMainFrame::OnHelp(wxCommandEvent
& event
)
337 wxGetApp().GetHelpController().DisplayContents();
340 /// Handles context help
341 void ctMainFrame::OnContextHelp(wxCommandEvent
& event
)
343 wxContextHelp contextHelp
;
346 /// Handles the Help Contents menu event for the reference manual.
347 void ctMainFrame::OnReferenceHelp(wxCommandEvent
& event
)
349 wxGetApp().GetReferenceHelpController().DisplayContents();
352 /// Resizes the main frame according to the
353 /// state of the toolbar
354 void ctMainFrame::ResizeFrame()
357 wxSizeEvent
event(GetSize(), GetId());
358 this->ProcessEvent(event
);
361 /// Update the frame title.
362 void ctMainFrame::UpdateFrameTitle()
368 void ctMainFrame::OnUpdateDisable(wxUpdateUIEvent
& event
)
370 event
.Enable( FALSE
);
374 * ctOutputWindow represents a page showing a setup.h file or config command.
377 IMPLEMENT_CLASS(ctOutputWindow
, wxPanel
)
379 BEGIN_EVENT_TABLE(ctOutputWindow
, wxPanel
)
380 EVT_BUTTON(wxID_COPY
, ctOutputWindow::OnCopyToClipboard
)
381 EVT_BUTTON(wxID_SAVE
, ctOutputWindow::OnSaveText
)
382 EVT_BUTTON(ctID_REGENERATE
, ctOutputWindow::OnRegenerate
)
383 EVT_UPDATE_UI(wxID_SAVE
, ctOutputWindow::OnUpdateSaveText
)
384 EVT_UPDATE_UI(ctID_REGENERATE
, ctOutputWindow::OnUpdateRegenerate
)
385 EVT_UPDATE_UI(wxID_COPY
, ctOutputWindow::OnUpdateCopy
)
388 ctOutputWindow::ctOutputWindow(wxWindow
* parent
, wxWindowID id
,
389 const wxPoint
& pos
, const wxSize
& size
, long style
):
390 wxPanel(parent
, id
, pos
, size
, style
)
393 m_filenameCtrl
= NULL
;
398 ctOutputWindow::~ctOutputWindow()
402 /// Initialise the windows.
403 void ctOutputWindow::CreateWindows()
405 wxBoxSizer
*item0
= new wxBoxSizer( wxVERTICAL
);
407 wxBoxSizer
*item2
= new wxBoxSizer( wxHORIZONTAL
);
408 item0
->Add( item2
, 0, wxGROW
|wxALIGN_CENTER_VERTICAL
, 5 );
410 wxButton
*item4
= new wxButton( this, wxID_COPY
, _("&Copy"), wxDefaultPosition
, wxDefaultSize
, 0 );
411 item2
->Add( item4
, 0, wxGROW
|wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxTOP
|wxBOTTOM
|wxRIGHT
, 5 );
412 item4
->SetHelpText(_("Copies the selection or whole file to the clipboard."));
414 wxButton
*item5
= new wxButton( this, ctID_REGENERATE
, _("Re&generate"), wxDefaultPosition
, wxDefaultSize
, 0 );
415 item2
->Add( item5
, 0, wxGROW
|wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
|wxRIGHT
, 5 );
416 item5
->SetHelpText(_("Regenerates the code."));
419 m_filenameCtrl
= new wxTextCtrl(this, -1, wxEmptyString
, wxDefaultPosition
, wxDefaultSize
, wxSUNKEN_BORDER
|wxTE_READONLY
);
420 item2
->Add( m_filenameCtrl
, 1, wxGROW
|wxALIGN_CENTER_VERTICAL
|wxTOP
|wxBOTTOM
|wxRIGHT
, 5 );
421 m_filenameCtrl
->SetHelpText(_("Shows the filename where the code is being saved."));
423 m_filenameCtrl
= NULL
;
427 m_codeCtrl
= new wxTextCtrl(this, -1, wxEmptyString
, wxDefaultPosition
, wxSize(100, 100), wxTE_RICH
|wxTE_MULTILINE
|wxSUNKEN_BORDER
);
428 item0
->Add( m_codeCtrl
, 1, wxGROW
|wxALIGN_CENTER_VERTICAL
|wxLEFT
|wxRIGHT
|wxBOTTOM
, 5 );
430 SetAutoLayout( TRUE
);
434 /// Copies the text to the clipboard.
435 void ctOutputWindow::OnCopyToClipboard(wxCommandEvent
& event
)
437 // Try to copy the selection first
438 long int selFrom
, selTo
;
439 m_codeCtrl
->GetSelection(& selFrom
, & selTo
);
440 if (selFrom
!= selTo
)
446 // Copy the whole amount
447 if (!wxTheClipboard
->Open())
449 wxMessageBox(_("Sorry, could not open the clipboard."), _("Clipboard problem"), wxICON_EXCLAMATION
|wxOK
);
453 wxString
value(m_codeCtrl
->GetValue());
455 value
.Replace(_T("\n"), _T("\r\n"));
457 wxTextDataObject
*data
= new wxTextDataObject( value
);
459 if (!wxTheClipboard
->SetData( data
))
461 wxTheClipboard
->Close();
462 wxMessageBox(_("Sorry, could not copy to the clipboard."), _("Clipboard problem"), wxICON_EXCLAMATION
|wxOK
);
466 wxTheClipboard
->Close();
470 /// Sets the code in the text control.
471 void ctOutputWindow::SetText(const wxString
& text
)
474 m_codeCtrl
->SetValue(text
);
477 /// Sets the filename.
478 void ctOutputWindow::SetFilename(const wxString
& filename
)
481 m_filenameCtrl
->SetValue(filename
);
485 void ctOutputWindow::OnSaveText(wxCommandEvent
& event
)
487 if (m_codeCtrl
->IsModified())
489 wxString
filename(m_filenameCtrl
->GetValue());
490 if (!filename
.IsEmpty())
492 m_codeCtrl
->SaveFile(filename
);
493 m_codeCtrl
->DiscardEdits();
498 void ctOutputWindow::OnUpdateSaveText(wxUpdateUIEvent
& event
)
500 event
.Enable(m_doc
&& m_codeCtrl
&& m_codeCtrl
->IsModified());
503 void ctOutputWindow::OnRegenerate(wxCommandEvent
& event
)
507 ctConfigToolView
* view
= (ctConfigToolView
*) m_doc
->GetFirstView();
508 view
->RegenerateSetup();
512 void ctOutputWindow::OnUpdateRegenerate(wxUpdateUIEvent
& event
)
514 event
.Enable( m_doc
!= NULL
);
517 void ctOutputWindow::OnUpdateCopy(wxUpdateUIEvent
& event
)
519 event
.Enable( m_doc
!= NULL
);