- if ( IsChecked() )
- stat = (wxOwnerDrawn::wxODStatus)(stat | wxOwnerDrawn::wxODChecked);
-
-// TODO:
-/*
-
- if ( wxOwnerDrawn::OnDrawItem(dc, rc, act, stat) ) {
- // ## using native API for performance and precision
- size_t nCheckWidth = GetDefaultMarginWidth(),
- nCheckHeight = m_pParent->GetItemHeight();
-
- int x = rc.GetX(),
- y = rc.GetY();
-
- HDC hdc = (HDC)dc.GetHDC();
-
- // create pens
- HPEN hpenBack = CreatePen(PS_SOLID, 0, GetSysColor(COLOR_WINDOW)),
- hpenGray = CreatePen(PS_SOLID, 0, RGB(128, 128, 128)),
- hpenPrev = (HPEN)SelectObject(hdc, hpenBack);
-
- // we erase the 1-pixel border
- Rectangle(hdc, x, y, x + nCheckWidth, y + nCheckHeight);
-
- // shift check mark 1 pixel to the right (it looks better like this)
- x++;
-
- if ( IsChecked() ) {
- // first create a monochrome bitmap in a memory DC
- HDC hdcMem = CreateCompatibleDC(hdc);
- HBITMAP hbmpCheck = CreateBitmap(nCheckWidth, nCheckHeight, 1, 1, 0);
- HBITMAP hbmpOld = (HBITMAP)SelectObject(hdcMem, hbmpCheck);
-
- // then draw a check mark into it
- RECT rect ;
- rect.left = 0 ;
- rect.top = 0 ;
- rect.right = nCheckWidth ;
- rect.bottom = nCheckHeight ;
-
-#ifdef __WIN32__
-#ifndef __SC__
- DrawFrameControl(hdcMem, &rect, DFC_MENU, DFCS_MENUCHECK);
-#endif
-#else
- // In WIN16, draw a cross
- HPEN blackPen = CreatePen(PS_SOLID, 1, RGB(0, 0, 0));
- HPEN whiteBrush = (HPEN)GetStockObject(WHITE_BRUSH);
- HPEN hPenOld = (HPEN)::SelectObject(hdcMem, blackPen);
- HPEN hBrushOld = (HPEN)::SelectObject(hdcMem, whiteBrush);
- ::SetROP2(hdcMem, R2_COPYPEN);
- Rectangle(hdcMem, 0, 0, nCheckWidth, nCheckHeight);
- MoveTo(hdcMem, 0, 0);
- LineTo(hdcMem, nCheckWidth, nCheckHeight);
- MoveTo(hdcMem, nCheckWidth, 0);
- LineTo(hdcMem, 0, nCheckHeight);
- ::SelectObject(hdcMem, hPenOld);
- ::SelectObject(hdcMem, hBrushOld);
- ::DeleteObject(blackPen);
-#endif
-
- // finally copy it to screen DC and clean up
- BitBlt(hdc, x, y, nCheckWidth - 1, nCheckHeight,
- hdcMem, 0, 0, SRCCOPY);
-
- SelectObject(hdcMem, hbmpOld);
- DeleteObject(hbmpCheck);
- DeleteDC(hdcMem);
+ wxRect vRect = rRect;
+
+ ::WinQueryWindowRect( m_pParent->GetHWND()
+ ,&rDc.m_vRclPaint
+ );
+ if (IsChecked())
+ eStat = (wxOwnerDrawn::wxODStatus)(eStat | wxOwnerDrawn::wxODChecked);
+
+ //
+ // Unfortunately PM doesn't quite get the text position exact. We need to alter
+ // it down and to the right, just a little bit. The coords in rRect are OS/2
+ // coords not wxWidgets coords.
+ //
+ vRect.x += 5;
+ vRect.y -= 3;
+ if (wxOwnerDrawn::OnDrawItem( rDc
+ ,vRect
+ ,eAct
+ ,eStat))
+ {
+ size_t nCheckWidth = GetDefaultMarginWidth();
+ size_t nCheckHeight = m_pParent->GetItemHeight();
+ int nParentHeight;
+ int nX = rRect.GetX();
+ int nY = rRect.GetY();
+ int nOldY = nY;
+ wxColour vColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
+ wxPen vPenBack;
+ wxPen vPenGray;
+ wxPen vPenPrev;
+
+ m_pParent->GetSize( NULL
+ ,&nParentHeight
+ );
+
+ nY = nParentHeight - nY - nCheckHeight;
+ vPenBack = wxPen(vColour, 1, wxSOLID);
+ vPenGray = wxPen(wxColour(127, 127, 127), 1, wxSOLID);
+
+ //
+ // Erase the 1-pixel border
+ //
+ rDc.SetPen(vPenBack);
+ rDc.DrawRectangle( nX
+ ,nY
+ ,nCheckWidth
+ ,nCheckHeight
+ );
+
+ //
+ // Now we draw the smaller rectangle
+ //
+ nY++;
+ nCheckWidth -= 2;
+ nCheckHeight -= 2;
+
+ //
+ // Draw hollow gray rectangle
+ //
+ rDc.SetPen(vPenGray);
+ rDc.DrawRectangle( nX
+ ,nY
+ ,nCheckWidth
+ ,nCheckHeight
+ );
+
+ nX++;
+ if (IsChecked())
+ {
+ //
+ // Draw the check by loading the sys standard bitmap and drawing it
+ //
+ HBITMAP hChkBmp = ::WinGetSysBitmap( HWND_DESKTOP
+ ,SBMP_MENUCHECK
+ );
+ POINTL vPoint = {nX, nOldY + 3};
+
+ ::WinDrawBitmap( rDc.GetHPS()
+ ,hChkBmp
+ ,NULL
+ ,&vPoint
+ ,NULL
+ ,NULL
+ ,DBM_NORMAL
+ );
+ }
+ return TRUE;