From b5982058625b149a820cc53a2e8098026e9d3ce4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Sat, 28 Feb 2004 21:13:00 +0000 Subject: [PATCH] another cleanup of constraints code in samples (patch #906438) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25996 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- contrib/include/wx/deprecated/propform.h | 6 +- contrib/include/wx/deprecated/proplist.h | 20 +- .../samples/deprecated/proplist/proplist.cpp | 73 ++- contrib/src/deprecated/propform.cpp | 130 ++--- contrib/src/deprecated/proplist.cpp | 454 ++++++++---------- 5 files changed, 326 insertions(+), 357 deletions(-) diff --git a/contrib/include/wx/deprecated/propform.h b/contrib/include/wx/deprecated/propform.h index 0ef8e2ca08..705ad97dec 100644 --- a/contrib/include/wx/deprecated/propform.h +++ b/contrib/include/wx/deprecated/propform.h @@ -131,7 +131,7 @@ class WXDLLIMPEXP_DEPRECATED wxPropertyFormValidator: public wxPropertyValidator // Called to check value is OK (e.g. when OK is pressed) // Return FALSE if value didn't check out; signal to restore old value. virtual bool OnCheckValue( wxProperty *WXUNUSED(property), wxPropertyFormView *WXUNUSED(view), - wxWindow *WXUNUSED(parentWindow) ) { return TRUE; } + wxWindow *WXUNUSED(parentWindow) ) { return true; } // Does the transferance from the property editing area to the property itself. // Called by the view, e.g. when closing the window. @@ -279,7 +279,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = _T("panel")) - : wxPanel(parent, -1, pos, size, style, name) + : wxPanel(parent, wxID_ANY, pos, size, style, name) { m_view = v; } @@ -311,7 +311,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = _T("frame")) - : wxFrame(parent, -1, title, pos, size, style, name) + : wxFrame(parent, wxID_ANY, title, pos, size, style, name) { m_view = v; m_propertyPanel = NULL; diff --git a/contrib/include/wx/deprecated/proplist.h b/contrib/include/wx/deprecated/proplist.h index aa7667f22a..9410bf8bb1 100644 --- a/contrib/include/wx/deprecated/proplist.h +++ b/contrib/include/wx/deprecated/proplist.h @@ -97,14 +97,14 @@ public: virtual bool UpdatePropertyDisplayInList(wxProperty *property); // Update the whole list - virtual bool UpdatePropertyList(bool clearEditArea = TRUE); + virtual bool UpdatePropertyList(bool clearEditArea = true); // Find the wxListBox index corresponding to this property virtual int FindListIndexForProperty(wxProperty *property); // Select and show string representation in editor the given // property. NULL resets to show no property. - virtual bool ShowProperty(wxProperty *property, bool select = TRUE); + virtual bool ShowProperty(wxProperty *property, bool select = true); virtual bool EditProperty(wxProperty *property); // Update the display from the property @@ -200,7 +200,7 @@ class WXDLLIMPEXP_DEPRECATED wxPropertyTextEdit: public wxTextCtrl public: wxPropertyTextEdit(wxPropertyListView *v = NULL, wxWindow *parent = NULL, - const wxWindowID id = -1, + const wxWindowID id = wxID_ANY, const wxString& value = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, @@ -236,7 +236,7 @@ public: // cycling through possible values. inline virtual bool OnDoubleClick( wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) ) - { return TRUE; } + { return true; } // Called when the value listbox is selected. Default behaviour is to copy // string to text control, and retrieve the value into the property. @@ -245,19 +245,19 @@ public: // Called when the property value is edited using standard text control inline virtual bool OnPrepareControls( wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) ) - { return TRUE; } + { return true; } virtual bool OnClearControls(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow); // Called when the property is edited in detail inline virtual bool OnPrepareDetailControls( wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) ) - { return TRUE; } + { return true; } // Called if focus lost, IF we're in a modeless property editing situation. inline virtual bool OnClearDetailControls( wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) ) - { return TRUE; } + { return true; } // Called when the edit (...) button is pressed. The default implementation // calls view->BeginDetailedEditing; the filename validator (for example) overrides @@ -268,7 +268,7 @@ public: // Return FALSE if value didn't check out; signal to restore old value. inline virtual bool OnCheckValue( wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow) ) - { return TRUE; } + { return true; } // Called when TICK is pressed or focus is lost or view wants to update // the property list. @@ -324,7 +324,7 @@ public: const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxT("panel")) - : wxPanel(parent, -1, pos, size, style, name) + : wxPanel(parent, wxID_ANY, pos, size, style, name) { m_view = v; } @@ -362,7 +362,7 @@ public: const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = _T("frame")) - : wxFrame(parent, -1, title, pos, size, style, name) + : wxFrame(parent, wxID_ANY, title, pos, size, style, name) { m_view = v; m_propertyPanel = NULL; diff --git a/contrib/samples/deprecated/proplist/proplist.cpp b/contrib/samples/deprecated/proplist/proplist.cpp index dccdaf3266..82f3ab52e1 100644 --- a/contrib/samples/deprecated/proplist/proplist.cpp +++ b/contrib/samples/deprecated/proplist/proplist.cpp @@ -72,11 +72,11 @@ bool MyApp::OnInit(void) m_mainFrame->SetMenuBar(menu_bar); m_mainFrame->Centre(wxBOTH); - m_mainFrame->Show(TRUE); + m_mainFrame->Show(true); SetTopWindow(m_mainFrame); - return TRUE; + return true; } BEGIN_EVENT_TABLE(MyFrame, wxFrame) @@ -91,7 +91,7 @@ END_EVENT_TABLE() // Define my frame constructor MyFrame::MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size, long type): - wxFrame(frame, -1, title, pos, size, type) + wxFrame(frame, wxID_ANY, title, pos, size, type) { } @@ -101,7 +101,7 @@ void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) { if (wxGetApp().m_childWindow) { - wxGetApp().m_childWindow->Close(TRUE); + wxGetApp().m_childWindow->Close(true); } Destroy(); @@ -109,27 +109,27 @@ void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) { - Close(TRUE); + Close(true); } void MyFrame::OnDialogList(wxCommandEvent& WXUNUSED(event)) { - wxGetApp().PropertyListTest(TRUE); + wxGetApp().PropertyListTest(true); } void MyFrame::OnFrameList(wxCommandEvent& WXUNUSED(event)) { - wxGetApp().PropertyListTest(FALSE); + wxGetApp().PropertyListTest(false); } void MyFrame::OnDialogForm(wxCommandEvent& WXUNUSED(event)) { - wxGetApp().PropertyFormTest(TRUE); + wxGetApp().PropertyFormTest(true); } void MyFrame::OnFrameForm(wxCommandEvent& WXUNUSED(event)) { - wxGetApp().PropertyFormTest(FALSE); + wxGetApp().PropertyFormTest(false); } void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) @@ -159,7 +159,7 @@ void MyApp::PropertyListTest(bool useDialog) wxPropertySheet *sheet = new wxPropertySheet; sheet->AddProperty(new wxProperty(_T("fred"), 1.0, _T("real"))); - sheet->AddProperty(new wxProperty(_T("tough choice"), (bool)TRUE, _T("bool"))); + sheet->AddProperty(new wxProperty(_T("tough choice"), true, _T("bool"))); sheet->AddProperty(new wxProperty(_T("ian"), (long)45, _T("integer"), new wxIntegerListValidator(-50, 50))); sheet->AddProperty(new wxProperty(_T("bill"), 25.0, _T("real"), new wxRealListValidator(0.0, 100.0))); sheet->AddProperty(new wxProperty(_T("julian"), _T("one"), _T("string"))); @@ -174,20 +174,21 @@ void MyApp::PropertyListTest(bool useDialog) ( NULL, wxPROP_BUTTON_OK | wxPROP_BUTTON_CANCEL | wxPROP_BUTTON_CHECK_CROSS - |wxPROP_DYNAMIC_VALUE_FIELD|wxPROP_PULLDOWN|wxPROP_SHOWVALUES + | wxPROP_DYNAMIC_VALUE_FIELD | wxPROP_PULLDOWN | wxPROP_SHOWVALUES ); - wxDialog *propDialog = NULL; - wxPropertyListFrame *propFrame = NULL; + PropListDialog *propDialog = NULL; + PropListFrame *propFrame = NULL; if (useDialog) { propDialog = new PropListDialog(view, NULL, _T("Property Sheet Test"), - wxPoint(-1, -1), wxSize(400, 500), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODELESS); + wxDefaultPosition, wxSize(400, 500), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODELESS); m_childWindow = propDialog; } else { - propFrame = new PropListFrame(view, NULL, _T("Property Sheet Test"), wxPoint(-1, -1), wxSize(400, 500)); + propFrame = new PropListFrame(view, NULL, _T("Property Sheet Test"), + wxDefaultPosition, wxSize(400, 500)); m_childWindow = propFrame; } @@ -196,17 +197,15 @@ void MyApp::PropertyListTest(bool useDialog) if (useDialog) { view->ShowView(sheet, (wxPanel *)propDialog); - propDialog->Centre(wxBOTH); - propDialog->Show(TRUE); } else { propFrame->Initialize(); view->ShowView(sheet, propFrame->GetPropertyPanel()); - - propFrame->Centre(wxBOTH); - propFrame->Show(TRUE); } + + m_childWindow->Centre(wxBOTH); + m_childWindow->Show(true); } void MyApp::PropertyFormTest(bool useDialog) @@ -217,7 +216,7 @@ void MyApp::PropertyFormTest(bool useDialog) wxPropertySheet *sheet = new wxPropertySheet; sheet->AddProperty(new wxProperty(_T("fred"), 25.0, _T("real"), new wxRealFormValidator(0.0, 100.0))); - sheet->AddProperty(new wxProperty(_T("tough choice"), (bool)TRUE, _T("bool"))); + sheet->AddProperty(new wxProperty(_T("tough choice"), true, _T("bool"))); sheet->AddProperty(new wxProperty(_T("ian"), (long)45, _T("integer"), new wxIntegerFormValidator(-50, 50))); sheet->AddProperty(new wxProperty(_T("julian"), _T("one"), _T("string"))); wxStringList *strings = new wxStringList(wxT("one"), wxT("two"), wxT("three"), NULL); @@ -231,13 +230,13 @@ void MyApp::PropertyFormTest(bool useDialog) if (useDialog) { propDialog = new PropFormDialog(view, NULL, _T("Property Form Test"), - wxPoint(-1, -1), wxSize(380, 250), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL); + wxDefaultPosition, wxSize(380, 250), wxDEFAULT_DIALOG_STYLE|wxDIALOG_MODAL); m_childWindow = propDialog; } else { propFrame = new PropFormFrame(view, NULL, _T("Property Form Test"), - wxPoint(-1, -1), wxSize(380, 250)); + wxDefaultPosition, wxSize(380, 250)); propFrame->Initialize(); m_childWindow = propFrame; } @@ -269,13 +268,13 @@ void MyApp::PropertyFormTest(bool useDialog) #endif // Add items to the panel - wxButton *okButton = new wxButton(panel, wxID_OK, _T("OK"), wxPoint(-1, -1), + wxButton *okButton = new wxButton(panel, wxID_OK, _T("OK"), wxDefaultPosition, wxSize(80, 26), 0, wxDefaultValidator, _T("ok")); - wxButton *cancelButton = new wxButton(panel, wxID_CANCEL, _T("Cancel"), wxPoint(-1, -1), + wxButton *cancelButton = new wxButton(panel, wxID_CANCEL, _T("Cancel"), wxDefaultPosition, wxSize(80, 26), 0, wxDefaultValidator, _T("cancel")); - wxButton *updateButton = new wxButton(panel, wxID_PROP_UPDATE, _T("Update"), wxPoint(-1, -1), + wxButton *updateButton = new wxButton(panel, wxID_PROP_UPDATE, _T("Update"), wxDefaultPosition, wxSize(80, 26), 0, wxDefaultValidator, _T("update")); - wxButton *revertButton = new wxButton(panel, wxID_PROP_REVERT, _T("Revert"), wxPoint(-1, -1), + wxButton *revertButton = new wxButton(panel, wxID_PROP_REVERT, _T("Revert"), wxDefaultPosition, wxSize(80, 26), 0, wxDefaultValidator, _T("revert")); c = new wxLayoutConstraints; @@ -307,8 +306,8 @@ void MyApp::PropertyFormTest(bool useDialog) okButton->SetConstraints(c); // The name of this text item matches the "fred" property - wxTextCtrl *text = new wxTextCtrl(panel, -1, _T("Fred"), wxPoint(-1, -1), wxSize( - 200, -1), 0, wxDefaultValidator, _T("fred")); + wxTextCtrl *text = new wxTextCtrl(panel, wxID_ANY, _T("Fred"), wxDefaultPosition, + wxSize( 200, wxDefaultSize.y), 0, wxDefaultValidator, _T("fred")); c = new wxLayoutConstraints; c->left.SameAs(panel, wxLeft, 4); @@ -317,8 +316,8 @@ void MyApp::PropertyFormTest(bool useDialog) c->width.AsIs(); text->SetConstraints(c); - wxCheckBox *checkBox = new wxCheckBox(panel, -1, _T("Yes or no"), wxPoint(-1, -1), - wxSize(-1, -1), 0, wxDefaultValidator, _T("tough choice")); + wxCheckBox *checkBox = new wxCheckBox(panel, wxID_ANY, _T("Yes or no"), wxDefaultPosition, + wxDefaultSize, 0, wxDefaultValidator, _T("tough choice")); c = new wxLayoutConstraints; c->left.SameAs(text, wxRight, 20); @@ -327,7 +326,7 @@ void MyApp::PropertyFormTest(bool useDialog) c->width.AsIs(); checkBox->SetConstraints(c); - wxSlider *slider = new wxSlider(panel, -1, -50, 50, 150, wxPoint(-1, -1), + wxSlider *slider = new wxSlider(panel, wxID_ANY, -50, 50, 150, wxDefaultPosition, wxSize(200,10), 0, wxDefaultValidator, _T("ian")); c = new wxLayoutConstraints; @@ -337,7 +336,7 @@ void MyApp::PropertyFormTest(bool useDialog) c->width.AsIs(); slider->SetConstraints(c); - wxListBox *listBox = new wxListBox(panel, -1, wxPoint(-1, -1), + wxListBox *listBox = new wxListBox(panel, wxID_ANY, wxDefaultPosition, wxSize(200, 100), 0, NULL, 0, wxDefaultValidator, _T("constrained")); c = new wxLayoutConstraints; @@ -349,7 +348,7 @@ void MyApp::PropertyFormTest(bool useDialog) view->AddRegistry(&myFormValidatorRegistry); - panel->SetAutoLayout(TRUE); + panel->SetAutoLayout(true); view->ShowView(sheet, panel); view->AssociateNames(); @@ -357,15 +356,13 @@ void MyApp::PropertyFormTest(bool useDialog) if (useDialog) { propDialog->Layout(); - propDialog->Centre(wxBOTH); - propDialog->Show(TRUE); } else { // panel->Layout(); - propFrame->Centre(wxBOTH); - propFrame->Show(TRUE); } + m_childWindow->Centre(wxBOTH); + m_childWindow->Show(true); } BEGIN_EVENT_TABLE(PropListFrame, wxPropertyListFrame) diff --git a/contrib/src/deprecated/propform.cpp b/contrib/src/deprecated/propform.cpp index 6490cca3c8..e7730d4281 100644 --- a/contrib/src/deprecated/propform.cpp +++ b/contrib/src/deprecated/propform.cpp @@ -53,7 +53,7 @@ EVT_BUTTON(wxID_PROP_REVERT, wxPropertyFormView::OnRevert) EVT_BUTTON(wxID_PROP_UPDATE, wxPropertyFormView::OnUpdate) END_EVENT_TABLE() -bool wxPropertyFormView::sm_dialogCancelled = FALSE; +bool wxPropertyFormView::sm_dialogCancelled = false; wxPropertyFormView::wxPropertyFormView(wxWindow *propPanel, long flags):wxPropertyView(flags) { @@ -64,7 +64,7 @@ wxPropertyFormView::wxPropertyFormView(wxWindow *propPanel, long flags):wxProper m_windowCancelButton = NULL; m_windowHelpButton = NULL; - m_detailedEditing = FALSE; + m_detailedEditing = false; } wxPropertyFormView::~wxPropertyFormView(void) @@ -84,13 +84,13 @@ void wxPropertyFormView::ShowView(wxPropertySheet *ps, wxWindow *panel) // the object itself. bool wxPropertyFormView::OnUpdateView(void) { - return TRUE; + return true; } bool wxPropertyFormView::Check(void) { if (!m_propertySheet) - return FALSE; + return false; wxNode *node = m_propertySheet->GetProperties().GetFirst(); while (node) @@ -101,17 +101,17 @@ bool wxPropertyFormView::Check(void) { wxPropertyFormValidator *formValidator = (wxPropertyFormValidator *)validator; if (!formValidator->OnCheckValue(prop, this, m_propertyWindow)) - return FALSE; + return false; } node = node->GetNext(); } - return TRUE; + return true; } bool wxPropertyFormView::TransferToPropertySheet(void) { if (!m_propertySheet) - return FALSE; + return false; wxNode *node = m_propertySheet->GetProperties().GetFirst(); while (node) @@ -125,13 +125,13 @@ bool wxPropertyFormView::TransferToPropertySheet(void) } node = node->GetNext(); } - return TRUE; + return true; } bool wxPropertyFormView::TransferToDialog(void) { if (!m_propertySheet) - return FALSE; + return false; wxNode *node = m_propertySheet->GetProperties().GetFirst(); while (node) @@ -145,13 +145,13 @@ bool wxPropertyFormView::TransferToDialog(void) } node = node->GetNext(); } - return TRUE; + return true; } bool wxPropertyFormView::AssociateNames(void) { if (!m_propertySheet || !m_propertyWindow) - return FALSE; + return false; wxWindowList::Node *node = m_propertyWindow->GetChildren().GetFirst(); while (node) @@ -165,7 +165,7 @@ bool wxPropertyFormView::AssociateNames(void) } node = node->GetNext(); } - return TRUE; + return true; } @@ -176,7 +176,7 @@ bool wxPropertyFormView::OnClose(void) ((wxPropertyFormPanel*)m_propertyWindow)->SetView(NULL); } delete this; - return TRUE; + return true; } void wxPropertyFormView::OnOk(wxCommandEvent& WXUNUSED(event)) @@ -185,17 +185,17 @@ void wxPropertyFormView::OnOk(wxCommandEvent& WXUNUSED(event)) if (!Check()) return; - sm_dialogCancelled = FALSE; + sm_dialogCancelled = false; TransferToPropertySheet(); - m_managedWindow->Close(TRUE); + m_managedWindow->Close(true); } void wxPropertyFormView::OnCancel(wxCommandEvent& WXUNUSED(event)) { - sm_dialogCancelled = TRUE; + sm_dialogCancelled = true; - m_managedWindow->Close(TRUE); + m_managedWindow->Close(true); } void wxPropertyFormView::OnHelp(wxCommandEvent& WXUNUSED(event)) @@ -257,14 +257,14 @@ void wxPropertyFormView::OnCommand(wxWindow& win, wxCommandEvent& event) bool wxPropertyFormView::ProcessEvent(wxEvent& event) { if (wxEvtHandler::ProcessEvent(event)) - return TRUE; + return true; else if (event.IsCommandEvent() && !event.IsKindOf(CLASSINFO(wxUpdateUIEvent)) && event.GetEventObject()) { OnCommand(* ((wxWindow*) event.GetEventObject()), (wxCommandEvent&) event); - return TRUE; + return true; } else - return FALSE; + return false; } void wxPropertyFormView::OnDoubleClick(wxControl *item) @@ -303,12 +303,12 @@ END_EVENT_TABLE() wxPropertyFormDialog::wxPropertyFormDialog(wxPropertyFormView *v, wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name): -wxDialog(parent, -1, title, pos, size, style, name) +wxDialog(parent, wxID_ANY, title, pos, size, style, name) { m_view = v; m_view->AssociatePanel(this); m_view->SetManagedWindow(this); - // SetAutoLayout(TRUE); + // SetAutoLayout(true); } void wxPropertyFormDialog::OnCloseWindow(wxCloseEvent& event) @@ -340,7 +340,7 @@ bool wxPropertyFormDialog::ProcessEvent(wxEvent& event) if ( !m_view || ! m_view->ProcessEvent(event) ) return wxEvtHandler::ProcessEvent(event); else - return TRUE; + return true; } @@ -366,7 +366,7 @@ bool wxPropertyFormPanel::ProcessEvent(wxEvent& event) if ( !m_view || ! m_view->ProcessEvent(event) ) return wxEvtHandler::ProcessEvent(event); else - return TRUE; + return true; } /* @@ -399,10 +399,10 @@ bool wxPropertyFormFrame::Initialize(void) { m_view->AssociatePanel(m_propertyPanel); m_view->SetManagedWindow(this); - return TRUE; + return true; } else - return FALSE; + return false; } /* @@ -425,12 +425,12 @@ bool wxRealFormValidator::OnCheckValue( wxProperty *property, wxPropertyFormView wxWindow *parentWindow) { if (m_realMin == 0.0 && m_realMax == 0.0) - return TRUE; + return true; // The item used for viewing the real number: should be a text item. wxWindow *m_propertyWindow = property->GetWindow(); if (!m_propertyWindow || !m_propertyWindow->IsKindOf(CLASSINFO(wxTextCtrl))) - return FALSE; + return false; wxString value(((wxTextCtrl *)m_propertyWindow)->GetValue()); @@ -440,7 +440,7 @@ bool wxRealFormValidator::OnCheckValue( wxProperty *property, wxPropertyFormView wxChar buf[200]; wxSprintf(buf, wxT("Value %s is not a valid real number!"), (const wxChar *)value); wxMessageBox(buf, wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); - return FALSE; + return false; } if (val < m_realMin || val > m_realMax) @@ -448,9 +448,9 @@ bool wxRealFormValidator::OnCheckValue( wxProperty *property, wxPropertyFormView wxChar buf[200]; wxSprintf(buf, wxT("Value must be a real number between %.2f and %.2f!"), m_realMin, m_realMax); wxMessageBox(buf, wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); - return FALSE; + return false; } - return TRUE; + return true; } bool wxRealFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyFormView *WXUNUSED(view), @@ -459,16 +459,16 @@ bool wxRealFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyFormVi // The item used for viewing the real number: should be a text item. wxWindow *m_propertyWindow = property->GetWindow(); if (!m_propertyWindow || !m_propertyWindow->IsKindOf(CLASSINFO(wxTextCtrl))) - return FALSE; + return false; wxString value(((wxTextCtrl *)m_propertyWindow)->GetValue()); if (value.Length() == 0) - return FALSE; + return false; float f = (float)wxAtof((const wxChar *)value); property->GetValue() = f; - return TRUE; + return true; } bool wxRealFormValidator::OnDisplayValue(wxProperty *property, wxPropertyFormView *WXUNUSED(view), @@ -477,11 +477,11 @@ bool wxRealFormValidator::OnDisplayValue(wxProperty *property, wxPropertyFormVie // The item used for viewing the real number: should be a text item. wxWindow *m_propertyWindow = property->GetWindow(); if (!m_propertyWindow || !m_propertyWindow->IsKindOf(CLASSINFO(wxTextCtrl))) - return FALSE; + return false; wxTextCtrl *textItem = (wxTextCtrl *)m_propertyWindow; textItem->SetValue(FloatToString(property->GetValue().RealValue())); - return TRUE; + return true; } /// @@ -493,12 +493,12 @@ bool wxIntegerFormValidator::OnCheckValue(wxProperty *property, wxPropertyFormVi wxWindow *parentWindow) { if (m_integerMin == 0.0 && m_integerMax == 0.0) - return TRUE; + return true; // The item used for viewing the real number: should be a text item or a slider wxWindow *m_propertyWindow = property->GetWindow(); if (!m_propertyWindow) - return FALSE; + return false; long val = 0; @@ -511,7 +511,7 @@ bool wxIntegerFormValidator::OnCheckValue(wxProperty *property, wxPropertyFormVi wxChar buf[200]; wxSprintf(buf, wxT("Value %s is not a valid integer!"), (const wxChar *)value); wxMessageBox(buf, wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); - return FALSE; + return false; } } else if (m_propertyWindow->IsKindOf(CLASSINFO(wxSlider))) @@ -519,16 +519,16 @@ bool wxIntegerFormValidator::OnCheckValue(wxProperty *property, wxPropertyFormVi val = (long)((wxSlider *)m_propertyWindow)->GetValue(); } else - return FALSE; + return false; if (val < m_integerMin || val > m_integerMax) { wxChar buf[200]; wxSprintf(buf, wxT("Value must be an integer between %ld and %ld!"), m_integerMin, m_integerMax); wxMessageBox(buf, wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); - return FALSE; + return false; } - return TRUE; + return true; } bool wxIntegerFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyFormView *WXUNUSED(view), @@ -537,14 +537,14 @@ bool wxIntegerFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyFor // The item used for viewing the real number: should be a text item or a slider wxWindow *m_propertyWindow = property->GetWindow(); if (!m_propertyWindow) - return FALSE; + return false; if (m_propertyWindow->IsKindOf(CLASSINFO(wxTextCtrl))) { wxString value(((wxTextCtrl *)m_propertyWindow)->GetValue()); if (value.Length() == 0) - return FALSE; + return false; long i = wxAtol((const wxChar *)value); property->GetValue() = i; @@ -554,9 +554,9 @@ bool wxIntegerFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyFor property->GetValue() = (long)((wxSlider *)m_propertyWindow)->GetValue(); } else - return FALSE; + return false; - return TRUE; + return true; } bool wxIntegerFormValidator::OnDisplayValue( wxProperty *property, wxPropertyFormView *WXUNUSED(view), @@ -565,7 +565,7 @@ bool wxIntegerFormValidator::OnDisplayValue( wxProperty *property, wxPropertyFor // The item used for viewing the real number: should be a text item or a slider wxWindow *m_propertyWindow = property->GetWindow(); if (!m_propertyWindow) - return FALSE; + return false; if (m_propertyWindow->IsKindOf(CLASSINFO(wxTextCtrl))) { @@ -577,8 +577,8 @@ bool wxIntegerFormValidator::OnDisplayValue( wxProperty *property, wxPropertyFor ((wxSlider *)m_propertyWindow)->SetValue((int)property->GetValue().IntegerValue()); } else - return FALSE; - return TRUE; + return false; + return true; } /// @@ -592,9 +592,9 @@ bool wxBoolFormValidator::OnCheckValue(wxProperty *property, wxPropertyFormView // The item used for viewing the boolean: should be a checkbox wxWindow *m_propertyWindow = property->GetWindow(); if (!m_propertyWindow || !m_propertyWindow->IsKindOf(CLASSINFO(wxCheckBox))) - return FALSE; + return false; - return TRUE; + return true; } bool wxBoolFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyFormView *WXUNUSED(view), @@ -603,12 +603,12 @@ bool wxBoolFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyFormVi // The item used for viewing the boolean: should be a checkbox. wxWindow *m_propertyWindow = property->GetWindow(); if (!m_propertyWindow || !m_propertyWindow->IsKindOf(CLASSINFO(wxCheckBox))) - return FALSE; + return false; wxCheckBox *checkBox = (wxCheckBox *)m_propertyWindow; property->GetValue() = (bool)checkBox->GetValue(); - return TRUE; + return true; } bool wxBoolFormValidator::OnDisplayValue(wxProperty *property, wxPropertyFormView *WXUNUSED(view), @@ -617,11 +617,11 @@ bool wxBoolFormValidator::OnDisplayValue(wxProperty *property, wxPropertyFormVie // The item used for viewing the boolean: should be a checkbox. wxWindow *m_propertyWindow = property->GetWindow(); if (!m_propertyWindow || !m_propertyWindow->IsKindOf(CLASSINFO(wxCheckBox))) - return FALSE; + return false; wxCheckBox *checkBox = (wxCheckBox *)m_propertyWindow; checkBox->SetValue((bool)property->GetValue().BoolValue()); - return TRUE; + return true; } /// @@ -639,12 +639,12 @@ bool wxStringFormValidator::OnCheckValue(wxProperty *property, wxPropertyFormVie wxWindow *parentWindow ) { if (!m_strings) - return TRUE; + return true; // The item used for viewing the string: should be a text item, choice item or listbox. wxWindow *m_propertyWindow = property->GetWindow(); if (!m_propertyWindow) - return FALSE; + return false; if (m_propertyWindow->IsKindOf(CLASSINFO(wxTextCtrl))) { wxTextCtrl *text = (wxTextCtrl *)m_propertyWindow; @@ -654,7 +654,7 @@ bool wxStringFormValidator::OnCheckValue(wxProperty *property, wxPropertyFormVie str += text->GetValue(); str += wxT(" is not valid."); wxMessageBox(str, wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); - return FALSE; + return false; } } else @@ -662,7 +662,7 @@ bool wxStringFormValidator::OnCheckValue(wxProperty *property, wxPropertyFormVie // Any other item constrains the string value, // so we don't have to check it. } - return TRUE; + return true; } bool wxStringFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyFormView *WXUNUSED(view), @@ -671,7 +671,7 @@ bool wxStringFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyForm // The item used for viewing the string: should be a text item, choice item or listbox. wxWindow *m_propertyWindow = property->GetWindow(); if (!m_propertyWindow) - return FALSE; + return false; if (m_propertyWindow->IsKindOf(CLASSINFO(wxTextCtrl))) { wxTextCtrl *text = (wxTextCtrl *)m_propertyWindow; @@ -699,8 +699,8 @@ bool wxStringFormValidator::OnRetrieveValue(wxProperty *property, wxPropertyForm property->GetValue() = choice->GetStringSelection(); } else - return FALSE; - return TRUE; + return false; + return true; } bool wxStringFormValidator::OnDisplayValue(wxProperty *property, wxPropertyFormView *WXUNUSED(view), @@ -709,7 +709,7 @@ bool wxStringFormValidator::OnDisplayValue(wxProperty *property, wxPropertyFormV // The item used for viewing the string: should be a text item, choice item or listbox. wxWindow *m_propertyWindow = property->GetWindow(); if (!m_propertyWindow) - return FALSE; + return false; if (m_propertyWindow->IsKindOf(CLASSINFO(wxTextCtrl))) { wxTextCtrl *text = (wxTextCtrl *)m_propertyWindow; @@ -756,8 +756,8 @@ bool wxStringFormValidator::OnDisplayValue(wxProperty *property, wxPropertyFormV choice->SetStringSelection(property->GetValue().StringValue()); } else - return FALSE; - return TRUE; + return false; + return true; } #endif // wxUSE_PROPSHEET diff --git a/contrib/src/deprecated/proplist.cpp b/contrib/src/deprecated/proplist.cpp index 58cf7d29d8..5e366c05ef 100644 --- a/contrib/src/deprecated/proplist.cpp +++ b/contrib/src/deprecated/proplist.cpp @@ -89,7 +89,7 @@ void wxPropertyTextEdit::OnKillFocus() // Property list view // ---------------------------------------------------------------------------- -bool wxPropertyListView::sm_dialogCancelled = FALSE; +bool wxPropertyListView::sm_dialogCancelled = false; IMPLEMENT_DYNAMIC_CLASS(wxPropertyListView, wxPropertyView) @@ -122,7 +122,7 @@ wxPropertyListView::wxPropertyListView(wxPanel *propPanel, long flags):wxPropert m_windowCancelButton = NULL; m_windowHelpButton = NULL; - m_detailedEditing = FALSE; + m_detailedEditing = false; } wxPropertyListView::~wxPropertyListView() @@ -144,13 +144,13 @@ void wxPropertyListView::ShowView(wxPropertySheet *ps, wxPanel *panel) // the object itself. bool wxPropertyListView::OnUpdateView() { - return TRUE; + return true; } bool wxPropertyListView::UpdatePropertyList(bool clearEditArea) { if (!m_propertyScrollingList || !m_propertySheet) - return FALSE; + return false; m_propertyScrollingList->Clear(); if (clearEditArea) @@ -169,13 +169,13 @@ bool wxPropertyListView::UpdatePropertyList(bool clearEditArea) m_propertyScrollingList->Append(paddedString.GetData(), (void *)property); node = node->GetNext(); } - return TRUE; + return true; } bool wxPropertyListView::UpdatePropertyDisplayInList(wxProperty *property) { if (!m_propertyScrollingList || !m_propertySheet) - return FALSE; + return false; #ifdef __WXMSW__ int currentlySelected = m_propertyScrollingList->GetSelection(); @@ -194,7 +194,7 @@ bool wxPropertyListView::UpdatePropertyDisplayInList(wxProperty *property) m_propertyScrollingList->SetString(sel, paddedString.GetData()); } //#else -// UpdatePropertyList(FALSE); +// UpdatePropertyList(false); //#endif // TODO: why is this necessary? @@ -203,7 +203,7 @@ bool wxPropertyListView::UpdatePropertyDisplayInList(wxProperty *property) m_propertyScrollingList->SetSelection(currentlySelected); #endif - return TRUE; + return true; } // Find the wxListBox index corresponding to this property @@ -261,7 +261,7 @@ bool wxPropertyListView::ShowProperty(wxProperty *property, bool select) if (sel > -1) m_propertyScrollingList->SetSelection(sel); } - return TRUE; + return true; } // Find appropriate validator and load property into value controls @@ -269,28 +269,28 @@ bool wxPropertyListView::BeginShowingProperty(wxProperty *property) { m_currentValidator = FindPropertyValidator(property); if (!m_currentValidator) - return FALSE; + return false; if (!m_currentValidator->IsKindOf(CLASSINFO(wxPropertyListValidator))) - return FALSE; + return false; wxPropertyListValidator *listValidator = (wxPropertyListValidator *)m_currentValidator; listValidator->OnPrepareControls(property, this, m_propertyWindow); DisplayProperty(property); - return TRUE; + return true; } // Find appropriate validator and unload property from value controls bool wxPropertyListView::EndShowingProperty(wxProperty *property) { if (!m_currentValidator) - return FALSE; + return false; RetrieveProperty(property); if (!m_currentValidator->IsKindOf(CLASSINFO(wxPropertyListValidator))) - return FALSE; + return false; wxPropertyListValidator *listValidator = (wxPropertyListValidator *)m_currentValidator; @@ -298,9 +298,9 @@ bool wxPropertyListView::EndShowingProperty(wxProperty *property) if (m_detailedEditing) { listValidator->OnClearDetailControls(property, this, m_propertyWindow); - m_detailedEditing = FALSE; + m_detailedEditing = false; } - return TRUE; + return true; } void wxPropertyListView::BeginDetailedEditing() @@ -319,7 +319,7 @@ void wxPropertyListView::BeginDetailedEditing() wxPropertyListValidator *listValidator = (wxPropertyListValidator *)m_currentValidator; if (listValidator->OnPrepareDetailControls(m_currentProperty, this, m_propertyWindow)) - m_detailedEditing = TRUE; + m_detailedEditing = true; } void wxPropertyListView::EndDetailedEditing() @@ -339,38 +339,38 @@ void wxPropertyListView::EndDetailedEditing() if (m_detailedEditing) { listValidator->OnClearDetailControls(m_currentProperty, this, m_propertyWindow); - m_detailedEditing = FALSE; + m_detailedEditing = false; } } bool wxPropertyListView::DisplayProperty(wxProperty *property) { if (!m_currentValidator) - return FALSE; + return false; if (((m_currentValidator->GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == 0) || !property->IsEnabled()) - m_valueText->SetEditable(FALSE); + m_valueText->SetEditable(false); else - m_valueText->SetEditable(TRUE); + m_valueText->SetEditable(true); if (!m_currentValidator->IsKindOf(CLASSINFO(wxPropertyListValidator))) - return FALSE; + return false; wxPropertyListValidator *listValidator = (wxPropertyListValidator *)m_currentValidator; listValidator->OnDisplayValue(property, this, m_propertyWindow); - return TRUE; + return true; } bool wxPropertyListView::RetrieveProperty(wxProperty *property) { if (!m_currentValidator) - return FALSE; + return false; if (!property->IsEnabled()) - return FALSE; + return false; if (!m_currentValidator->IsKindOf(CLASSINFO(wxPropertyListValidator))) - return FALSE; + return false; wxPropertyListValidator *listValidator = (wxPropertyListValidator *)m_currentValidator; @@ -387,13 +387,13 @@ bool wxPropertyListView::RetrieveProperty(wxProperty *property) // Revert to old value listValidator->OnDisplayValue(property, this, m_propertyWindow); } - return TRUE; + return true; } bool wxPropertyListView::EditProperty(wxProperty *WXUNUSED(property)) { - return TRUE; + return true; } // Called by the listbox callback @@ -405,7 +405,7 @@ void wxPropertyListView::OnPropertySelect(wxCommandEvent& WXUNUSED(event)) wxProperty *newSel = (wxProperty *)m_propertyScrollingList->wxListBox::GetClientData(sel); if (newSel && newSel != m_currentProperty) { - ShowProperty(newSel, FALSE); + ShowProperty(newSel, false); } } } @@ -418,17 +418,17 @@ bool wxPropertyListView::CreateControls() wxSize smallButtonSize( 23, 23 ); if (m_valueText) - return TRUE; + return true; if (!panel) - return FALSE; + return false; wxFont guiFont = wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT); #ifdef __WXMSW__ wxFont *boringFont = wxTheFontList->FindOrCreateFont(guiFont.GetPointSize(), wxMODERN, - wxNORMAL, wxNORMAL, FALSE, _T("Courier New")); + wxNORMAL, wxNORMAL, false, _T("Courier New")); #else wxFont *boringFont = wxTheFontList->FindOrCreateFont(guiFont.GetPointSize(), wxTELETYPE, wxNORMAL, wxNORMAL); #endif @@ -451,13 +451,13 @@ bool wxPropertyListView::CreateControls() if ( tickBitmap.Ok() && crossBitmap.Ok() ) { - m_confirmButton = new wxBitmapButton(panel, wxID_PROP_CHECK, tickBitmap, wxPoint(-1, -1), smallButtonSize ); - m_cancelButton = new wxBitmapButton(panel, wxID_PROP_CROSS, crossBitmap, wxPoint(-1, -1), smallButtonSize ); + m_confirmButton = new wxBitmapButton(panel, wxID_PROP_CHECK, tickBitmap, wxDefaultPosition, smallButtonSize ); + m_cancelButton = new wxBitmapButton(panel, wxID_PROP_CROSS, crossBitmap, wxDefaultPosition, smallButtonSize ); } else { - m_confirmButton = new wxButton(panel, wxID_PROP_CHECK, _T(":-)"), wxPoint(-1, -1), smallButtonSize ); - m_cancelButton = new wxButton(panel, wxID_PROP_CROSS, _T("X"), wxPoint(-1, -1), smallButtonSize ); + m_confirmButton = new wxButton(panel, wxID_PROP_CHECK, _T(":-)"), wxDefaultPosition, smallButtonSize ); + m_cancelButton = new wxButton(panel, wxID_PROP_CROSS, _T("X"), wxDefaultPosition, smallButtonSize ); } topsizer->Add( m_confirmButton, 0, wxLEFT|wxTOP|wxBOTTOM | wxEXPAND, buttonborder ); @@ -465,14 +465,14 @@ bool wxPropertyListView::CreateControls() } m_valueText = new wxPropertyTextEdit(this, panel, wxID_PROP_TEXT, _T(""), - wxPoint(-1, -1), wxSize(-1, smallButtonSize.y), wxPROCESS_ENTER); - m_valueText->Enable(FALSE); + wxDefaultPosition, wxSize(wxDefaultSize.x, smallButtonSize.y), wxPROCESS_ENTER); + m_valueText->Enable(false); topsizer->Add( m_valueText, 1, wxALL | wxEXPAND, buttonborder ); if (m_buttonFlags & wxPROP_PULLDOWN) { - m_editButton = new wxButton(panel, wxID_PROP_EDIT, _T("..."), wxPoint(-1, -1), smallButtonSize); - m_editButton->Enable(FALSE); + m_editButton = new wxButton(panel, wxID_PROP_EDIT, _T("..."), wxDefaultPosition, smallButtonSize); + m_editButton->Enable(false); topsizer->Add( m_editButton, 0, wxRIGHT|wxTOP|wxBOTTOM | wxEXPAND, buttonborder ); } @@ -482,10 +482,10 @@ bool wxPropertyListView::CreateControls() m_middleSizer = new wxBoxSizer( wxVERTICAL ); - m_valueList = new wxListBox(panel, wxID_PROP_VALUE_SELECT, wxPoint(-1, -1), wxSize(-1, 60)); - m_valueList->Show(FALSE); + m_valueList = new wxListBox(panel, wxID_PROP_VALUE_SELECT, wxDefaultPosition, wxSize(wxDefaultSize.x, 60)); + m_valueList->Show(false); - m_propertyScrollingList = new wxListBox(panel, wxID_PROP_SELECT, wxPoint(-1, -1), wxSize(100, 100)); + m_propertyScrollingList = new wxListBox(panel, wxID_PROP_SELECT, wxDefaultPosition, wxSize(100, 100)); m_propertyScrollingList->SetFont(* boringFont); m_middleSizer->Add( m_propertyScrollingList, 1, wxALL|wxEXPAND, buttonborder ); @@ -503,24 +503,24 @@ bool wxPropertyListView::CreateControls() if (m_buttonFlags & wxPROP_BUTTON_OK) { - m_windowCloseButton = new wxButton(panel, wxID_OK, _("OK"), wxPoint(-1, -1), largeButtonSize ); + m_windowCloseButton = new wxButton(panel, wxID_OK, _("OK"), wxDefaultPosition, largeButtonSize ); m_windowCloseButton->SetDefault(); m_windowCloseButton->SetFocus(); bottomsizer->Add( m_windowCloseButton, 0, wxALL, buttonborder ); } else if (m_buttonFlags & wxPROP_BUTTON_CLOSE) { - m_windowCloseButton = new wxButton(panel, wxID_OK, _("Close"), wxPoint(-1, -1), largeButtonSize ); + m_windowCloseButton = new wxButton(panel, wxID_OK, _("Close"), wxDefaultPosition, largeButtonSize ); bottomsizer->Add( m_windowCloseButton, 0, wxALL, buttonborder ); } if (m_buttonFlags & wxPROP_BUTTON_CANCEL) { - m_windowCancelButton = new wxButton(panel, wxID_CANCEL, _("Cancel"), wxPoint(-1, -1), largeButtonSize ); + m_windowCancelButton = new wxButton(panel, wxID_CANCEL, _("Cancel"), wxDefaultPosition, largeButtonSize ); bottomsizer->Add( m_windowCancelButton, 0, wxALL, buttonborder ); } if (m_buttonFlags & wxPROP_BUTTON_HELP) { - m_windowHelpButton = new wxButton(panel, wxID_HELP, _("Help"), wxPoint(-1, -1), largeButtonSize ); + m_windowHelpButton = new wxButton(panel, wxID_HELP, _("Help"), wxDefaultPosition, largeButtonSize ); bottomsizer->Add( m_windowHelpButton, 0, wxALL, buttonborder ); } @@ -529,7 +529,7 @@ bool wxPropertyListView::CreateControls() panel->SetSizer( mainsizer ); - return TRUE; + return true; } void wxPropertyListView::ShowTextControl(bool show) @@ -574,7 +574,7 @@ bool wxPropertyListView::OnClose() OnCheck(event); delete this; - return TRUE; + return true; } void wxPropertyListView::OnValueListSelect(wxCommandEvent& WXUNUSED(event)) @@ -595,15 +595,15 @@ void wxPropertyListView::OnOk(wxCommandEvent& event) // Retrieve the value if any OnCheck(event); - m_managedWindow->Close(TRUE); - sm_dialogCancelled = FALSE; + m_managedWindow->Close(true); + sm_dialogCancelled = false; } void wxPropertyListView::OnCancel(wxCommandEvent& WXUNUSED(event)) { // SetReturnCode(wxID_CANCEL); - m_managedWindow->Close(TRUE); - sm_dialogCancelled = TRUE; + m_managedWindow->Close(true); + sm_dialogCancelled = true; } void wxPropertyListView::OnHelp(wxCommandEvent& WXUNUSED(event)) @@ -681,12 +681,12 @@ END_EVENT_TABLE() wxPropertyListDialog::wxPropertyListDialog(wxPropertyListView *v, wxWindow *parent, const wxString& title, const wxPoint& pos, const wxSize& size, long style, const wxString& name): - wxDialog(parent, -1, title, pos, size, style, name) + wxDialog(parent, wxID_ANY, title, pos, size, style, name) { m_view = v; m_view->AssociatePanel( ((wxPanel*)this) ); m_view->SetManagedWindow(this); - SetAutoLayout(TRUE); + SetAutoLayout(true); } void wxPropertyListDialog::OnCloseWindow(wxCloseEvent& event) @@ -724,7 +724,7 @@ bool wxPropertyListDialog::ProcessEvent(wxEvent& event) if ( !m_view || ! m_view->ProcessEvent(event) ) return wxEvtHandler::ProcessEvent(event); else - return TRUE; + return true; } // ---------------------------------------------------------------------------- @@ -755,7 +755,7 @@ bool wxPropertyListPanel::ProcessEvent(wxEvent& event) if ( !m_view || ! m_view->ProcessEvent(event) ) return wxEvtHandler::ProcessEvent(event); else - return TRUE; + return true; } void wxPropertyListPanel::OnSize(wxSizeEvent& WXUNUSED(event)) @@ -801,11 +801,11 @@ bool wxPropertyListFrame::Initialize() { m_view->AssociatePanel(m_propertyPanel); m_view->SetManagedWindow(this); - m_propertyPanel->SetAutoLayout(TRUE); - return TRUE; + m_propertyPanel->SetAutoLayout(true); + return true; } else - return FALSE; + return false; } // ---------------------------------------------------------------------------- @@ -816,11 +816,11 @@ IMPLEMENT_ABSTRACT_CLASS(wxPropertyListValidator, wxPropertyValidator) bool wxPropertyListValidator::OnSelect(bool select, wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow) { -// view->GetValueText()->Show(TRUE); +// view->GetValueText()->Show(true); if (select) OnDisplayValue(property, view, parentWindow); - return TRUE; + return true; } bool wxPropertyListValidator::OnValueListSelect(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) @@ -831,16 +831,16 @@ bool wxPropertyListValidator::OnValueListSelect(wxProperty *property, wxProperty view->GetValueText()->SetValue(s); view->RetrieveProperty(property); } - return TRUE; + return true; } bool wxPropertyListValidator::OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { -// view->GetValueText()->Show(TRUE); +// view->GetValueText()->Show(true); wxString str(property->GetValue().GetStringRepresentation()); view->GetValueText()->SetValue(str); - return TRUE; + return true; } // Called when TICK is pressed or focus is lost or view wants to update @@ -849,8 +849,8 @@ bool wxPropertyListValidator::OnDisplayValue(wxProperty *property, wxPropertyLis bool wxPropertyListValidator::OnRetrieveValue(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!view->GetValueText()) - return FALSE; - return FALSE; + return false; + return false; } void wxPropertyListValidator::OnEdit(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) @@ -864,12 +864,12 @@ void wxPropertyListValidator::OnEdit(wxProperty *WXUNUSED(property), wxPropertyL bool wxPropertyListValidator::OnClearControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(FALSE); + view->GetConfirmButton()->Enable(false); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(FALSE); + view->GetCancelButton()->Enable(false); if (view->GetEditButton()) - view->GetEditButton()->Enable(FALSE); - return TRUE; + view->GetEditButton()->Enable(false); + return true; } // ---------------------------------------------------------------------------- @@ -884,10 +884,10 @@ IMPLEMENT_DYNAMIC_CLASS(wxRealListValidator, wxPropertyListValidator) bool wxRealListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *parentWindow) { if (m_realMin == 0.0 && m_realMax == 0.0) - return TRUE; + return true; if (!view->GetValueText()) - return FALSE; + return false; wxString value(view->GetValueText()->GetValue()); float val = 0.0; @@ -896,7 +896,7 @@ bool wxRealListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropert wxChar buf[200]; wxSprintf(buf, wxT("Value %s is not a valid real number!"), value.GetData()); wxMessageBox(buf, wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); - return FALSE; + return false; } if (val < m_realMin || val > m_realMax) @@ -904,9 +904,9 @@ bool wxRealListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropert wxChar buf[200]; wxSprintf(buf, wxT("Value must be a real number between %.2f and %.2f!"), m_realMin, m_realMax); wxMessageBox(buf, wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); - return FALSE; + return false; } - return TRUE; + return true; } // Called when TICK is pressed or focus is lost or view wants to update @@ -915,28 +915,28 @@ bool wxRealListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropert bool wxRealListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!view->GetValueText()) - return FALSE; + return false; if (wxStrlen(view->GetValueText()->GetValue()) == 0) - return FALSE; + return false; wxString value(view->GetValueText()->GetValue()); float f = (float)wxAtof(value.GetData()); property->GetValue() = f; - return TRUE; + return true; } bool wxRealListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(TRUE); + view->GetConfirmButton()->Enable(true); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(TRUE); + view->GetCancelButton()->Enable(true); if (view->GetEditButton()) - view->GetEditButton()->Enable(FALSE); + view->GetEditButton()->Enable(false); if (view->GetValueText()) - view->GetValueText()->Enable(TRUE); - return TRUE; + view->GetValueText()->Enable(true); + return true; } /// @@ -947,10 +947,10 @@ IMPLEMENT_DYNAMIC_CLASS(wxIntegerListValidator, wxPropertyListValidator) bool wxIntegerListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *parentWindow) { if (m_integerMin == 0 && m_integerMax == 0) - return TRUE; + return true; if (!view->GetValueText()) - return FALSE; + return false; wxString value(view->GetValueText()->GetValue()); long val = 0; @@ -959,16 +959,16 @@ bool wxIntegerListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxProp wxChar buf[200]; wxSprintf(buf, wxT("Value %s is not a valid integer!"), value.GetData()); wxMessageBox(buf, wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); - return FALSE; + return false; } if (val < m_integerMin || val > m_integerMax) { wxChar buf[200]; wxSprintf(buf, wxT("Value must be an integer between %ld and %ld!"), m_integerMin, m_integerMax); wxMessageBox(buf, wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); - return FALSE; + return false; } - return TRUE; + return true; } // Called when TICK is pressed or focus is lost or view wants to update @@ -977,28 +977,28 @@ bool wxIntegerListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxProp bool wxIntegerListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!view->GetValueText()) - return FALSE; + return false; if (wxStrlen(view->GetValueText()->GetValue()) == 0) - return FALSE; + return false; wxString value(view->GetValueText()->GetValue()); long val = (long)wxAtoi(value.GetData()); property->GetValue() = (long)val; - return TRUE; + return true; } bool wxIntegerListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(TRUE); + view->GetConfirmButton()->Enable(true); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(TRUE); + view->GetCancelButton()->Enable(true); if (view->GetEditButton()) - view->GetEditButton()->Enable(FALSE); + view->GetEditButton()->Enable(false); if (view->GetValueText()) - view->GetValueText()->Enable(TRUE); - return TRUE; + view->GetValueText()->Enable(true); + return true; } /// @@ -1009,14 +1009,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxBoolListValidator, wxPropertyListValidator) bool wxBoolListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *parentWindow) { if (!view->GetValueText()) - return FALSE; + return false; wxString value(view->GetValueText()->GetValue()); if (value != wxT("True") && value != wxT("False")) { wxMessageBox(wxT("Value must be True or False!"), wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); - return FALSE; + return false; } - return TRUE; + return true; } // Called when TICK is pressed or focus is lost or view wants to update @@ -1025,21 +1025,21 @@ bool wxBoolListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropert bool wxBoolListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!view->GetValueText()) - return FALSE; + return false; if (wxStrlen(view->GetValueText()->GetValue()) == 0) - return FALSE; + return false; wxString value(view->GetValueText()->GetValue()); bool boolValue = (value == wxT("True")); - property->GetValue() = (bool)boolValue; - return TRUE; + property->GetValue() = boolValue; + return true; } bool wxBoolListValidator::OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!view->GetValueText()) - return FALSE; + return false; wxString str(property->GetValue().GetStringRepresentation()); view->GetValueText()->SetValue(str); @@ -1048,28 +1048,28 @@ bool wxBoolListValidator::OnDisplayValue(wxProperty *property, wxPropertyListVie { view->GetValueList()->SetStringSelection(str); } - return TRUE; + return true; } bool wxBoolListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(FALSE); + view->GetConfirmButton()->Enable(false); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(FALSE); + view->GetCancelButton()->Enable(false); if (view->GetEditButton()) - view->GetEditButton()->Enable(TRUE); + view->GetEditButton()->Enable(true); if (view->GetValueText()) - view->GetValueText()->Enable(FALSE); - return TRUE; + view->GetValueText()->Enable(false); + return true; } bool wxBoolListValidator::OnPrepareDetailControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetValueList()) { - view->ShowListBoxControl(TRUE); - view->GetValueList()->Enable(TRUE); + view->ShowListBoxControl(true); + view->GetValueList()->Enable(true); view->GetValueList()->Append(wxT("True")); view->GetValueList()->Append(wxT("False")); @@ -1077,7 +1077,7 @@ bool wxBoolListValidator::OnPrepareDetailControls(wxProperty *WXUNUSED(property) view->GetValueList()->SetStringSelection(currentString); delete[] currentString; } - return TRUE; + return true; } bool wxBoolListValidator::OnClearDetailControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) @@ -1085,10 +1085,10 @@ bool wxBoolListValidator::OnClearDetailControls(wxProperty *WXUNUSED(property), if (view->GetValueList()) { view->GetValueList()->Clear(); - view->ShowListBoxControl(FALSE); - view->GetValueList()->Enable(FALSE); + view->ShowListBoxControl(false); + view->GetValueList()->Enable(false); } - return TRUE; + return true; } // Called when the property is double clicked. Extra functionality can be provided, @@ -1096,15 +1096,15 @@ bool wxBoolListValidator::OnClearDetailControls(wxProperty *WXUNUSED(property), bool wxBoolListValidator::OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!view->GetValueText()) - return FALSE; + return false; if (property->GetValue().BoolValue()) - property->GetValue() = (bool)FALSE; + property->GetValue() = false; else - property->GetValue() = (bool)TRUE; + property->GetValue() = true; view->DisplayProperty(property); view->UpdatePropertyDisplayInList(property); view->OnPropertyChanged(property); - return TRUE; + return true; } /// @@ -1124,10 +1124,10 @@ wxStringListValidator::wxStringListValidator(wxStringList *list, long flags): bool wxStringListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *parentWindow) { if (!m_strings) - return TRUE; + return true; if (!view->GetValueText()) - return FALSE; + return false; wxString value(view->GetValueText()->GetValue()); if (!m_strings->Member(value.GetData())) @@ -1136,9 +1136,9 @@ bool wxStringListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPrope str += value.GetData(); str += wxT(" is not valid."); wxMessageBox( str.GetData(), wxT("Property value error"), wxOK | wxICON_EXCLAMATION, parentWindow); - return FALSE; + return false; } - return TRUE; + return true; } // Called when TICK is pressed or focus is lost or view wants to update @@ -1147,10 +1147,10 @@ bool wxStringListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPrope bool wxStringListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!view->GetValueText()) - return FALSE; + return false; wxString value(view->GetValueText()->GetValue()); property->GetValue() = value ; - return TRUE; + return true; } // Called when TICK is pressed or focus is lost or view wants to update @@ -1159,14 +1159,14 @@ bool wxStringListValidator::OnRetrieveValue(wxProperty *property, wxPropertyList bool wxStringListValidator::OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!view->GetValueText()) - return FALSE; + return false; wxString str(property->GetValue().GetStringRepresentation()); view->GetValueText()->SetValue(str); if (m_strings && view->GetValueList() && view->GetValueList()->IsShown() && view->GetValueList()->GetCount() > 0) { view->GetValueList()->SetStringSelection(str); } - return TRUE; + return true; } bool wxStringListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) @@ -1175,28 +1175,28 @@ bool wxStringListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wx if (!m_strings) { if (view->GetEditButton()) - view->GetEditButton()->Enable(FALSE); + view->GetEditButton()->Enable(false); if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(TRUE); + view->GetConfirmButton()->Enable(true); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(TRUE); + view->GetCancelButton()->Enable(true); if (view->GetValueText()) - view->GetValueText()->Enable(TRUE); - return TRUE; + view->GetValueText()->Enable(true); + return true; } // Constrained if (view->GetValueText()) - view->GetValueText()->Enable(FALSE); + view->GetValueText()->Enable(false); if (view->GetEditButton()) - view->GetEditButton()->Enable(TRUE); + view->GetEditButton()->Enable(true); if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(FALSE); + view->GetConfirmButton()->Enable(false); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(FALSE); - return TRUE; + view->GetCancelButton()->Enable(false); + return true; } bool wxStringListValidator::OnPrepareDetailControls( wxProperty *property, @@ -1205,8 +1205,8 @@ bool wxStringListValidator::OnPrepareDetailControls( wxProperty *property, { if (view->GetValueList()) { - view->ShowListBoxControl(TRUE); - view->GetValueList()->Enable(TRUE); + view->ShowListBoxControl(true); + view->GetValueList()->Enable(true); wxStringList::Node *node = m_strings->GetFirst(); while (node) { @@ -1217,23 +1217,23 @@ bool wxStringListValidator::OnPrepareDetailControls( wxProperty *property, wxChar *currentString = property->GetValue().StringValue(); view->GetValueList()->SetStringSelection(currentString); } - return TRUE; + return true; } bool wxStringListValidator::OnClearDetailControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!m_strings) { - return TRUE; + return true; } if (view->GetValueList()) { view->GetValueList()->Clear(); - view->ShowListBoxControl(FALSE); - view->GetValueList()->Enable(FALSE); + view->ShowListBoxControl(false); + view->GetValueList()->Enable(false); } - return TRUE; + return true; } // Called when the property is double clicked. Extra functionality can be provided, @@ -1243,9 +1243,9 @@ bool wxStringListValidator::OnDoubleClick( wxProperty *property, wxWindow *WXUNUSED(parentWindow) ) { if (!view->GetValueText()) - return FALSE; + return false; if (!m_strings) - return FALSE; + return false; wxStringList::Node *node = m_strings->GetFirst(); wxChar *currentString = property->GetValue().StringValue(); @@ -1263,11 +1263,11 @@ bool wxStringListValidator::OnDoubleClick( wxProperty *property, view->DisplayProperty(property); view->UpdatePropertyDisplayInList(property); view->OnPropertyChanged(property); - return TRUE; + return true; } else node = node->GetNext(); } - return TRUE; + return true; } /// @@ -1286,7 +1286,7 @@ wxFilenameListValidator::~wxFilenameListValidator() bool wxFilenameListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow)) { - return TRUE; + return true; } // Called when TICK is pressed or focus is lost or view wants to update @@ -1295,10 +1295,10 @@ bool wxFilenameListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPro bool wxFilenameListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!view->GetValueText()) - return FALSE; + return false; wxString value(view->GetValueText()->GetValue()); property->GetValue() = value ; - return TRUE; + return true; } // Called when TICK is pressed or focus is lost or view wants to update @@ -1307,10 +1307,10 @@ bool wxFilenameListValidator::OnRetrieveValue(wxProperty *property, wxPropertyLi bool wxFilenameListValidator::OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!view->GetValueText()) - return FALSE; + return false; wxString str(property->GetValue().GetStringRepresentation()); view->GetValueText()->SetValue(str); - return TRUE; + return true; } // Called when the property is double clicked. Extra functionality can be provided, @@ -1318,22 +1318,22 @@ bool wxFilenameListValidator::OnDisplayValue(wxProperty *property, wxPropertyLis bool wxFilenameListValidator::OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow) { if (!view->GetValueText()) - return FALSE; + return false; OnEdit(property, view, parentWindow); - return TRUE; + return true; } bool wxFilenameListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(TRUE); + view->GetConfirmButton()->Enable(true); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(TRUE); + view->GetCancelButton()->Enable(true); if (view->GetEditButton()) - view->GetEditButton()->Enable(TRUE); + view->GetEditButton()->Enable(true); if (view->GetValueText()) view->GetValueText()->Enable((GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == wxPROP_ALLOW_TEXT_EDITING); - return TRUE; + return true; } void wxFilenameListValidator::OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow) @@ -1374,7 +1374,7 @@ wxColourListValidator::~wxColourListValidator() bool wxColourListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow)) { - return TRUE; + return true; } // Called when TICK is pressed or focus is lost or view wants to update @@ -1383,11 +1383,11 @@ bool wxColourListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPrope bool wxColourListValidator::OnRetrieveValue(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!view->GetValueText()) - return FALSE; + return false; wxString value(view->GetValueText()->GetValue()); property->GetValue() = value ; - return TRUE; + return true; } // Called when TICK is pressed or focus is lost or view wants to update @@ -1396,10 +1396,10 @@ bool wxColourListValidator::OnRetrieveValue(wxProperty *property, wxPropertyList bool wxColourListValidator::OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!view->GetValueText()) - return FALSE; + return false; wxString str(property->GetValue().GetStringRepresentation()); view->GetValueText()->SetValue(str); - return TRUE; + return true; } // Called when the property is double clicked. Extra functionality can be provided, @@ -1407,22 +1407,22 @@ bool wxColourListValidator::OnDisplayValue(wxProperty *property, wxPropertyListV bool wxColourListValidator::OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow) { if (!view->GetValueText()) - return FALSE; + return false; OnEdit(property, view, parentWindow); - return TRUE; + return true; } bool wxColourListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(TRUE); + view->GetConfirmButton()->Enable(true); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(TRUE); + view->GetCancelButton()->Enable(true); if (view->GetEditButton()) - view->GetEditButton()->Enable(TRUE); + view->GetEditButton()->Enable(true); if (view->GetValueText()) view->GetValueText()->Enable((GetFlags() & wxPROP_ALLOW_TEXT_EDITING) == wxPROP_ALLOW_TEXT_EDITING); - return TRUE; + return true; } void wxColourListValidator::OnEdit(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow) @@ -1444,7 +1444,7 @@ void wxColourListValidator::OnEdit(wxProperty *property, wxPropertyListView *vie wxColour col(r,g,b); wxColourData data; - data.SetChooseFull(TRUE); + data.SetChooseFull(true); data.SetColour(col); for (int i = 0; i < 16; i++) @@ -1485,7 +1485,7 @@ wxListOfStringsListValidator::wxListOfStringsListValidator(long flags): bool wxListOfStringsListValidator::OnCheckValue(wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow)) { // No constraints for an arbitrary, user-editable list of strings. - return TRUE; + return true; } // Called when TICK is pressed or focus is lost or view wants to update @@ -1494,30 +1494,30 @@ bool wxListOfStringsListValidator::OnCheckValue(wxProperty *WXUNUSED(property), // In this case, the user cannot directly edit the string list. bool wxListOfStringsListValidator::OnRetrieveValue(wxProperty *WXUNUSED(property), wxPropertyListView *WXUNUSED(view), wxWindow *WXUNUSED(parentWindow)) { - return TRUE; + return true; } bool wxListOfStringsListValidator::OnDisplayValue(wxProperty *property, wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (!view->GetValueText()) - return FALSE; + return false; wxString str(property->GetValue().GetStringRepresentation()); view->GetValueText()->SetValue(str); - return TRUE; + return true; } bool wxListOfStringsListValidator::OnPrepareControls(wxProperty *WXUNUSED(property), wxPropertyListView *view, wxWindow *WXUNUSED(parentWindow)) { if (view->GetEditButton()) - view->GetEditButton()->Enable(TRUE); + view->GetEditButton()->Enable(true); if (view->GetValueText()) - view->GetValueText()->Enable(FALSE); + view->GetValueText()->Enable(false); if (view->GetConfirmButton()) - view->GetConfirmButton()->Enable(FALSE); + view->GetConfirmButton()->Enable(false); if (view->GetCancelButton()) - view->GetCancelButton()->Enable(FALSE); - return TRUE; + view->GetCancelButton()->Enable(false); + return true; } // Called when the property is double clicked. Extra functionality can be provided, @@ -1525,7 +1525,7 @@ bool wxListOfStringsListValidator::OnPrepareControls(wxProperty *WXUNUSED(proper bool wxListOfStringsListValidator::OnDoubleClick(wxProperty *property, wxPropertyListView *view, wxWindow *parentWindow) { OnEdit(property, view, parentWindow); - return TRUE; + return true; } void wxListOfStringsListValidator::OnEdit( wxProperty *property, @@ -1573,12 +1573,12 @@ class wxPropertyStringListEditorDialog: public wxDialog wxPropertyStringListEditorDialog(wxWindow *parent, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long windowStyle = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("stringEditorDialogBox")): - wxDialog(parent, -1, title, pos, size, windowStyle, name) + wxDialog(parent, wxID_ANY, title, pos, size, windowStyle, name) { m_stringList = NULL; m_stringText = NULL; m_listBox = NULL; - sm_dialogCancelled = FALSE; + sm_dialogCancelled = false; m_currentSelection = -1; } ~wxPropertyStringListEditorDialog(void) {} @@ -1633,7 +1633,7 @@ class wxPropertyStringListEditorText: public wxTextCtrl } }; -bool wxPropertyStringListEditorDialog::sm_dialogCancelled = FALSE; +bool wxPropertyStringListEditorDialog::sm_dialogCancelled = false; // Edit the string list. bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList *stringList, const wxChar *title) @@ -1648,64 +1648,36 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList dialog->m_stringList = stringList; dialog->m_listBox = new wxListBox(dialog, wxID_PROP_SL_STRINGS, - wxPoint(-1, -1), wxSize(-1, -1), 0, NULL, wxLB_SINGLE); + wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_SINGLE); dialog->m_stringText = new wxPropertyStringListEditorText(dialog, wxID_PROP_SL_TEXT, wxT(""), wxPoint(5, 240), - wxSize(300, -1), wxPROCESS_ENTER); - dialog->m_stringText->Enable(FALSE); + wxSize(300, wxDefaultSize.y), wxPROCESS_ENTER); + dialog->m_stringText->Enable(false); - wxButton *addButton = new wxButton(dialog, wxID_PROP_SL_ADD, wxT("Add"), wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight)); - wxButton *deleteButton = new wxButton(dialog, wxID_PROP_SL_DELETE, wxT("Delete"), wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight)); - wxButton *cancelButton = new wxButton(dialog, wxID_CANCEL, wxT("Cancel"), wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight)); - wxButton *okButton = new wxButton(dialog, wxID_OK, wxT("OK"), wxPoint(-1, -1), wxSize(largeButtonWidth, largeButtonHeight)); + wxButton *addButton = new wxButton(dialog, wxID_PROP_SL_ADD, wxT("Add"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight)); + wxButton *deleteButton = new wxButton(dialog, wxID_PROP_SL_DELETE, wxT("Delete"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight)); + wxButton *cancelButton = new wxButton(dialog, wxID_CANCEL, wxT("Cancel"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight)); + wxButton *okButton = new wxButton(dialog, wxID_OK, wxT("OK"), wxDefaultPosition, wxSize(largeButtonWidth, largeButtonHeight)); #ifndef __WXGTK__ okButton->SetDefault(); #endif - wxLayoutConstraints *c = new wxLayoutConstraints; - - c->top.SameAs (dialog, wxTop, 2); - c->left.SameAs (dialog, wxLeft, 2); - c->right.SameAs (dialog, wxRight, 2); - c->bottom.SameAs (dialog->m_stringText, wxTop, 2); - dialog->m_listBox->SetConstraints(c); - - c = new wxLayoutConstraints; - c->left.SameAs (dialog, wxLeft, 2); - c->right.SameAs (dialog, wxRight, 2); - c->bottom.SameAs (addButton, wxTop, 2); - c->height.AsIs(); - dialog->m_stringText->SetConstraints(c); - - c = new wxLayoutConstraints; - c->bottom.SameAs (dialog, wxBottom, 2); - c->left.SameAs (dialog, wxLeft, 2); - c->width.AsIs(); - c->height.AsIs(); - addButton->SetConstraints(c); - - c = new wxLayoutConstraints; - c->bottom.SameAs (dialog, wxBottom, 2); - c->left.SameAs (addButton, wxRight, 2); - c->width.AsIs(); - c->height.AsIs(); - deleteButton->SetConstraints(c); - - c = new wxLayoutConstraints; - c->bottom.SameAs (dialog, wxBottom, 2); - c->right.SameAs (dialog, wxRight, 2); - c->width.AsIs(); - c->height.AsIs(); - cancelButton->SetConstraints(c); - - c = new wxLayoutConstraints; - c->bottom.SameAs (dialog, wxBottom, 2); - c->right.SameAs (cancelButton, wxLeft, 2); - c->width.AsIs(); - c->height.AsIs(); - okButton->SetConstraints(c); + wxBoxSizer *m_bottom_sizer = new wxBoxSizer( wxHORIZONTAL ); + m_bottom_sizer->Add(addButton, 0, wxALL | wxALIGN_LEFT, 2 ); + m_bottom_sizer->Add(deleteButton, 0, wxALL | wxALIGN_LEFT, 2 ); + m_bottom_sizer->Add(1, 1, 1, wxEXPAND | wxALL); + m_bottom_sizer->Add(cancelButton, 0, wxALL | wxALIGN_RIGHT, 2 ); + m_bottom_sizer->Add(okButton, 0, wxALL | wxALIGN_RIGHT, 2 ); + + wxBoxSizer *m_sizer = new wxBoxSizer( wxVERTICAL ); + m_sizer->Add(dialog->m_listBox, 1, wxEXPAND | wxALL, 2 ); + m_sizer->Add(dialog->m_stringText, 0, wxEXPAND | wxALL, 2 ); + m_sizer->Add(m_bottom_sizer, 0, wxEXPAND | wxALL , 0 ); + + dialog->SetSizer( m_sizer ); + m_sizer->SetSizeHints( dialog ); wxStringList::Node *node = stringList->GetFirst(); while (node) @@ -1722,9 +1694,9 @@ bool wxListOfStringsListValidator::EditStringList(wxWindow *parent, wxStringList dialog->Centre(wxBOTH); wxEndBusyCursor(); if (dialog->ShowModal() == wxID_CANCEL) - return FALSE; + return false; else - return TRUE; + return true; } /* @@ -1777,15 +1749,15 @@ void wxPropertyStringListEditorDialog::OnOK(wxCommandEvent& WXUNUSED(event)) { SaveCurrentSelection(); EndModal(wxID_OK); - // Close(TRUE); + // Close(true); this->Destroy(); } void wxPropertyStringListEditorDialog::OnCancel(wxCommandEvent& WXUNUSED(event)) { - sm_dialogCancelled = TRUE; + sm_dialogCancelled = true; EndModal(wxID_CANCEL); -// Close(TRUE); +// Close(true); this->Destroy(); } @@ -1832,7 +1804,7 @@ void wxPropertyStringListEditorDialog::ShowCurrentSelection() wxNode *node = (wxNode *)m_listBox->wxListBox::GetClientData(m_currentSelection); wxChar *txt = (wxChar *)node->GetData(); m_stringText->SetValue(txt); - m_stringText->Enable(TRUE); + m_stringText->Enable(true); } -- 2.45.2