]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/listbox.cpp
Some doc corrections
[wxWidgets.git] / src / mac / listbox.cpp
index b72970b0c2f6d585bb6a30fcce7d1d6ffebfc295..b4dae1a156f3116585f4694a41328e8f97e7e137 100644 (file)
@@ -105,13 +105,12 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, 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( short(font->m_macFontSize) ) ;
-                ::TextFace( font->m_macFontStyle ) ;
+                ::TextFont( font.GetMacFontNum() ) ;
+                ::TextSize( font.GetMacFontSize() ) ;
+                ::TextFace( font.GetMacFontStyle() ) ;
             }
             else
             {
@@ -124,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,
@@ -194,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,
@@ -273,11 +286,11 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
     OptionBits  options = 0;
     if ( style & wxLB_MULTIPLE )
     {
-        options += lNoExtend ;
+        options += lExtendDrag + lUseSense  ;
     }
     else if ( style & wxLB_EXTENDED )
     {
-        options += lExtendDrag ;
+        // default behaviour
     }
     else
     {
@@ -604,13 +617,11 @@ wxSize wxListBox::DoGetBestSize() const
     {
         wxMacPortStateHelper st( UMAGetWindowPort( (WindowRef) MacGetRootWindow() ) ) ; 
         
-        wxFontRefData * font = (wxFontRefData*) m_font.GetRefData() ;
-        
-        if ( font )
+        if ( m_font.Ok() )
         {
-            ::TextFont( font->m_macFontNum ) ;
-            ::TextSize( short(font->m_macFontSize) ) ;
-            ::TextFace( font->m_macFontStyle ) ;
+            ::TextFont( m_font.GetMacFontNum() ) ;
+            ::TextSize( m_font.GetMacFontSize() ) ;
+            ::TextFace( m_font.GetMacFontStyle() ) ;
         }
         else
         {
@@ -625,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,
@@ -812,7 +823,7 @@ void wxListBox::MacScrollTo( int n )
     // TODO implement scrolling
 }
 
-void wxListBox::OnSize( const wxSizeEvent &event)
+void wxListBox::OnSize( wxSizeEvent &event)
 {
     Point pt;