]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listbox.cpp
makefile for wxLayout sample
[wxWidgets.git] / src / msw / listbox.cpp
index 4ca6a3955b3551b79536795acad979137c6a0a9e..0b4862cb0e7ada64a477250bbff1646ae42cdaf7 100644 (file)
     #pragma hdrstop
 #endif
 
+#include "wx/window.h"
+#include "wx/msw/private.h"
+
 #ifndef WX_PRECOMP
-    #include "wx/listbox.h"
-    #include "wx/settings.h"
-    #include "wx/brush.h"
-    #include "wx/font.h"
-    #include "wx/dc.h"
+#include "wx/listbox.h"
+#include "wx/settings.h"
+#include "wx/brush.h"
+#include "wx/font.h"
+#include "wx/dc.h"
 #endif
 
-#include "wx/msw/private.h"
-
-#include <windows.h>
 #include <windowsx.h>
 
-#ifndef __TWIN32__
-    #ifdef __GNUWIN32__
-        #include <wx/msw/gnuwin32/extra.h>
-    #endif
+#ifdef __WXWINE__
+  #if defined(GetWindowStyle)
+    #undef GetWindowStyle
+  #endif
 #endif
 
-#ifdef GetCharWidth
-    #undef GetCharWidth
-#endif
+#include "wx/dynarray.h"
+#include "wx/log.h"
 
 #if wxUSE_OWNER_DRAWN
     #include  "wx/ownerdrw.h"
 #endif
 
-#include "wx/dynarray.h"
-#include "wx/log.h"
+#ifndef __TWIN32__
+    #if defined(__GNUWIN32__)
+        #include <wx/msw/gnuwin32/extra.h>
+    #endif
+#endif
+
+#ifdef __WXWINE__
+  #ifndef ListBox_SetItemData
+    #define ListBox_SetItemData(hwndCtl, index, data) \
+      ((int)(DWORD)SendMessage((hwndCtl), LB_SETITEMDATA, (WPARAM)(int)(index), (LPARAM)(data)))
+  #endif
+  #ifndef ListBox_GetHorizontalExtent
+    #define ListBox_GetHorizontalExtent(hwndCtl) \
+      ((int)(DWORD)SendMessage((hwndCtl), LB_GETHORIZONTALEXTENT, 0L, 0L))
+  #endif
+  #ifndef ListBox_GetSelCount
+    #define ListBox_GetSelCount(hwndCtl) \
+      ((int)(DWORD)SendMessage((hwndCtl), LB_GETSELCOUNT, 0L, 0L))
+  #endif
+  #ifndef ListBox_GetSelItems
+    #define ListBox_GetSelItems(hwndCtl, cItems, lpItems) \
+      ((int)(DWORD)SendMessage((hwndCtl), LB_GETSELITEMS, (WPARAM)(int)(cItems), (LPARAM)(int *)(lpItems)))
+  #endif
+  #ifndef ListBox_GetTextLen
+    #define ListBox_GetTextLen(hwndCtl, index) \
+      ((int)(DWORD)SendMessage((hwndCtl), LB_GETTEXTLEN, (WPARAM)(int)(index), 0L))
+  #endif
+  #ifndef ListBox_GetText
+    #define ListBox_GetText(hwndCtl, index, lpszBuffer) \
+      ((int)(DWORD)SendMessage((hwndCtl), LB_GETTEXT, (WPARAM)(int)(index), (LPARAM)(LPCTSTR)(lpszBuffer)))
+  #endif
+#endif
 
 #if !USE_SHARED_LIBRARY
     IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl)
@@ -165,7 +194,8 @@ bool wxListBox::Create(wxWindow *parent,
     int height = size.y;
     m_windowStyle = style;
 
-    DWORD wstyle = WS_VSCROLL | WS_TABSTOP | LBS_NOTIFY | LBS_HASSTRINGS;
+    DWORD wstyle = WS_VISIBLE | WS_VSCROLL | WS_TABSTOP |
+                   LBS_NOTIFY | LBS_HASSTRINGS;
     if (m_windowStyle & wxLB_MULTIPLE)
         wstyle |= LBS_MULTIPLESEL;
     else if (m_windowStyle & wxLB_EXTENDED)