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
,(long *)pWidth
,(long *)pHeight
wxColour vColText;
COLORREF vRef;
RECTL vRect = {rRect.x + 4, rRect.y + 1, rRect.x + (rRect.width - 2), rRect.y + rRect.height};
- char zMsg[128];
+
+ memset(&vCbnd, 0, sizeof(CHARBUNDLE));
//
// Use default font if no font set
,GetBValue(vRef)
);
}
+
rDC.SetTextBackground(vColBack);
rDC.SetTextForeground(vColText);
rDC.SetBackgroundMode(wxTRANSPARENT);
+ vCbnd.lColor = vColText.GetPixel();
+ vCbnd.lBackColor = vColBack.GetPixel();
+ ::GpiSetAttrs( hPS
+ ,PRIM_CHAR
+ ,CBB_BACK_COLOR | CBB_COLOR
+ ,0
+ ,&vCbnd
+ );
+ ::GpiSetBackMix( hPS
+ ,BM_LEAVEALONE
+ );
//
// Paint the background
//
// Draw the main item text sans the accel text
- rDC.DrawText( sFullString
- ,nX
- ,rRect.y + 4
- );
+ //
+ POINTL vPntStart = {nX, rRect.y + 4};
+ ::GpiCharStringAt( rDC.GetHPS()
+ ,&vPntStart
+ ,sFullString.length()
+ ,(PCH)sFullString.c_str()
+ );
if (bFoundMneumonic)
{
//
// Underline the mneumonic -- still won't work, but at least it "looks" right
//
wxPen vPen;
- POINTL vPntStart = {nX + nWidth - 1, rRect.y + 2}; // Make it look pretty!
POINTL vPntEnd = {nX + nWidth + nCharWidth - 3, rRect.y + 2}; //CharWidth is bit wide
+ vPntStart.x = nX + nWidth - 1;
+ vPntStart.y = rRect.y + 2; // Make it look pretty!
vPen = wxPen(vColText, 1, wxSOLID); // Assuming we are always black
rDC.SetPen(vPen);
::GpiMove(hPS, &vPntStart);
//
// Back off the starting position from the right edge
//
- rDC.DrawText( sAccel
- ,rRect.width - (nWidth + 7) // this seems to mimic the default OS/2 positioning
- ,rRect.y + 4
- );
+ vPntStart.x = rRect.width - (nWidth + 7);
+ vPntStart.y = rRect.y + 4;
+ ::GpiCharStringAt( rDC.GetHPS()
+ ,&vPntStart
+ ,sAccel.length()
+ ,(PCH)sAccel.c_str()
+ );
}
//
vRect.xLeft = rRect.x;
vRect.xRight = rRect.x + GetMarginWidth();
vRect.yBottom = rRect.y;
- vRect.yTop = rRect.y + m_nHeight;
+ vRect.yTop = rRect.y + m_nHeight - 3;
::WinDrawBitmap( hPS // PS for this menuitem
,hBmpCheck // system checkmark
if (vBmp.Ok())
{
+
wxMemoryDC vDCMem(&rDC);
+ wxMemoryDC* pOldDC = (wxMemoryDC*)vBmp.GetSelectedInto();
+ if(pOldDC != NULL)
+ {
+ vBmp.SetSelectedInto(NULL);
+ }
vDCMem.SelectObject(vBmp);
//
,rRect.x + GetMarginWidth()
,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;
vLine.lColor = vColBack.GetPixel();
,0
,&vLine
);
+ ::GpiMove(hPS, &vPnt1);
::GpiBox( hPS
,DRO_OUTLINE
- ,(PPOINTL)&vRectBmp
+ ,&vPnt2
,0L
,0L
);
}
+ vBmp.SetSelectedInto(NULL);
}
}
return TRUE;