]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/listbox.cpp
call RemoveChild() in ~wxWindowBase instead of doing it in each ~wxWindow for each...
[wxWidgets.git] / src / mac / listbox.cpp
index 9daaf275e82b77581269dbbd28b1698d24d3a1b7..b72970b0c2f6d585bb6a30fcce7d1d6ffebfc295 100644 (file)
@@ -137,7 +137,7 @@ static pascal void wxMacListDefinition( short message, Boolean isSelected, Rect
                        }
 #else
             {  
-               wxCharBuffer text = wxMacStringToCString( linetext ) ;
+               wxCharBuffer text = linetext.mb_str( wxConvLocal) ;
                 MoveTo(drawRect->left + 4 , drawRect->top + 10 );
                 DrawText(text, 0 , strlen(text) );
             }
@@ -202,6 +202,9 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
                        const wxValidator& validator,
                        const wxString& name)
 {
+    if ( !wxListBoxBase::Create(parent, id, pos, size, style & ~(wxHSCROLL|wxVSCROLL), validator, name) )
+        return false;
+
     m_noItems = 0 ; // this will be increased by our append command
     m_selected = 0;
 
@@ -630,8 +633,7 @@ wxSize wxListBox::DoGetBestSize() const
                 &baseline );
             wLine = bounds.h ;
         #else
-            wxCharBuffer text = wxMacStringToCString( str ) ;
-            wLine = ::TextWidth( text , 0 , strlen(text) ) ;
+            wLine = ::TextWidth( str.c_str() , 0 , str.Length() ) ;
         #endif
             lbWidth = wxMax(lbWidth, wLine);
         }