+WXHBRUSH wxListBox::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
+ WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
+{
+/*
+#if wxUSE_CTL3D
+ if ( m_useCtl3D )
+ {
+ HBRUSH hbrush = Ctl3dCtlColorEx(message, wParam, lParam);
+ return (WXHBRUSH) hbrush;
+ }
+#endif
+
+ if (GetParent()->GetTransparentBackground())
+ SetBkMode((HDC) pDC, TRANSPARENT);
+ else
+ SetBkMode((HDC) pDC, OPAQUE);
+
+ ::SetBkColor((HDC) pDC, RGB(GetBackgroundColour().Red(), GetBackgroundColour().Green(), GetBackgroundColour().Blue()));
+ ::SetTextColor((HDC) pDC, RGB(GetForegroundColour().Red(), GetForegroundColour().Green(), GetForegroundColour().Blue()));
+
+ wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID);
+
+ // Note that this will be cleaned up in wxApp::OnIdle, if backgroundBrush
+ // has a zero usage count.
+ backgroundBrush->RealizeResource();
+*/
+ wxBrush *backgroundBrush = wxTheBrushList->FindOrCreateBrush(GetBackgroundColour(), wxSOLID);
+ return (WXHBRUSH) backgroundBrush->GetResourceHandle();
+}
+
+MRESULT wxListBox::OS2WindowProc(HWND hwnd, WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
+{
+ return wxControl::OS2WindowProc(hwnd, nMsg, wParam, lParam);
+}
+
+#if wxUSE_OWNER_DRAWN
+
+// drawing
+// -------
+
+// space beneath/above each row in pixels
+// "standard" checklistbox use 1 here, some might prefer 2. 0 is ugly.
+#define OWNER_DRAWN_LISTBOX_EXTRA_SPACE (1)
+
+// the height is the same for all items
+// TODO should be changed for LBS_OWNERDRAWVARIABLE style listboxes
+
+// NB: can't forward this to wxListBoxItem because LB_SETITEMDATA
+// message is not yet sent when we get here!
+bool wxListBox::OS2OnMeasure(WXMEASUREITEMSTRUCT *item)
+{
+ // only owner-drawn control should receive this message
+ wxCHECK( ((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), FALSE );
+
+// MEASUREITEMSTRUCT *pStruct = (MEASUREITEMSTRUCT *)item;
+
+ wxDC dc;
+// TODO: dc.SetHDC((WXHDC)CreateIC(wxT("DISPLAY"), NULL, NULL, 0));
+ dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_ANSI_VAR_FONT));
+
+// pStruct->itemHeight = dc.GetCharHeight() + 2*OWNER_DRAWN_LISTBOX_EXTRA_SPACE;
+// pStruct->itemWidth = dc.GetCharWidth();
+
+ return TRUE;
+}
+
+// forward the message to the appropriate item
+bool wxListBox::OS2OnDraw(WXDRAWITEMSTRUCT *item)
+{
+ // only owner-drawn control should receive this message
+ wxCHECK( ((m_windowStyle & wxLB_OWNERDRAW) == wxLB_OWNERDRAW), FALSE );
+/*
+ DRAWITEMSTRUCT *pStruct = (DRAWITEMSTRUCT *)item;
+
+ long data = ListBox_GetItemData(GetHwnd(), pStruct->itemID);
+
+ wxCHECK( data && (data != LB_ERR), FALSE );
+
+ wxListBoxItem *pItem = (wxListBoxItem *)data;
+
+ wxDC dc;
+ dc.SetHDC((WXHDC)pStruct->hDC, FALSE);
+ wxRect rect(wxPoint(pStruct->rcItem.left, pStruct->rcItem.top),
+ wxPoint(pStruct->rcItem.right, pStruct->rcItem.bottom));
+
+ return pItem->OnDrawItem(dc, rect,
+ (wxOwnerDrawn::wxODAction)pStruct->itemAction,
+ (wxOwnerDrawn::wxODStatus)pStruct->itemState);
+*/
+ return FALSE;
+}
+
+#endif
+ // wxUSE_OWNER_DRAWN