- // make sure that 'Render' can draw only in the allowed area:
- dataViewCustomRendererPtr->GetDC()->SetClippingRegion(content.left,content.top,content.right-content.left+1,content.bottom-content.top+1);
- (void) (dataViewCustomRendererPtr->Render(wxRect(static_cast<int>(rectangle->left),static_cast<int>(rectangle->top),
- static_cast<int>(1+rectangle->right-rectangle->left),static_cast<int>(1+rectangle->bottom-rectangle->top)),
- dataViewCustomRendererPtr->GetDC(),((state == kDataBrowserItemIsSelected) ? wxDATAVIEW_CELL_SELECTED : 0)));
- dataViewCustomRendererPtr->GetDC()->DestroyClippingRegion(); // probably not necessary
+ wxDC *dc = dataViewCustomRendererPtr->GetDC();
+
+ wxRect cellrect( static_cast<int>(rectangle->left),
+ static_cast<int>(rectangle->top+2),
+ static_cast<int>(1+rectangle->right-rectangle->left),
+ static_cast<int>(rectangle->bottom-rectangle->top) );
+
+ bool is_active = IsControlActive( this->m_controlRef );
+ if (state == kDataBrowserItemIsSelected)
+ {
+
+ wxColour col( wxMacCreateCGColorFromHITheme( (is_active) ?
+ kThemeBrushAlternatePrimaryHighlightColor
+ : kThemeBrushSecondaryHighlightColor ) );
+
+ wxRect rect = cellrect;
+ Rect itemrect;
+ GetDataBrowserItemPartBounds( this->m_controlRef, itemID, propertyID,
+ kDataBrowserPropertyEnclosingPart, &itemrect );
+ rect.x = itemrect.left;
+ rect.width = itemrect.right-itemrect.left+1;
+
+ wxBrush selBrush( col );
+ wxPen oldpen( dc->GetPen() );
+ wxBrush oldbrush( dc->GetBrush() );
+ dc->SetPen( *wxTRANSPARENT_PEN );
+ dc->SetBrush( selBrush );
+ dc->DrawRectangle(rect);
+ dc->SetBrush( oldbrush );
+ dc->SetPen( oldpen );
+ }
+
+ wxDataViewModel *model = dataViewCtrlPtr->GetModel();
+ if ((columnIndex == 0) || !model->IsContainer(dataitem) || model->HasContainerColumns(dataitem))
+ {
+ // make sure that 'Render' can draw only in the allowed area:
+ dc->SetClippingRegion(content.left,content.top,content.right-content.left+1,content.bottom-content.top+1);
+ (void) (dataViewCustomRendererPtr->Render( cellrect, dc,
+ ((state == kDataBrowserItemIsSelected) ? wxDATAVIEW_CELL_SELECTED : 0)));
+ dc->DestroyClippingRegion(); // probably not necessary
+ }
+
+ dataViewCustomRendererPtr->SetDC(NULL);