X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4bff335abeed922f191fe4c6bf78e4bce63995b3..5c7b506103cfc078a821860766e31c47d595e07f:/src/mac/carbon/listctrl_mac.cpp diff --git a/src/mac/carbon/listctrl_mac.cpp b/src/mac/carbon/listctrl_mac.cpp index ed4e0dbc2a..e307203d98 100644 --- a/src/mac/carbon/listctrl_mac.cpp +++ b/src/mac/carbon/listctrl_mac.cpp @@ -30,6 +30,7 @@ #ifndef WX_PRECOMP #include "wx/intl.h" + #include "wx/settings.h" #endif #include "wx/mac/uma.h" @@ -979,7 +980,7 @@ bool wxListCtrl::SetColumn(int col, wxListItem& item) { wxFontEncoding enc; if ( m_font.Ok() ) - enc = m_font.GetEncoding(); + enc = GetFont().GetEncoding(); else enc = wxLocale::GetSystemEncoding(); wxCFStringRef cfTitle; @@ -2712,9 +2713,8 @@ void wxMacDataBrowserListCtrlControl::DrawItem( if (bgColor == wxNullColour) bgColor = listBgColor; - wxFont listFont = list->GetFont(); - if (font == wxNullFont) - font = listFont; + if (!font.Ok()) + font = list->GetFont(); wxCFStringRef cfString( text, wxLocale::GetSystemEncoding() ); @@ -2767,9 +2767,9 @@ void wxMacDataBrowserListCtrlControl::DrawItem( } CGContextSaveGState(context); - CGContextSetRGBFillColor(context, (float)backgroundColor.red / (float)USHRT_MAX, - (float)backgroundColor.green / (float)USHRT_MAX, - (float)backgroundColor.blue / (float)USHRT_MAX, 1.0); + CGContextSetRGBFillColor(context, (CGFloat)backgroundColor.red / (CGFloat)USHRT_MAX, + (CGFloat)backgroundColor.green / (CGFloat)USHRT_MAX, + (CGFloat)backgroundColor.blue / (CGFloat)USHRT_MAX, (CGFloat) 1.0); CGContextFillRect(context, enclosingCGRect); CGContextRestoreGState(context); @@ -2787,9 +2787,9 @@ void wxMacDataBrowserListCtrlControl::DrawItem( bgColor.GetRGBColor(&backgroundColor); CGContextSaveGState(context); - CGContextSetRGBFillColor(context, (float)backgroundColor.red / (float)USHRT_MAX, - (float)backgroundColor.green / (float)USHRT_MAX, - (float)backgroundColor.blue / (float)USHRT_MAX, 1.0); + CGContextSetRGBFillColor(context, (CGFloat)backgroundColor.red / (CGFloat)USHRT_MAX, + (CGFloat)backgroundColor.green / (CGFloat)USHRT_MAX, + (CGFloat)backgroundColor.blue / (CGFloat)USHRT_MAX, (CGFloat) 1.0); CGContextFillRect(context, enclosingCGRect); CGContextRestoreGState(context); @@ -2840,8 +2840,7 @@ void wxMacDataBrowserListCtrlControl::DrawItem( if (font.Ok()) { - if (font.GetFamily() != wxFONTFAMILY_DEFAULT) - info.fontID = font.MacGetThemeFontID(); + info.fontID = font.MacGetThemeFontID(); ::TextSize( (short)(font.MacGetFontSize()) ) ; ::TextFace( font.MacGetFontStyle() ) ; @@ -2872,9 +2871,9 @@ void wxMacDataBrowserListCtrlControl::DrawItem( info.truncationMaxLines = 1; CGContextSaveGState(context); - CGContextSetRGBFillColor (context, (float)labelColor.red / (float)USHRT_MAX, - (float)labelColor.green / (float)USHRT_MAX, - (float)labelColor.blue / (float)USHRT_MAX, 1.0); + CGContextSetRGBFillColor (context, (CGFloat)labelColor.red / (CGFloat)USHRT_MAX, + (CGFloat)labelColor.green / (CGFloat)USHRT_MAX, + (CGFloat)labelColor.blue / (CGFloat)USHRT_MAX, (CGFloat) 1.0); HIThemeDrawTextBox(cfString, &textCGRect, &info, context, kHIThemeOrientationNormal); @@ -2897,7 +2896,7 @@ OSStatus wxMacDataBrowserListCtrlControl::GetSetItemData(DataBrowserItemID itemI OSStatus err = errDataBrowserPropertyNotSupported; wxListCtrl* list = wxDynamicCast( GetPeer() , wxListCtrl ); - wxMacListCtrlItem* lcItem; + wxMacListCtrlItem* lcItem = NULL; if (listColumn >= 0) {