]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/listbox.cpp
Fixed a long-standing issue where wxSlider controls with a hardcoded size would mispl...
[wxWidgets.git] / src / motif / listbox.cpp
index e28473f61505a32b24acfc6e6b46338db1f32d97..6f4520e02e20c58177660500f2f96b666a5ef7a2 100644 (file)
@@ -9,10 +9,13 @@
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
 
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
     #pragma implementation "listbox.h"
 #endif
 
     #pragma implementation "listbox.h"
 #endif
 
+// For compilers that support precompilation, includes "wx.h".
+#include "wx/wxprec.h"
+
 #ifdef __VMS
 #define XtParent XTPARENT
 #define XtDisplay XTDISPLAY
 #ifdef __VMS
 #define XtParent XTPARENT
 #define XtDisplay XTDISPLAY
@@ -23,6 +26,7 @@
 #include "wx/dynarray.h"
 #include "wx/log.h"
 #include "wx/utils.h"
 #include "wx/dynarray.h"
 #include "wx/log.h"
 #include "wx/utils.h"
+#include "wx/arrstr.h"
 
 #ifdef __VMS__
 #pragma message disable nosimpint
 
 #ifdef __VMS__
 #pragma message disable nosimpint
@@ -157,6 +161,19 @@ bool wxListBox::Create(wxWindow *parent, wxWindowID id,
     return TRUE;
 }
 
     return TRUE;
 }
 
+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);
+}
+
 wxListBox::~wxListBox()
 {
     if( HasClientObjectData() )
 wxListBox::~wxListBox()
 {
     if( HasClientObjectData() )
@@ -529,11 +546,11 @@ void wxListBox::SetString(int N, const wxString& s)
 
 void wxListBox::Command (wxCommandEvent & event)
 {
 
 void wxListBox::Command (wxCommandEvent & event)
 {
-    if (event.m_extraLong)
-        SetSelection (event.m_commandInt);
+    if (event.GetExtraLong())
+        SetSelection (event.GetInt());
     else
     {
     else
     {
-        Deselect (event.m_commandInt);
+        Deselect (event.GetInt());
         return;
     }
     ProcessCommand (event);
         return;
     }
     ProcessCommand (event);
@@ -560,8 +577,8 @@ void wxListBoxCallback (Widget WXUNUSED(w), XtPointer clientData,
         event.SetClientObject( item->GetClientObject(n) );
     else if ( item->HasClientUntypedData() )
         event.SetClientData( item->GetClientData(n) );
         event.SetClientObject( item->GetClientObject(n) );
     else if ( item->HasClientUntypedData() )
         event.SetClientData( item->GetClientData(n) );
-    event.m_commandInt = n;
-    event.m_extraLong = TRUE;
+    event.SetInt(n);
+    event.SetExtraLong(TRUE);
     event.SetEventObject(item);
     event.SetString( item->GetString( n ) );
 
     event.SetEventObject(item);
     event.SetString( item->GetString( n ) );