X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af111fc33841cc8bdc4d6cf027702805333bdd2a..6ecb30a36fe6c85e60a2d7c6ac2fbec6f0cf98b2:/src/motif/listbox.cpp

diff --git a/src/motif/listbox.cpp b/src/motif/listbox.cpp
index 25fbfdf546..a21d2e62d4 100644
--- a/src/motif/listbox.cpp
+++ b/src/motif/listbox.cpp
@@ -19,12 +19,16 @@
 #include "wx/log.h"
 #include "wx/utils.h"
 
+#ifdef __VMS__
+#pragma message disable nosimpint
+#endif
 #include <Xm/List.h>
+#ifdef __VMS__
+#pragma message enable nosimpint
+#endif
 #include "wx/motif/private.h"
 
-#if !USE_SHARED_LIBRARY
     IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
-#endif
 
 static void wxListBoxCallback(Widget w,
                               XtPointer clientData,
@@ -786,4 +790,71 @@ void wxListBox::ChangeForegroundColour()
     */
 }
 
+// These implement functions needed by wxControlWithItems.
+// Unfortunately, they're not all implemented yet.
+
+int wxListBox::GetCount() const
+{
+    return Number();
+}
+
+int wxListBox::DoAppend(const wxString& item)
+{
+    Append(item, (void*) NULL);
+    return GetCount() - 1;
+}
+
+// Just appends, doesn't yet insert
+void wxListBox::DoInsertItems(const wxArrayString& items, int WXUNUSED(pos))
+{
+    size_t nItems = items.GetCount();
+
+    for ( size_t n = 0; n < nItems; n++ )
+    {
+        Append( items[n], (void*) NULL);
+    }
+}
+
+void wxListBox::DoSetItems(const wxArrayString& items, void **clientData)
+{
+    size_t nItems = items.GetCount();
+    wxString* strings = new wxString[nItems];
+
+    for ( size_t n = 0; n < nItems; n++ )
+    {
+        strings[n] = items[n];
+    }
+    Set(nItems, strings, clientData);
 
+    delete[] strings;
+}
+
+void wxListBox::DoSetFirstItem(int WXUNUSED(n))
+{
+    wxFAIL_MSG( wxT("wxListBox::DoSetFirstItem not implemented") );
+}
+
+void wxListBox::DoSetItemClientData(int n, void* clientData)
+{
+    SetClientData(n, clientData);
+}
+
+void* wxListBox::DoGetItemClientData(int n) const
+{
+    return GetClientData(n);
+}
+
+void wxListBox::DoSetItemClientObject(int n, wxClientData* clientData)
+{
+    DoSetItemClientData(n, (void*) clientData);
+}
+
+wxClientData* wxListBox::DoGetItemClientObject(int n) const
+{
+    return (wxClientData*) DoGetItemClientData(n);
+}
+
+void wxListBox::Select(int n)
+{
+    SetSelection(n, TRUE);
+}