X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f8105809ef8f7cb0d1a9933f3f790b7b446c7cfa..08b97268061292f7c3794dae243a6490b23a42f1:/utils/configtool/src/configitemselector.cpp diff --git a/utils/configtool/src/configitemselector.cpp b/utils/configtool/src/configitemselector.cpp index c6f96d442a..04e86c7ed0 100644 --- a/utils/configtool/src/configitemselector.cpp +++ b/utils/configtool/src/configitemselector.cpp @@ -9,19 +9,26 @@ // Licence: ///////////////////////////////////////////////////////////////////////////// -#ifdef __GNUG__ -#pragma implementation "configitemselector.h" +// For compilers that support precompilation, includes "wx/wx.h". +#include "wx/wxprec.h" + +#ifdef __BORLANDC__ +#pragma hdrstop #endif -#include -#include -#include -#include -#include -#include -#include -#include +#ifndef WX_PRECOMP + +#include "wx/statline.h" +#include "wx/splitter.h" +#include "wx/scrolwin.h" +#include "wx/spinctrl.h" +#include "wx/spinbutt.h" +#endif + +#include "wx/cshelp.h" +#include "wx/notebook.h" +#include "wx/valgen.h" #include "configitemselector.h" #include "configtooldoc.h" #include "configtoolview.h" @@ -61,9 +68,9 @@ END_EVENT_TABLE() * ctConfigItemsSelector constructor */ -ctConfigItemsSelector::ctConfigItemsSelector( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style ) +ctConfigItemsSelector::ctConfigItemsSelector( wxWindow* parent, wxWindowID id, const wxString& caption) { - wxDialog::Create( parent, id, caption, pos, size, style ); + wxDialog::Create( parent, id, caption); CreateControls(); InitSourceConfigList(); @@ -74,14 +81,13 @@ ctConfigItemsSelector::ctConfigItemsSelector( wxWindow* parent, wxWindowID id, c */ void ctConfigItemsSelector::CreateControls() -{ +{ ////@begin ctConfigItemsSelector content construction ctConfigItemsSelector* item1 = this; wxBoxSizer* item2 = new wxBoxSizer(wxVERTICAL); item1->SetSizer(item2); - item1->SetAutoLayout(TRUE); wxBoxSizer* item3 = new wxBoxSizer(wxVERTICAL); item2->Add(item3, 1, wxGROW|wxALL, 5); @@ -93,7 +99,7 @@ void ctConfigItemsSelector::CreateControls() item3->Add(item5, 0, wxALIGN_LEFT|wxALL|wxADJUST_MINSIZE, 5); wxString* item6Strings = NULL; - wxListBox* item6 = new wxListBox(item1, ID_AVAILABLE_CONFIG_ITEMS, wxDefaultPosition, wxSize(-1, 150), 0, item6Strings, wxLB_SINGLE|wxLB_SORT); + wxListBox* item6 = new wxListBox(item1, ID_AVAILABLE_CONFIG_ITEMS, wxDefaultPosition, wxSize(wxDefaultCoord, 150), 0, item6Strings, wxLB_SINGLE|wxLB_SORT); item3->Add(item6, 1, wxGROW|wxALL, 5); wxStaticText* item7 = new wxStaticText(item1, wxID_STATIC, _("&List of configuration items:"), wxDefaultPosition, wxDefaultSize, 0); @@ -103,7 +109,7 @@ void ctConfigItemsSelector::CreateControls() item3->Add(item8, 0, wxGROW, 5); wxString* item9Strings = NULL; - wxListBox* item9 = new wxListBox(item1, ID_CONFIG_ITEMS, wxDefaultPosition, wxSize(-1, 100), 0, item9Strings, wxLB_SINGLE); + wxListBox* item9 = new wxListBox(item1, ID_CONFIG_ITEMS, wxDefaultPosition, wxSize(wxDefaultCoord, 100), 0, item9Strings, wxLB_SINGLE); item8->Add(item9, 1, wxGROW|wxALL, 5); wxBoxSizer* item10 = new wxBoxSizer(wxVERTICAL); @@ -120,11 +126,11 @@ void ctConfigItemsSelector::CreateControls() item13->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxButton* item15 = new wxButton(item1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0); + wxButton* item15 = new wxButton(item1, wxID_OK); item15->SetDefault(); item13->Add(item15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); - wxButton* item16 = new wxButton(item1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0); + wxButton* item16 = new wxButton(item1, wxID_CANCEL); item13->Add(item16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5); GetSizer()->Fit(this); @@ -137,7 +143,7 @@ void ctConfigItemsSelector::CreateControls() * Event handler for ID_CONFIG_ADD */ -void ctConfigItemsSelector::OnConfigAdd( wxCommandEvent& event ) +void ctConfigItemsSelector::OnConfigAdd( wxCommandEvent& WXUNUSED(event) ) { wxListBox* masterList = wxDynamicCast(FindWindow(ID_AVAILABLE_CONFIG_ITEMS), wxListBox); wxListBox* listBox = wxDynamicCast(FindWindow(ID_CONFIG_ITEMS), wxListBox); @@ -159,7 +165,7 @@ void ctConfigItemsSelector::OnConfigAdd( wxCommandEvent& event ) * Event handler for ID_CONFIG_REMOVE */ -void ctConfigItemsSelector::OnConfigRemove( wxCommandEvent& event ) +void ctConfigItemsSelector::OnConfigRemove( wxCommandEvent& WXUNUSED(event) ) { wxListBox* listBox = wxDynamicCast(FindWindow(ID_CONFIG_ITEMS), wxListBox); if (listBox) @@ -189,7 +195,7 @@ void ctConfigItemsSelector::OnOk( wxCommandEvent& event ) bool ctConfigItemsSelector::ShowToolTips() { - return TRUE; + return true; } /*! * Update event handler for ID_CONFIG_ADD @@ -221,34 +227,34 @@ void ctConfigItemsSelector::InitSourceConfigList(ctConfigItem* item) if (!item) return; - bool addIt = FALSE; + bool addIt = false; if (item->GetType() == ctTypeGroup) - addIt = FALSE; + addIt = false; else if (item->GetType() == ctTypeCheckGroup) - addIt = TRUE; + addIt = true; else if (item->GetType() == ctTypeRadioGroup) - addIt = TRUE; + addIt = true; else if (item->GetType() == ctTypeString) - addIt = TRUE; + addIt = true; else if (item->GetType() == ctTypeBoolCheck) - addIt = TRUE; + addIt = true; else if (item->GetType() == ctTypeBoolRadio) - addIt = TRUE; + addIt = true; else if (item->GetType() == ctTypeInteger) - addIt = TRUE; + addIt = true; if (addIt) { masterList->Append(item->GetName()); } - wxNode* node = item->GetChildren().GetFirst(); + wxObjectList::compatibility_iterator node = item->GetChildren().GetFirst(); while (node) { ctConfigItem* child = (ctConfigItem*) node->GetData(); InitSourceConfigList(child); - node = node->Next(); + node = node->GetNext(); } }