diff --git a/src/propgrid/advprops.cpp b/src/propgrid/advprops.cpp index 51c39792fb..e4eef91713 100644 --- a/src/propgrid/advprops.cpp +++ b/src/propgrid/advprops.cpp @@ -1683,13 +1683,15 @@ static const long gs_cp_es_syscursors_values[NUM_CURSORS] = { IMPLEMENT_DYNAMIC_CLASS(wxCursorProperty, wxEnumProperty) +static wxPGChoices gs_wxCursorProperty_choicesCache; + wxCursorProperty::wxCursorProperty( const wxString& label, const wxString& name, int value ) : wxEnumProperty( label, name, gs_cp_es_syscursors_labels, gs_cp_es_syscursors_values, - NULL, + &gs_wxCursorProperty_choicesCache, value ) { m_flags |= wxPG_PROP_STATIC_CHOICES; // Cursor selection cannot be changed. diff --git a/src/propgrid/props.cpp b/src/propgrid/props.cpp index bad0f83724..8ca54af69f 100644 --- a/src/propgrid/props.cpp +++ b/src/propgrid/props.cpp @@ -1130,9 +1130,10 @@ wxEnumProperty::wxEnumProperty( const wxString& label, const wxString& name, } else { - for ( ; untranslatedLabels; untranslatedLabels++, values++ ) + for ( int i = 0; *untranslatedLabels; untranslatedLabels++ ) { - m_choices.Add(wxGetTranslation(*untranslatedLabels), *values); + const long val = values ? *values++ : i++; + m_choices.Add(wxGetTranslation(*untranslatedLabels), val); } if ( GetItemCount() )