home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / os / mswindo / programm / misc / 4856 < prev    next >
Encoding:
Internet Message Format  |  1993-01-11  |  2.2 KB

  1. Path: sparky!uunet!lax.pe-nelson.com!lax!twbrown
  2. From: twbrown@PE-Nelson.COM (Tom W. Brown)
  3. Newsgroups: comp.os.ms-windows.programmer.misc
  4. Subject: Re: Drawing Borland OWNERDRAW button faces...
  5. Message-ID: <739@lax.lax.pe-nelson.com>
  6. Date: 12 Jan 93 00:05:12 GMT
  7. References: <2B50DAA1.53C8@tct.com>
  8. Sender: news@lax.pe-nelson.com
  9. Organization: PE-Nelson
  10. Lines: 39
  11.  
  12. In article <2B50DAA1.53C8@tct.com>, jeff@tct.com (Jeff Witzer) writes:
  13. |> I am trying to respond to the WM_DRAWITEM message for Borland OWNERDRAW 
  14. |> buttons.  I have the following questions:
  15. |> 
  16. |> 1)  How do I tell if the button is pushed or not?  I need to know this to
  17. |>     redraw the button face pushed or not.  lpdis->itemAction and 
  18. |>     lpdis->itemState do not seem to give this information.
  19.  
  20. Yes, they do, although the text in the reference could be clearer.  If the
  21. ODA_SELECT bit in lpdis->itemAction is set then draw the button as "pushed
  22. in" if the ODS_SELECTED bit is set in lpdis->itemState, otherwise draw it
  23. as "normal".
  24.  
  25.  
  26. |> 2)  How can I draw text to the face of the button in either black or dark 
  27. |>     gray AND a light gray background within the text?  I would like to use
  28. |>     something with the power of DrawText () so I can horizontally and 
  29. |>     vertically center the text on the button.  I can draw black text on a 
  30. |>     white background, but this looks funky on a gray button face.
  31.  
  32. The best thing to do is output in TRANSPARENT mode so that you don't have
  33. to know what the button face color is.  Use SetBkMode() to set this.  You
  34. could also use SetBkColor() to setup the text background yourself.
  35.  
  36.  
  37. |>     
  38. |> 3)  How do I tell if the button is ENABLED or not?  I would like to draw gray
  39. |>     text (see #2) if the button is disabled.
  40.  
  41. Well, the ODS_DISABLED bit in lpdis->itemState will be set if the button
  42. should be drawn as disabled.  You could always use the IsWindowEnabled()
  43. function also.
  44.  
  45.  
  46. ----------------------------------------------------------------------------
  47. Tom Brown               |  "She turned me into a newt...
  48. PE Nelson Systems       |                                  ... I got better"
  49. twbrown@pe-nelson.com   |                    Monty Python and the Holy Grail
  50. ----------------------------------------------------------------------------
  51.