diff --git a/include/wx/generic/grideditors.h b/include/wx/generic/grideditors.h index c45106d3e8..b5986e4222 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); +#if wxUSE_VALIDATORS virtual void SetValidator(const wxValidator& validator); +#endif virtual wxGridCellEditor *Clone() const; @@ -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 7e6628c825..7b77965d4b 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 033419f0b7..e0a6164b58 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)