Article View: comp.os.ms-windows.programmer.misc
Article #2708Re: Drawing Borland OWNERDRAW button faces...
From: Tom W. Brown
Date: Tue, 12 Jan 1993 00:05
Date: Tue, 12 Jan 1993 00:05
39 lines
2320 bytes
2320 bytes
In article <2B50DAA1.53C8@tct.com>, jeff@tct.com (Jeff Witzer) writes: |> I am trying to respond to the WM_DRAWITEM message for Borland OWNERDRAW |> buttons. I have the following questions: |> |> 1) How do I tell if the button is pushed or not? I need to know this to |> redraw the button face pushed or not. lpdis->itemAction and |> lpdis->itemState do not seem to give this information. Yes, they do, although the text in the reference could be clearer. If the ODA_SELECT bit in lpdis->itemAction is set then draw the button as "pushed in" if the ODS_SELECTED bit is set in lpdis->itemState, otherwise draw it as "normal". |> 2) How can I draw text to the face of the button in either black or dark |> gray AND a light gray background within the text? I would like to use |> something with the power of DrawText () so I can horizontally and |> vertically center the text on the button. I can draw black text on a |> white background, but this looks funky on a gray button face. The best thing to do is output in TRANSPARENT mode so that you don't have to know what the button face color is. Use SetBkMode() to set this. You could also use SetBkColor() to setup the text background yourself. |> |> 3) How do I tell if the button is ENABLED or not? I would like to draw gray |> text (see #2) if the button is disabled. Well, the ODS_DISABLED bit in lpdis->itemState will be set if the button should be drawn as disabled. You could always use the IsWindowEnabled() function also. ---------------------------------------------------------------------------- Tom Brown | "She turned me into a newt... PE Nelson Systems | ... I got better" twbrown@pe-nelson.com | Monty Python and the Holy Grail ----------------------------------------------------------------------------
Technical Details
Message-ID:
<739@lax.lax.pe-nelson.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrownReferences:
<2B50DAA1.53C8@tct.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!lax.pe-nelson.com!lax!twbrown From: twbrown@PE-Nelson.COM (Tom W. Brown) Newsgroups: comp.os.ms-windows.programmer.misc Subject: Re: Drawing Borland OWNERDRAW button faces... Message-ID: <739@lax.lax.pe-nelson.com> Date: 12 Jan 93 00:05:12 GMT References: <2B50DAA1.53C8@tct.com> Sender: news@lax.pe-nelson.com Organization: PE-Nelson Lines: 39