Fix drawing custom colours for wxEnumProperty choice items in wxPG.

In order to draw choice items with custom colours there is necessary to merge custom cell object (wxPGCell) associated with individual item with default cell object (in wxPGProperty::GetDisplayInfo).
wxPGProperty::GetDisplayInfo function should return customized cell object instead of returning pointer to the default cell object only.

Closes #16509

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77505 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Artur Wieczorek
2014-08-29 21:17:16 +00:00
parent 0f60be60a2
commit 7e859ec6c9
4 changed files with 58 additions and 22 deletions

View File

@@ -798,9 +798,8 @@ int wxPropertyGridPageState::GetColumnFitWidth(wxClientDC& dc,
wxPGProperty* p = pwc->Item(i);
if ( !p->IsCategory() )
{
const wxPGCell* cell = NULL;
wxString text;
p->GetDisplayInfo(col, -1, 0, &text, &cell);
p->GetDisplayInfo(col, -1, 0, &text, (wxPGCell*)NULL);
dc.GetTextExtent(text, &w, &h);
if ( col == 0 )
w += ( ((int)p->m_depth-1) * pg->m_subgroup_extramargin );
@@ -834,9 +833,8 @@ int wxPropertyGridPageState::GetColumnFullWidth( wxClientDC &dc, wxPGProperty *p
if ( p->IsCategory() )
return 0;
const wxPGCell* cell = NULL;
wxString text;
p->GetDisplayInfo(col, -1, 0, &text, &cell);
p->GetDisplayInfo(col, -1, 0, &text, (wxPGCell*)NULL);
int w = dc.GetTextExtent(text).x;
if ( col == 0 )