From c6f8d543245af3e1849ed7f05d5707e23c4f9b1e Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Fri, 11 Apr 2014 15:53:41 +0000 Subject: [PATCH] build fix for wxUSE_VALIDATORS==0 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76313 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/generic/grideditors.h | 4 ++++ src/generic/grideditors.cpp | 6 ++++++ src/propgrid/propgrid.cpp | 1 + src/richtext/richtextsizepage.cpp | 2 ++ 4 files changed, 13 insertions(+) diff --git a/include/wx/generic/grideditors.h b/include/wx/generic/grideditors.h index ebe7b8d7db..50bcf620d7 100644 --- a/include/wx/generic/grideditors.h +++ b/include/wx/generic/grideditors.h @@ -76,7 +76,9 @@ public: // parameters string format is "max_width" virtual void SetParameters(const wxString& params) wxOVERRIDE; +#if wxUSE_VALIDATORS virtual void SetValidator(const wxValidator& validator); +#endif virtual wxGridCellEditor *Clone() const wxOVERRIDE; @@ -94,7 +96,9 @@ protected: private: size_t m_maxChars; // max number of chars allowed +#if wxUSE_VALIDATORS wxScopedPtr m_validator; +#endif wxString m_value; wxDECLARE_NO_COPY_CLASS(wxGridCellTextEditor); diff --git a/src/generic/grideditors.cpp b/src/generic/grideditors.cpp index aef0f36453..4cc103ca73 100644 --- a/src/generic/grideditors.cpp +++ b/src/generic/grideditors.cpp @@ -415,11 +415,13 @@ void wxGridCellTextEditor::DoCreate(wxWindow* parent, { Text()->SetMaxLength(m_maxChars); } +#if wxUSE_VALIDATORS // validate text in textctrl, if validator is set if ( m_validator ) { Text()->SetValidator(*m_validator); } +#endif wxGridCellEditor::Create(parent, id, evtHandler); } @@ -638,18 +640,22 @@ void wxGridCellTextEditor::SetParameters(const wxString& params) } } +#if wxUSE_VALIDATORS void wxGridCellTextEditor::SetValidator(const wxValidator& validator) { m_validator.reset(static_cast(validator.Clone())); } +#endif wxGridCellEditor *wxGridCellTextEditor::Clone() const { wxGridCellTextEditor* editor = new wxGridCellTextEditor(m_maxChars); +#if wxUSE_VALIDATORS if ( m_validator ) { editor->SetValidator(*m_validator); } +#endif return editor; } diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index aa59c8c398..dc1e1b2837 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -45,6 +45,7 @@ #include "wx/statusbr.h" #include "wx/intl.h" #include "wx/frame.h" + #include "wx/textctrl.h" #endif diff --git a/src/richtext/richtextsizepage.cpp b/src/richtext/richtextsizepage.cpp index ecd1937151..6207f921ed 100644 --- a/src/richtext/richtextsizepage.cpp +++ b/src/richtext/richtextsizepage.cpp @@ -684,8 +684,10 @@ void wxRichTextSizePage::CreateControls() itemButton96->SetToolTip(_("Moves the object to the next paragraph.")); m_moveObjectSizer->Add(itemButton96, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5); +#if wxUSE_VALIDATORS // Set validators m_positionModeCtrl->SetValidator( wxGenericValidator(& m_positionMode) ); +#endif ////@end wxRichTextSizePage content construction if (!sm_enablePositionAndSizeCheckboxes)