X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e40298d54ecd5b109222a7c60aa2ef084a304d69..3931863650d4f4d126cac1992323df5fc39833dd:/src/mac/carbon/checklst.cpp diff --git a/src/mac/carbon/checklst.cpp b/src/mac/carbon/checklst.cpp index c50773b137..1e88ce34f6 100644 --- a/src/mac/carbon/checklst.cpp +++ b/src/mac/carbon/checklst.cpp @@ -102,13 +102,12 @@ static pascal void wxMacCheckListDefinition( short message, Boolean isSelected, ClipRect( drawRect ); EraseRect( drawRect ); - wxFontRefData * font = (wxFontRefData*) (list->GetFont().GetRefData()) ; - - if ( font ) + const wxFont& font = list->GetFont(); + if ( font.Ok() ) { - ::TextFont( font->m_macFontNum ) ; - ::TextSize( font->m_macFontSize) ; - ::TextFace( font->m_macFontStyle ) ; + ::TextFont( font.GetMacFontNum() ) ; + ::TextSize( font.GetMacFontSize()) ; + ::TextFace( font.GetMacFontStyle() ) ; } ThemeButtonDrawInfo info ; @@ -183,6 +182,10 @@ bool wxCheckListBox::Create(wxWindow *parent, const wxValidator& validator, const wxString &name) { + if ( !wxCheckListBoxBase::Create(parent, id, pos, size, + n, choices, style, validator, name) ) + return false; + m_noItems = 0 ; // this will be increased by our append command m_selected = 0; @@ -194,10 +197,11 @@ bool wxCheckListBox::Create(wxWindow *parent, GetThemeMetric(kThemeMetricCheckBoxWidth,(long *)&m_checkBoxWidth); GetThemeMetric(kThemeMetricCheckBoxHeight,&h); #endif - wxFontRefData * font = (wxFontRefData*) (GetFont().GetRefData()) ; + + const wxFont& font = GetFont(); FontInfo finfo; - FetchFontInfo(font->m_macFontNum,short(font->m_macFontSize),font->m_macFontStyle,&finfo); + FetchFontInfo(font.GetMacFontNum(),font.GetMacFontSize(),font.GetMacFontStyle(),&finfo); m_TextBaseLineOffset= finfo.leading+finfo.ascent; m_checkBoxHeight= finfo.leading+finfo.ascent+finfo.descent; @@ -211,7 +215,7 @@ bool wxCheckListBox::Create(wxWindow *parent, Rect bounds ; Str255 title ; - MacPreControlCreate( parent , id , "" , pos , size ,style, validator , name , &bounds , title ) ; + MacPreControlCreate( parent , id , wxEmptyString , pos , size ,style, validator , name , &bounds , title ) ; ListDefSpec listDef; listDef.defType = kListDefUserProcType;