X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/42e69d6b435a4dd5415caf3750db62cf45b6f373..bfac8499858dbb52ae4e712b718dcd08e777b4c2:/src/msw/listbox.cpp?ds=sidebyside diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 994f8e8f9b..869a9116b5 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -20,31 +20,64 @@ #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 #include -#ifndef __TWIN32__ - #ifdef __GNUWIN32__ - #include - #endif +#ifdef __WXWINE__ + #if defined(GetWindowStyle) + #undef GetWindowStyle + #endif #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 + #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);