From defeae282fad5fa8887d05d2f27cd8a4668491a5 Mon Sep 17 00:00:00 2001 From: Kevin Ollivier Date: Thu, 28 Dec 2006 17:50:53 +0000 Subject: [PATCH] Fixing inactive state drawing, and removing warning. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44071 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/mac/carbon/listctrl_mac.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/mac/carbon/listctrl_mac.cpp b/src/mac/carbon/listctrl_mac.cpp index 6d7f881fd5..4054da540d 100644 --- a/src/mac/carbon/listctrl_mac.cpp +++ b/src/mac/carbon/listctrl_mac.cpp @@ -1946,7 +1946,6 @@ long wxListCtrl::InsertItem(wxListItem& info) info.m_itemId = count; m_dbImpl->MacInsertItem(info.m_itemId, &info ); - wxMacDataItem* dataItem = m_dbImpl->GetItemFromLine(info.m_itemId); wxListEvent event( wxEVT_COMMAND_LIST_INSERT_ITEM, GetId() ); event.SetEventObject( this ); @@ -2622,10 +2621,17 @@ void wxMacDataBrowserListCtrlControl::DrawItem( { GetThemeDrawingState(&savedState); - - GetThemeBrushAsColor(kThemeBrushAlternatePrimaryHighlightColor, 32, true, &backgroundColor); - GetThemeTextColor(kThemeTextColorWhite, gdDepth, colorDevice, &labelColor); - + + if (active) + { + GetThemeBrushAsColor(kThemeBrushAlternatePrimaryHighlightColor, 32, true, &backgroundColor); + GetThemeTextColor(kThemeTextColorWhite, gdDepth, colorDevice, &labelColor); + } + else + { + GetThemeBrushAsColor(kThemeBrushSecondaryHighlightColor, 32, true, &backgroundColor); + GetThemeTextColor(kThemeTextColorBlack, gdDepth, colorDevice, &labelColor); + } CGContextSaveGState(context); CGContextSetRGBFillColor(context, (float)backgroundColor.red / (float)USHRT_MAX, @@ -2642,7 +2648,7 @@ void wxMacDataBrowserListCtrlControl::DrawItem( labelColor = MAC_WXCOLORREF( color.GetPixel() ); else if (list->GetTextColour().Ok()) labelColor = MAC_WXCOLORREF( list->GetTextColour().GetPixel() ); - + if (bgColor.Ok()) { backgroundColor = MAC_WXCOLORREF( bgColor.GetPixel() ); @@ -3175,3 +3181,4 @@ void wxMacListCtrlItem::SetColumnInfo( unsigned int column, wxListItem* item ) } #endif // wxUSE_LISTCTRL +