X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4fe30bceff0445f540e639d2b6d3977d56b34020..2934005d7daecb4343b394d9faabc86c8d04dca2:/utils/configtool/src/configtoolview.cpp diff --git a/utils/configtool/src/configtoolview.cpp b/utils/configtool/src/configtoolview.cpp index 726e509bf4..6cd42bc8fa 100644 --- a/utils/configtool/src/configtoolview.cpp +++ b/utils/configtool/src/configtoolview.cpp @@ -13,15 +13,14 @@ #pragma implementation "configtoolview.h" #endif -// Includes other headers for precompiled compilation -#include "wx/wx.h" +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" #ifdef __BORLANDC__ - #pragma hdrstop +#pragma hdrstop #endif #include "wx/wfstream.h" - #include "configtoolview.h" #include "configtooldoc.h" #include "configtree.h" @@ -96,10 +95,6 @@ BEGIN_EVENT_TABLE(ctConfigToolView, wxView) END_EVENT_TABLE() -ctConfigToolView::ctConfigToolView() -{ -} - // What to do when a view is created. Creates actual // windows for displaying the view. bool ctConfigToolView::OnCreate(wxDocument *doc, long WXUNUSED(flags) ) @@ -122,11 +117,11 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj) ctConfigTreeCtrl* treeCtrl = wxGetApp().GetMainFrame()->GetConfigTreeCtrl(); if (!treeCtrl) return; - + wxASSERT (doc != NULL); - + ctConfigItem* selItem = NULL; - + wxTreeItemId sel = treeCtrl->GetSelection(); if (sel.IsOk()) { @@ -134,12 +129,12 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj) if (data) selItem = data->GetConfigItem() ; } - + ctConfigToolHint* hint = (ctConfigToolHint*) hintObj; int hintOp = ctNoHint; if (hint) hintOp = hint->m_op; - + switch (hintOp) { case ctInitialUpdate: @@ -152,12 +147,12 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj) } } break; - case ctSelChanged: + case ctSelChanged: { if (selItem) { wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem); - } + } } break; case ctAllSaved: @@ -176,14 +171,14 @@ void ctConfigToolView::OnUpdate(wxView *WXUNUSED(sender), wxObject *hintObj) treeCtrl->DeleteAllItems(); wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(NULL); break; - } + } case ctValueChanged: { // ctConfigItem& ti = *(ctConfigItem *)hint->m_item; wxGetApp().GetMainFrame()->GetPropertyEditor()->ShowItem(selItem); - } + } break; - + default: break; } @@ -201,7 +196,7 @@ bool ctConfigToolView::OnClose(bool WXUNUSED(deleteWindow)) wxGetApp().GetDocManager()->ActivateView(this, false); Activate(false); - + wxGetApp().GetMainFrame()->SetDocument(NULL); wxGetApp().GetMainFrame()->GetSetupPage()->SetDocument(NULL) ; wxGetApp().GetMainFrame()->GetConfigurePage()->SetDocument(NULL) ; @@ -444,7 +439,7 @@ void ctConfigToolView::AddItem(ctConfigType type, const wxString& msg) parent = sel->GetParent(); insertBefore = sel->FindNextSibling(); } - + ctConfigItem* newItem = new ctConfigItem(NULL, type, name); newItem->InitProperties(); @@ -635,7 +630,7 @@ void ctConfigToolView::OnContextPasteAsChild(wxCommandEvent& WXUNUSED(event)) { ctConfigItem* parent = sel; ctConfigItem* insertBefore = NULL; - + ctConfigItem* newItem = doc->GetClipboardItem()->DeepClone(); ctConfigCommand* cmd = new ctConfigCommand(wxT("Paste Config Item"), ctCMD_PASTE, NULL, newItem, parent, insertBefore); @@ -767,7 +762,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event)) wxString oldType = property->GetVariant().GetType(); wxString oldEditorType = property->GetEditorType(); wxArrayString oldChoices = property->GetChoices(); - + ctCustomPropertyDialog dialog(wxGetApp().GetMainFrame(), wxID_ANY, _("Edit custom property")); dialog.SetPropertyName(oldName); @@ -780,7 +775,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event)) wxString editorType = dialog.GetEditorType(); wxArrayString choices = dialog.GetChoices(); wxString descr = dialog.GetPropertyDescription(); - + if (name != oldName && sel->GetProperties().FindProperty(name)) { wxMessageBox(_("Sorry, this name already exists."), _T("Add custom property"), @@ -814,7 +809,7 @@ void ctConfigToolView::OnEditCustomProperty(wxCommandEvent& WXUNUSED(event)) if (descr != oldDescription) property->SetDescription(descr); - + editor->ShowItem(sel); OnChangeFilename(); } @@ -918,12 +913,12 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event)) if (path.IsEmpty()) path = doc->GetFrameworkDir(false); wxString wildcard = _T("Header files (*.h)|*.h|All files (*.*)|*.*"); - + wxFileDialog dialog(wxTheApp->GetTopWindow(), _("Save Setup File As"), path, filename , wildcard, wxSAVE|wxOVERWRITE_PROMPT); - + if (dialog.ShowModal() == wxID_OK) { wxString fullPath = dialog.GetPath(); @@ -937,7 +932,7 @@ void ctConfigToolView::OnSaveSetupFile(wxCommandEvent& WXUNUSED(event)) } stream << setupStr; - } + } } void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event)) @@ -950,12 +945,12 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event)) if (path.IsEmpty()) path = doc->GetFrameworkDir(false); wxString wildcard = _T("Shell script files (*.sh)|*.sh|All files (*.*)|*.*"); - + wxFileDialog dialog(wxTheApp->GetTopWindow(), _("Save Configure Command File As"), path, filename , wildcard, wxSAVE|wxOVERWRITE_PROMPT); - + if (dialog.ShowModal() == wxID_OK) { wxString fullPath = dialog.GetPath(); @@ -969,7 +964,7 @@ void ctConfigToolView::OnSaveConfigureCommand(wxCommandEvent& WXUNUSED(event)) } stream << configureStr; - } + } } void ctConfigToolView::OnUpdateSaveSetupFile(wxUpdateUIEvent& event)