X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0c589ad076cb531a3ef7808aaedadc03c8286942..683730003ba8f36fa07496b8f298d40733534aea:/src/msw/listbox.cpp diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index b7cf16551a..869a9116b5 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -20,7 +20,6 @@ #pragma hdrstop #endif -#include #include "wx/window.h" #include "wx/msw/private.h" @@ -32,6 +31,14 @@ #include "wx/dc.h" #endif +#include + +#ifdef __WXWINE__ + #if defined(GetWindowStyle) + #undef GetWindowStyle + #endif +#endif + #include "wx/dynarray.h" #include "wx/log.h" @@ -40,11 +47,37 @@ #endif #ifndef __TWIN32__ - #ifdef __GNUWIN32__ + #if defined(__GNUWIN32__) #include #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) @@ -292,7 +325,7 @@ void wxListBox::Append(const wxString& item) 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 ++; @@ -311,7 +344,7 @@ void wxListBox::Append(const wxString& item, char *Client_data) 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()); @@ -409,7 +442,7 @@ void wxListBox::Deselect(int N) 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" ); @@ -417,7 +450,7 @@ char *wxListBox::GetClientData(int N) const 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" ); @@ -624,7 +657,7 @@ void wxListBox::SetString(int N, const wxString& s) 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);