home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / C++ / Code Resources / 3D Buttons CDEF 1.0b4 / Source / 3D Buttons CDEF source / 3D Buttons CDEF Source Read Me next >
Encoding:
Text File  |  1994-07-31  |  2.0 KB  |  37 lines  |  [TEXT/ttxt]

  1. 3D Buttons CDEF, by Zig Zichterman
  2. 1.0b4 31 July 1994
  3.  
  4. 3D Buttons is a control definition (CDEF) that implements the 3D interface as suggested in develop issue 15. When drawing on a 8-bit (or breater) color device (in a color GrafPort), 3D Buttons draws in grey. 3D Buttons drops to normal 2D drawing for black and white (or less than 8 bits of color).
  5.  
  6. The source for the 3D Buttons CDEF is broken into
  7. •  the main entry function:
  8.       3D Buttons CDEF.cp
  9. •  classes for 4 button variants:
  10.       LGBPushButtons
  11.       LGBCheckbox
  12.       LGBRadio
  13.       LIconButton
  14. •  utility functions:
  15.       LGBControl
  16.       LGBDeviceIterator
  17.       UGBDraw
  18.  
  19. [The "GB" stands for "Grey Buttons," which is what I originally called the project.]
  20.  
  21. I wrote this function in C++, but without any C++ features that require the C++ runtime engine. The CDEF is smaller and faster without all that overhead.
  22.  
  23. Every function call into the CDEF comes through the main entry point in 3D Buttons CDEF.cp. Main() switches on the button variation and passes control to the entry point for one of the 4 button variations.
  24.  
  25. Each button variation has a main entry point that switches on the CDEF message. There are only 4 messages that button CDEFs pay attention to: draw, hit test, and 2 messages to calculate the button region.
  26.  
  27. Most of the code in each button variation is devoted to drawing the buttons. Drawing functions just save the current drawing environment, then loop through the device list, drawing either color or black and white depending on the device (screen) depth.
  28.  
  29. Change History
  30. 1.0b4—31 July 1994
  31. Bug Fix—save and restore the pen color across draws
  32. Draw 3D buttons on 4-bit devices if those devices are also greyscale, not color.
  33. 1.0b3—29 July 1994
  34. Added offscreen GWorld support so the button titles would stop that annoying flashing. Many thanks to one of my users for pointing it out.
  35. 1.0b2—20 July 1994 (never released)
  36. Call PenNormal() before starting any draw. Alerts would leave the pensize at (2,2) for the default button, which tended to make OK buttons look awful in color.
  37.