#if wxUSE_CHECKLISTBOX
#include "wx/checklst.h"
+#include "wx/arrstr.h"
#include "wx/mac/uma.h"
#include "Appearance.h"
Cell cell, short dataOffset, short dataLength,
ListHandle listHandle )
{
+ wxCheckListBox* list;
+ list = (wxCheckListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) );
+ if ( list == NULL )
+ return ;
+
GrafPtr savePort;
GrafPtr grafPtr;
RgnHandle savedClipRegion;
SInt32 savedPenMode;
- wxCheckListBox* list;
GetPort(&savePort);
SetPort((**listHandle).port);
grafPtr = (**listHandle).port ;
// typecast our refCon
- list = (wxCheckListBox*) GetControlReference( (ControlHandle) GetListRefCon(listHandle) );
// Calculate the cell rect.
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 ;
{
}
+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,
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;