From: Paul Cornett Date: Wed, 23 Sep 2009 16:32:32 +0000 (+0000) Subject: build fixes for wxUSE_VALIDATORS==0 X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/b4bde7a74bac66004e392e9f3b24235efbde8d82 build fixes for wxUSE_VALIDATORS==0 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62042 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/validate.h b/include/wx/validate.h index 55005f9d87..3cd0fdc435 100644 --- a/include/wx/validate.h +++ b/include/wx/validate.h @@ -87,7 +87,7 @@ extern WXDLLIMPEXP_DATA_CORE(const wxValidator) wxDefaultValidator; // a wxValidator parameter to avoid using "#if wxUSE_VALIDATORS" // everywhere class WXDLLIMPEXP_FWD_CORE wxValidator; - #define wxDefaultValidator (*(NULL)) + #define wxDefaultValidator (*reinterpret_cast(NULL)) // this macro allows to avoid warnings about unused parameters when // wxUSE_VALIDATORS == 0 diff --git a/src/msw/bmpbuttn.cpp b/src/msw/bmpbuttn.cpp index a77672cbfb..aea2db8f61 100644 --- a/src/msw/bmpbuttn.cpp +++ b/src/msw/bmpbuttn.cpp @@ -127,7 +127,7 @@ bool wxBitmapButton::Create(wxWindow *parent, const wxBitmap& bitmap, const wxPoint& pos, const wxSize& size, long style, - const wxValidator& wxVALIDATOR_PARAM(validator), + const wxValidator& validator, const wxString& name) { if ( !wxBitmapButtonBase::Create(parent, id, pos, size, style, diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index c4444d6de3..bab9d937e4 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -276,11 +276,12 @@ wxPGWindowList wxPGSpinCtrlEditor::CreateControls( wxPropertyGrid* propgrid, wxP wnd2->SetRange( INT_MIN, INT_MAX ); wnd2->SetValue( 0 ); + wxWindow* wnd1 = wxPGTextCtrlEditor::CreateControls(propgrid, property, pos, tcSz).m_primary; +#if wxUSE_VALIDATORS // Let's add validator to make sure only numbers can be entered wxTextValidator validator(wxFILTER_NUMERIC, &m_tempString); - - wxTextCtrl* wnd1 = (wxTextCtrl*) wxPGTextCtrlEditor::CreateControls( propgrid, property, pos, tcSz ).m_primary; wnd1->SetValidator(validator); +#endif return wxPGWindowList(wnd1, wnd2); } diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index fde73ced09..77ecc238ee 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -2120,12 +2120,14 @@ bool wxArrayEditorDialog::Create( wxWindow *parent, wxBoxSizer* rowsizer = new wxBoxSizer( wxHORIZONTAL ); m_edValue = new wxTextCtrl(this,21,wxEmptyString, wxDefaultPosition,wxDefaultSize,wxTE_PROCESS_ENTER); +#if wxUSE_VALIDATORS wxValidator* validator = GetTextCtrlValidator(); if ( validator ) { m_edValue->SetValidator( *validator ); delete validator; } +#endif rowsizer->Add( m_edValue, 1, wxALIGN_LEFT|wxALIGN_CENTRE_VERTICAL|wxALL, spacing );