X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d8812c6e0e780fb2dae99bc352c5061f58793e14..beb2638a997914bd12c55e81589adebd90af9ed2:/src/propgrid/props.cpp diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index 336c55fdc5..3558201abc 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -632,7 +632,7 @@ wxString wxFloatProperty::ValueToString( wxVariant& value, value, m_precision, !(argFlags & wxPG_FULL_VALUE), - (wxString*) NULL); + NULL); } return text; } @@ -963,7 +963,6 @@ wxEnumProperty::~wxEnumProperty () } int wxEnumProperty::ms_nextIndex = -2; -int wxEnumProperty::ms_prevIndex = -1; void wxEnumProperty::OnSetValue() { @@ -1054,7 +1053,7 @@ bool wxEnumProperty::ValueFromString_( wxVariant& value, const wxString& text, i setAsNextIndex = -1; value = text; } - else if ( m_index != useIndex ) + else if ( useIndex != GetIndex() ) { if ( useIndex != -1 ) { @@ -1095,7 +1094,7 @@ bool wxEnumProperty::ValueFromInt_( wxVariant& variant, int intVal, int argFlags } else { - if ( m_index != intVal ) + if ( intVal != GetIndex() ) { ms_nextIndex = intVal; } @@ -1118,21 +1117,23 @@ void wxEnumProperty::OnValidationFailure( wxVariant& WXUNUSED(pendingValue) ) { // Revert index - m_index = ms_prevIndex; ResetNextIndex(); } void wxEnumProperty::SetIndex( int index ) { - ms_prevIndex = m_index; ms_nextIndex = -2; m_index = index; } int wxEnumProperty::GetIndex() const { + if ( m_value.IsNull() ) + return -1; + if ( ms_nextIndex != -2 ) return ms_nextIndex; + return m_index; } @@ -1186,8 +1187,6 @@ WX_PG_IMPLEMENT_PROPERTY_CLASS_PLAIN(wxFlagsProperty,long,TextCtrl) void wxFlagsProperty::Init() { - SetParentalType(wxPG_PROP_AGGREGATE); - long value = m_value; // @@ -1247,7 +1246,7 @@ void wxFlagsProperty::Init() { boolProp = new wxBoolProperty( label, label, child_val ); } - AddChild(boolProp); + AddPrivateChild(boolProp); } m_oldChoicesData = m_choices.GetDataPtr(); @@ -1262,7 +1261,7 @@ void wxFlagsProperty::Init() wxFlagsProperty::wxFlagsProperty( const wxString& label, const wxString& name, const wxChar** labels, const long* values, long value ) : wxPGProperty(label,name) { - m_oldChoicesData = (wxPGChoicesData*) NULL; + m_oldChoicesData = NULL; if ( labels ) { @@ -1282,7 +1281,7 @@ wxFlagsProperty::wxFlagsProperty( const wxString& label, const wxString& name, const wxArrayString& labels, const wxArrayInt& values, int value ) : wxPGProperty(label,name) { - m_oldChoicesData = (wxPGChoicesData*) NULL; + m_oldChoicesData = NULL; if ( &labels && labels.size() ) { @@ -1302,7 +1301,7 @@ wxFlagsProperty::wxFlagsProperty( const wxString& label, const wxString& name, wxPGChoices& choices, long value ) : wxPGProperty(label,name) { - m_oldChoicesData = (wxPGChoicesData*) NULL; + m_oldChoicesData = NULL; if ( choices.IsOk() ) { @@ -2128,7 +2127,7 @@ bool wxArrayEditorDialog::Create( wxWindow *parent, // Manipulator buttons wxBoxSizer* colsizer = new wxBoxSizer( wxVERTICAL ); - m_butCustom = (wxButton*) NULL; + m_butCustom = NULL; if ( m_custBtText ) { m_butCustom = new wxButton(this,28,::wxGetTranslation(m_custBtText)); @@ -2338,7 +2337,7 @@ wxPGArrayStringEditorDialog::wxPGArrayStringEditorDialog() void wxPGArrayStringEditorDialog::Init() { - m_pCallingClass = (wxArrayStringProperty*) NULL; + m_pCallingClass = NULL; } void wxPGArrayStringEditorDialog::OnCustomEditClick(wxCommandEvent& )