From 0b7f1e7e91bd30b44a8b508d1f00fdd3fd849864 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 9 Feb 2020 20:38:07 +0100 Subject: [PATCH] Always show label of unspecified value item while drawing popup menu The label of "unspecified value" shouldn't be displayed in the edit field but it should always be shown on the popup menu list. --- src/propgrid/editors.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index b2fec5f475..08649e66fd 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -719,11 +719,10 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb, int comValIndex = -1; const int choiceCount = choices.IsOk()? choices.GetCount(): 0; - if ( item >= choiceCount && p->GetDisplayedCommonValueCount() > 0 ) { comValIndex = item - choiceCount; - if ( !p->IsValueUnspecified() ) + if ( !p->IsValueUnspecified() || !(flags & wxODCB_PAINTING_CONTROL) ) { const wxPGCommonValue* cv = GetCommonValue(comValIndex); text = cv->GetLabel(); @@ -747,7 +746,7 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb, const wxBitmap* itemBitmap = NULL; - if ( choices.IsOk() && choices.Item(item).GetBitmap().IsOk() && comValIndex == -1 ) + if ( comValIndex == -1 && choices.IsOk() && choices.Item(item).GetBitmap().IsOk() ) itemBitmap = &choices.Item(item).GetBitmap(); //