]> git.saurik.com Git - wxWidgets.git/blobdiff - src/propgrid/editors.cpp
Don't override msw.remap system option value in wxToolbook.
[wxWidgets.git] / src / propgrid / editors.cpp
index 12fa961484ed264398814d1d9d237ccd22cf68fd..9f6d5a5a3d892ea670959b8b90426824b65e2b84 100644 (file)
@@ -558,7 +558,7 @@ public:
 
     wxPropertyGrid* GetGrid() const
     {
-        wxPropertyGrid* pg = wxDynamicCast(GetParent()->GetParent(),
+        wxPropertyGrid* pg = wxDynamicCast(GetParent(),
                                            wxPropertyGrid);
         wxASSERT(pg);
         return pg;
@@ -682,6 +682,9 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
     if ( pDc )
         pDc->SetBrush(*wxWHITE_BRUSH);
 
+    wxPGCellRenderer* renderer = NULL;
+    const wxPGChoiceEntry* cell = NULL;
+
     if ( rect.x >= 0 )
     {
         //
@@ -750,11 +753,13 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
 
             if ( choices.IsOk() && item >= 0 && comValIndex < 0 )
             {
-                const wxPGChoiceEntry& cell = choices.Item(item);
-                wxPGCellRenderer* renderer = wxPGGlobalVars->m_defaultRenderer;
-                int imageOffset = renderer->PreDrawCell( dc, rect, cell, renderFlags );
+                cell = &choices.Item(item);
+                renderer = wxPGGlobalVars->m_defaultRenderer;
+                int imageOffset = renderer->PreDrawCell(dc, rect, *cell,
+                                                        renderFlags );
                 if ( imageOffset )
-                    imageOffset += wxCC_CUSTOM_IMAGE_MARGIN1 + wxCC_CUSTOM_IMAGE_MARGIN2;
+                    imageOffset += wxCC_CUSTOM_IMAGE_MARGIN1 +
+                                   wxCC_CUSTOM_IMAGE_MARGIN2;
                 pt.x += imageOffset;
             }
         }
@@ -768,6 +773,9 @@ void wxPropertyGrid::OnComboItemPaint( const wxPGComboBox* pCb,
         pt.x += 1;
 
         dc.DrawText( text, pt.x + wxPG_XBEFORETEXT, pt.y );
+
+        if ( renderer )
+            renderer->PostDrawCell(dc, this, *cell, renderFlags);
     }
     else
     {
@@ -1377,7 +1385,7 @@ void wxSimpleCheckBox::SetValue( int value )
 
     wxCommandEvent evt(wxEVT_COMMAND_CHECKBOX_CLICKED,GetParent()->GetId());
 
-    wxPropertyGrid* propGrid = (wxPropertyGrid*) GetParent()->GetParent();
+    wxPropertyGrid* propGrid = (wxPropertyGrid*) GetParent();
     wxASSERT( propGrid->IsKindOf(CLASSINFO(wxPropertyGrid)) );
     propGrid->HandleCustomEditorEvent(evt);
 }