X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b45ed7a273799b1b360482496a706a211eca6435..a9412f8f03171fdd3606a4ad3db9c9da8fe6bd7c:/src/mac/checklst.cpp diff --git a/src/mac/checklst.cpp b/src/mac/checklst.cpp index ee04357b8f..cb7c4a818f 100644 --- a/src/mac/checklst.cpp +++ b/src/mac/checklst.cpp @@ -22,6 +22,7 @@ #if wxUSE_CHECKLISTBOX #include "wx/checklst.h" +#include "wx/arrstr.h" #include "wx/mac/uma.h" #include "Appearance.h" @@ -102,13 +103,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 ; @@ -173,6 +173,21 @@ void wxCheckListBox::Init() { } +bool wxCheckListBox::Create(wxWindow *parent, + wxWindowID id, + const wxPoint &pos, + const wxSize &size, + const wxArrayString& choices, + long style, + const wxValidator& validator, + const wxString &name) +{ + wxCArrayString chs(choices); + + return Create(parent, id, pos, size, chs.GetCount(), chs.GetStrings(), + style, validator, name); +} + bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id, const wxPoint &pos, @@ -198,10 +213,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;