X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fbbde24964a911000cc53b72def5e7aed14e07c9..65702d2fe95b8ca16a9b74f53832780bf1c81970:/src/propgrid/advprops.cpp?ds=sidebyside diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index c8d50cd201..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); } @@ -1258,19 +1259,19 @@ bool wxSystemColourProperty::OnEvent( wxPropertyGrid* propgrid, } else if ( event.GetEventType() == wxEVT_COMMAND_COMBOBOX_SELECTED ) { - // Must override index detection since at this point GetIndex() - // will return old value. - wxOwnerDrawnComboBox* cb = - static_cast(propgrid->GetEditorControl()); + // Must override index detection since at this point GetIndex() + // will return old value. + wxOwnerDrawnComboBox* cb = + static_cast(propgrid->GetEditorControl()); - if ( cb ) - { - int index = cb->GetSelection(); + if ( cb ) + { + int index = cb->GetSelection(); - if ( index == GetCustomColourIndex() && - !(m_flags & wxPG_PROP_HIDE_CUSTOM_COLOUR) ) - askColour = true; - } + if ( index == GetCustomColourIndex() && + !(m_flags & wxPG_PROP_HIDE_CUSTOM_COLOUR) ) + askColour = true; + } } if ( askColour && !propgrid->WasValueChangedInEvent() )