#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)
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)
SetHorizontalExtent(item);
}
-void wxListBox::Append(const wxString& item, char *Client_data)
+void wxListBox::Append(const wxString& item, void *Client_data)
{
int index = ListBox_AddString(GetHwnd(), item);
m_noItems ++;
SetHorizontalExtent(item);
}
-void wxListBox::Set(int n, const wxString *choices, char** clientData)
+void wxListBox::Set(int n, const wxString *choices, void** clientData)
{
ShowWindow(GetHwnd(), SW_HIDE);
ListBox_ResetContent(GetHwnd());
SendMessage(GetHwnd(), LB_SETSEL, FALSE, N);
}
-char *wxListBox::GetClientData(int N) const
+void *wxListBox::GetClientData(int N) const
{
wxCHECK_MSG( N >= 0 && N < m_noItems, NULL,
"invalid index in wxListBox::GetClientData" );
return (char *)SendMessage(GetHwnd(), LB_GETITEMDATA, N, 0);
}
-void wxListBox::SetClientData(int N, char *Client_data)
+void wxListBox::SetClientData(int N, void *Client_data)
{
wxCHECK_RET( N >= 0 && N < m_noItems,
"invalid index in wxListBox::SetClientData" );
if (!(m_windowStyle & wxLB_MULTIPLE) && !(m_windowStyle & wxLB_EXTENDED))
sel = GetSelection();
- char *oldData = (char *)wxListBox::GetClientData(N);
+ void *oldData = wxListBox::GetClientData(N);
SendMessage(GetHwnd(), LB_DELETESTRING, N, 0);