- // wxColor <-> RGB
- #define ToRGB(col) RGB(col.Red(), col.Green(), col.Blue())
- #define UnRGB(col) GetRValue(col), GetGValue(col), GetBValue(col)
-
- // set the colors
- // --------------
- DWORD colBack, colText;
-// TODO:
-/*
- if ( st & wxODSelected ) {
- colBack = GetSysColor(COLOR_HIGHLIGHT);
- colText = GetSysColor(COLOR_HIGHLIGHTTEXT);
- }
- else {
- // fall back to default colors if none explicitly specified
- colBack = m_colBack.Ok() ? ToRGB(m_colBack) : GetSysColor(COLOR_WINDOW);
- colText = m_colText.Ok() ? ToRGB(m_colText) : GetSysColor(COLOR_WINDOWTEXT);
- }
-*/
-// dc.SetTextForeground(wxColor(UnRGB(colText)));
-// dc.SetTextBackground(wxColor(UnRGB(colBack)));
-
- // select the font and draw the text
- // ---------------------------------
-
- // determine where to draw and leave space for a check-mark.
- int x = rc.x + GetMarginWidth();
-
- dc.SetFont(GetFont());
- dc.DrawText(m_strName, x, rc.y);
-
- // draw the bitmap
- // ---------------
- if ( IsCheckable() && !m_bmpChecked.Ok() ) {
- if ( st & wxODChecked ) {
- // using native APIs for performance and simplicity
-// TODO:
-/*
- HDC hdcMem = CreateCompatibleDC(hdc);
- HBITMAP hbmpCheck = CreateBitmap(GetMarginWidth(), m_nHeight, 1, 1, 0);
- SelectObject(hdcMem, hbmpCheck);
- // then draw a check mark into it
- RECT rect = { 0, 0, GetMarginWidth(), m_nHeight };
-
- // finally copy it to screen DC and clean up
- BitBlt(hdc, rc.x, rc.y, GetMarginWidth(), m_nHeight,
- hdcMem, 0, 0, SRCCOPY);
- DeleteDC(hdcMem);
-*/
+ //
+ // Now draw the accel text
+ //
+ if (bFoundAccel)
+ {
+ size_t nWidth;
+ size_t nHeight;
+
+ rDC.GetTextExtent( sAccel
+ ,(long *)&nWidth
+ ,(long *)&nHeight
+ );
+ //
+ // Back off the starting position from the right edge
+ //
+ vPntStart.x = rRect.width - (nWidth + 7);
+ vPntStart.y = rRect.y + 4;
+ ::GpiCharStringAt( rDC.GetHPS()
+ ,&vPntStart
+ ,sAccel.length()
+ ,(PCH)sAccel.c_str()
+ );