X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a236aa2058ccf3d36e9cafc20fa7375080c4be50..cb40fa312eee41ba47999a83743a697760ba5bb0:/src/os2/listbox.cpp diff --git a/src/os2/listbox.cpp b/src/os2/listbox.cpp index 3755c4109e..e45ad8414b 100644 --- a/src/os2/listbox.cpp +++ b/src/os2/listbox.cpp @@ -29,6 +29,7 @@ #include "wx/window.h" #endif +#include "wx/os2/dcclient.h" #include "wx/os2/private.h" #define INCL_M @@ -38,7 +39,7 @@ #include "wx/ownerdrw.h" #endif - IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxListBox, wxControlWithItems) // ============================================================================ // list box item declaration and implementation @@ -510,9 +511,9 @@ void wxListBox::SetString(unsigned int n, const wxString& rsString) void* pOldData = NULL; wxClientData* pOldObjData = NULL; - if (m_clientDataItemsType == wxClientData_Void) + if ( HasClientUntypedData() ) pOldData = GetClientData(n); - else if (m_clientDataItemsType == wxClientData_Object) + else if ( HasClientObjectData() ) pOldObjData = GetClientObject(n); // @@ -660,7 +661,7 @@ bool wxListBox::OS2Command( n = -1; } vEvent.SetInt(n); - return GetEventHandler()->ProcessEvent(vEvent); + return HandleWindowEvent(vEvent); } // end of wxListBox::OS2Command // ---------------------------------------------------------------------------- @@ -738,12 +739,13 @@ bool wxListBox::OS2OnDraw ( wxCHECK(pData, false ); - wxDC vDc; + wxClientDC vDc(this); + wxPMDCImpl *impl = (wxPMDCImpl*) vDc.GetImpl(); wxPoint pt1( pDrawStruct->rclItem.xLeft, pDrawStruct->rclItem.yTop ); wxPoint pt2( pDrawStruct->rclItem.xRight, pDrawStruct->rclItem.yBottom ); wxRect vRect( pt1, pt2 ); - vDc.SetHPS(pDrawStruct->hps); + impl->SetHPS(pDrawStruct->hps); if (pDrawStruct->fsAttribute == pDrawStruct->fsAttributeOld) {