-// draw the item
-bool wxOwnerDrawn::OnDrawItem(
- wxDC& rDC
-, const wxRect& rRect
-, wxODAction eAction
-, wxODStatus eStatus
-)
-{
- //
- // For now we let PM deal with highlighting and framing and such in a
- // default manner. So we leave fsAttribute and fsOldAttribute ( or
- // fsState and fsOldState ) the same and pass it on. We may want to add
- // code later to draw theseattributes in a more custom manner.
- //
-
- //
- // WxWinGdi_CColour <-> RGB
- //
- #define ToRGB(col) OS2RGB(col.Red(), col.Green(), col.Blue())
- #define UnRGB(col) GetRValue(col), GetGValue(col), GetBValue(col)
-
- CHARBUNDLE vCbndText;
- CHARBUNDLE vCbndBack;
- HPS hPS= rDC.GetHPS();
- ULONG lColBack;
- ULONG lColText;
-
- if (eStatus & wxODSelected)
- {
- lColBack = (DWORD)::WinQuerySysColor( HWND_DESKTOP
- ,SYSCLR_MENUHILITEBGND // Light gray
- ,0L
- );
- lColText = (DWORD)::WinQuerySysColor( HWND_DESKTOP
- ,SYSCLR_MENUTEXT // Black
- ,0L
- );
- }
- else if (eStatus & wxODDisabled)
- {
- lColBack = (DWORD)::WinQuerySysColor( HWND_DESKTOP
- ,SYSCLR_MENU // Light gray
- ,0L
- );
- lColText = (DWORD)::WinQuerySysColor( HWND_DESKTOP
- ,SYSCLR_MENUDISABLEDTEXT // dark gray
- ,0L
- );
- }
- else
- {
- //
- // Fall back to default colors if none explicitly specified
- //
- lColBack = m_colBack.Ok() ? ToRGB(m_colBack) : ::WinQuerySysColor( HWND_DESKTOP
- ,SYSCLR_MENU // we are using gray for all our window backgrounds in wxWindows
- ,0L
- );
- lColText = m_colText.Ok() ? ToRGB(m_colText) : ::WinQuerySysColor( HWND_DESKTOP
- ,SYSCLR_WINDOWTEXT // Black
- ,0L
- );
- }
- vCbndText.lColor = (LONG)lColText;
- vCbndBack.lColor = (LONG)lColBack;