]> git.saurik.com Git - wxWidgets.git/blobdiff - src/mac/classic/listbox.cpp
Return the correct encoding for X font spec construction
[wxWidgets.git] / src / mac / classic / listbox.cpp
index 8322a7a2f2e98643b062e46273b914445aa40f4c..0d1503df9f43d27948f4b59f8f9dfb49436d91cb 100644 (file)
 
 #include "wx/utils.h"
 
-#if !USE_SHARED_LIBRARY
 IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
 
 BEGIN_EVENT_TABLE(wxListBox, wxControl)
     EVT_SIZE( wxListBox::OnSize )
     EVT_CHAR( wxListBox::OnChar )
 END_EVENT_TABLE()
-#endif
 
 #include "wx/mac/uma.h"
 
@@ -265,7 +263,7 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
 
     long    result ;
     wxStAppResource resload ;
-    m_macControl = ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false ,
+    m_macControl = (WXWidget) ::NewControl( MAC_WXHWND(parent->MacGetRootWindow()) , &bounds , title , false ,
                   (style & wxLB_HSCROLL) ? kwxMacListWithVerticalAndHorizontalScrollbar : kwxMacListWithVerticalScrollbar , 
                   0 , 0, kControlListBoxProc , (long) this ) ;
     ::GetControlData( (ControlHandle) m_macControl , kControlNoPart , kControlListBoxListHandleTag ,
@@ -401,6 +399,8 @@ void wxListBox::Delete(int N)
 
 int wxListBox::DoAppend(const wxString& item)
 {
+    InvalidateBestSize();
+
     int index = m_noItems ;
     m_stringArray.Add( item ) ;
     m_dataArray.Add( NULL );
@@ -513,7 +513,7 @@ void wxListBox::Clear()
     MacClear() ;
 }
 
-void wxListBox::SetSelection(int N, bool select)
+void wxListBox::DoSetSelection(int N, bool select)
 {
     wxCHECK_RET( N >= 0 && N < m_noItems,
         wxT("invalid index in wxListBox::SetSelection") );
@@ -595,6 +595,8 @@ void wxListBox::DoInsertItems(const wxArrayString& items, int pos)
     wxCHECK_RET( pos >= 0 && pos <= m_noItems,
         wxT("invalid index in wxListBox::InsertItems") );
     
+    InvalidateBestSize();
+
     int nItems = items.GetCount();
     
     for ( int i = 0 ; i < nItems ; i++ )
@@ -905,7 +907,7 @@ void wxListBox::MacDoClick()
         n = -1;
     }
     
-    event.m_commandInt = n;
+    event.SetInt(n);
     
     GetEventHandler()->ProcessEvent(event);
 }
@@ -986,7 +988,7 @@ void wxListBox::OnChar(wxKeyEvent& event)
             n = -1;
         }
         
-        event.m_commandInt = n;
+        event.SetInt(n);
         
         GetEventHandler()->ProcessEvent(event);
     }
@@ -1013,7 +1015,7 @@ void wxListBox::OnChar(wxKeyEvent& event)
                     event.SetClientData( GetClientData(line) );
                 event.SetString( GetString(line) );
                 
-                event.m_commandInt = line ;
+                event.SetInt(line);
                 
                 GetEventHandler()->ProcessEvent(event);
             }