]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/carbon/listbox.cpp
cleanup and fix of double disposal (thanks to Steve Hartwell)
[wxWidgets.git] / src / mac / carbon / listbox.cpp
index fe39a0a19fcea8baca9128e2129e718f949e055b..4a623eb59b72fee778dd86f83d20a604490bf3a1 100644 (file)
@@ -123,7 +123,7 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect
                        {
                                Rect frame = { drawRect->top, drawRect->left + 4,
                                    drawRect->top + kwxMacListItemHeight, drawRect->right + 10000 } ;
-                               CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , wxMacCFStringHolder(linetext) ) ;
+                               CFMutableStringRef mString = CFStringCreateMutableCopy( NULL , 0 , wxMacCFStringHolder(linetext , list->GetFont().GetEncoding()) ) ;
                                ::TruncateThemeText( mString , kThemeCurrentPortFont, kThemeStateActive, drawRect->right - drawRect->left , truncEnd , NULL ) ;
                                ::DrawThemeTextBox( mString,
                                    kThemeCurrentPortFont,
@@ -193,6 +193,20 @@ wxListBox::wxListBox()
 
 static ListDefUPP macListDefUPP = NULL ;
 
+bool wxListBox::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 wxListBox::Create(wxWindow *parent, wxWindowID id,
                        const wxPoint& pos,
                        const wxSize& size,
@@ -622,7 +636,7 @@ wxSize wxListBox::DoGetBestSize() const
         #if wxUSE_UNICODE
             Point bounds={0,0} ;
             SInt16 baseline ;
-            ::GetThemeTextDimensions( wxMacCFStringHolder( str ) ,
+            ::GetThemeTextDimensions( wxMacCFStringHolder( str , m_font.GetEncoding() ) ,
                 kThemeCurrentPortFont,
                 kThemeStateActive,
                 false,
@@ -809,7 +823,7 @@ void wxListBox::MacScrollTo( int n )
     // TODO implement scrolling
 }
 
-void wxListBox::OnSize( const wxSizeEvent &event)
+void wxListBox::OnSize( wxSizeEvent &event)
 {
     Point pt;