Ownerdrawn updates

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@9575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Webster
2001-03-23 23:30:11 +00:00
parent 45805ba322
commit 1159a76f9c
2 changed files with 6 additions and 15 deletions

View File

@@ -144,6 +144,7 @@ wxMemoryDC::wxMemoryDC(
wxMemoryDC::~wxMemoryDC() wxMemoryDC::~wxMemoryDC()
{ {
m_vSelectedBitmap.SetSelectedInto(NULL);
if (m_hPS != NULLHANDLE) if (m_hPS != NULLHANDLE)
::GpiDestroyPS(m_hPS); ::GpiDestroyPS(m_hPS);
if (m_hDC != NULLHANDLE) if (m_hDC != NULLHANDLE)

View File

@@ -75,18 +75,6 @@ bool wxOwnerDrawn::OnMeasureItem(
wxString sStr = wxStripMenuCodes(m_strName); wxString sStr = wxStripMenuCodes(m_strName);
#if 0
wxString sTgt = "\t";
size_t nIndex;
nIndex = sStr.Find(sTgt.c_str());
if (nIndex != -1)
sStr.Remove(nIndex);
sTgt = "~";
nIndex = sStr.Find(sTgt.c_str());
if (nIndex != -1)
sStr.Replace(sTgt.c_str(), "", TRUE);
#endif
vDC.GetTextExtent( sStr vDC.GetTextExtent( sStr
,(long *)pWidth ,(long *)pWidth
,(long *)pHeight ,(long *)pHeight
@@ -122,7 +110,6 @@ bool wxOwnerDrawn::OnDrawItem(
wxColour vColText; wxColour vColText;
COLORREF vRef; COLORREF vRef;
RECTL vRect = {rRect.x + 4, rRect.y + 1, rRect.x + (rRect.width - 2), rRect.y + rRect.height}; RECTL vRect = {rRect.x + 4, rRect.y + 1, rRect.x + (rRect.width - 2), rRect.y + rRect.height};
char zMsg[128];
// //
// Use default font if no font set // Use default font if no font set
@@ -315,7 +302,7 @@ bool wxOwnerDrawn::OnDrawItem(
vRect.xLeft = rRect.x; vRect.xLeft = rRect.x;
vRect.xRight = rRect.x + GetMarginWidth(); vRect.xRight = rRect.x + GetMarginWidth();
vRect.yBottom = rRect.y; vRect.yBottom = rRect.y;
vRect.yTop = rRect.y + m_nHeight; vRect.yTop = rRect.y + m_nHeight - 3;
::WinDrawBitmap( hPS // PS for this menuitem ::WinDrawBitmap( hPS // PS for this menuitem
,hBmpCheck // system checkmark ,hBmpCheck // system checkmark
@@ -372,6 +359,8 @@ bool wxOwnerDrawn::OnDrawItem(
,rRect.x + GetMarginWidth() ,rRect.x + GetMarginWidth()
,rRect.y + m_nHeight ,rRect.y + m_nHeight
}; };
POINTL vPnt1 = {2, 4}; // Leave a little background border
POINTL vPnt2 = {rRect.x + GetMarginWidth(), rRect.y + m_nHeight - 3};
LINEBUNDLE vLine; LINEBUNDLE vLine;
vLine.lColor = vColBack.GetPixel(); vLine.lColor = vColBack.GetPixel();
@@ -381,9 +370,10 @@ bool wxOwnerDrawn::OnDrawItem(
,0 ,0
,&vLine ,&vLine
); );
::GpiMove(hPS, &vPnt1);
::GpiBox( hPS ::GpiBox( hPS
,DRO_OUTLINE ,DRO_OUTLINE
,(PPOINTL)&vRectBmp ,&vPnt2
,0L ,0L
,0L ,0L
); );