home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / gbtn02.zip / Buttons.TXT < prev    next >
Text File  |  1997-04-22  |  5KB  |  113 lines

  1.                                  Shaded Buttons
  2.                                  --------------
  3.                                  v. 0.2  (1997)
  4.                                  by Hubert Chan
  5.  
  6. WHAT IT IS
  7. ----------
  8.   It is a new window class that creates buttons with a rounded look by using a
  9. gradient pattern, so that the top of the button is lighter and the bottom is
  10. darker.  Buttons can also have rounded sides, they can have icons, and they can
  11. be vertical (so that the gradient pattern goes from left to right instead of
  12. top to bottom).  IMHO, it looks a lot nicer than normal push buttons.
  13.  
  14.   Included is a sample program, modified from Petzold's "OS/2 Presentation
  15. Manager Programming".  It's a simple window with ten buttons: two in the
  16. middle with arrows pointing in or out, six coloured buttons on top of those
  17. buttons, with either a '<' or '>', one labelled "About", and one at the bottom
  18. which acts as a status bar.  The buttons in the middle, when pushed, either
  19. shrink or enlarge the window.  The coloured buttons change the colour of the
  20. "About" button.  The status bar reports the RGB values for the "About" button.
  21. The "About" button does what you think it does.
  22.  
  23.   I have included the source file.  Feel free to modify it as you please for
  24. your own programs.  If you can fix any bugs, or if you change/add anything that
  25. you think may be helpful, send it to me, and I may include it in future
  26. versions.  Especially, help would be appreciated in getting this to work in a
  27. .DLL and in getting presentation parameters to work.
  28.  
  29. NOTE: Although the file extension for the source file is .CPP, it's just a
  30. normal C file.  The only difference is it uses C++'s '//' comments.
  31.  
  32. HOW TO USE IT
  33. -------------
  34.   Include Buttons.H in your source file.  To register the class with the
  35. Presentation Manager, call RegisterShadedButtonClass.  The class name is
  36. "GradButton", or you can use SHADEDBTNCLASS.  To make a button, call
  37. WinCreateWindow as you normally would to create a button.  Valid button styles
  38. are:
  39.     GBT_NOLEFTLINE  -removes the border on the left side of the button
  40.     GBT_LEFTROUND   -makes the left side rounded
  41.     GBT_NORIGHTLINE -removes the border on the right side of the button
  42.     GBT_RIGHTROUND  -makes the right side rouded
  43.     GBT_VERTICAL    -makes the button vertical (left to right gradient pattern)
  44.                      NOTE: NOLEFTLINE/LEFTROUND will change the top of the
  45.                      button and NORIGHTLINE/RIGHTROUND will change the bottom
  46.                      of the button if VERTICAL is set.
  47.                      (not yet implemented)
  48.     GBT_GRAPHIC     -uses an icon instead of text
  49.                      uses button "text" as the id number of the icon (probably
  50.                      will be changed to be more like the normal push button)
  51.     GBT_NOPUSH      -makes the button non-pushable (eg. to make status bars)
  52. You can also make a button in a dialog box in a resource file.  See
  53. ButtonTest.rc for an example.
  54.  
  55.   When the button is pushed, it will send a WM_COMMAND message to its owner,
  56. just like a normal push button does.  It can also be activated by hitting the
  57. space bar when it has the focus.
  58.  
  59.   To change the colour of the button, send it a GBM_SETCOLOR with mp1 set to
  60. the RGB value of the colour.
  61.  
  62. CHANGES
  63. -------
  64. Since v. 0.1:
  65.   - added a window message (GBM_SETCOLOR) to change the colour of the button
  66.   - added a few buttons to the demo program, and made the status bar do
  67.     something more interresting
  68.   - buttons can now have rounded sides
  69.   - I've decided to make it completely free
  70.   - fixed some spelling mistakes in this file ;-)
  71.  
  72. KNOWN BUGS
  73. ----------
  74.   - presentation parameters don't seem to be working the way they should
  75.     (anyone know of a good book/resource that discusses presparams?)
  76.  
  77. COMING SOON (?)
  78. ---------------
  79. Things I have to add or change:
  80.   - make vertical buttons work
  81.   - use Presentation Parameters to have different colours, fonts, etc.  (Can
  82.     someone please tell me why it's not working for me?)
  83.   - allow text and bitmaps to be in the same button
  84.   - display button differently when active (I haven't decided exactly how it
  85.     should look when active)
  86.   - put it into a .DLL file (I tried, but my linker didn't want to do it)
  87.  
  88. THE AUTHOR
  89. ----------
  90. You can e-mail me at <hyc@gpu.srv.ualberta.ca>, or snail mail me at
  91.   Hubert Chan
  92.   3 Falstaff Ave.
  93.   St. Albert, AB
  94.   Canada, T8N 1V3
  95. Send me comments, criticism, or $$$ ;-)
  96.  
  97. I have a home page set up at http://www.ualberta.ca/~hyc/Programming/.  The
  98. newest version of "Shaded Buttons" will always be there.
  99.  
  100. COST
  101. ----
  102.   Free.  I had considered eventually charging something once I had everything
  103. working the way I wanted it to, but I decided against it.  Of course, if you
  104. really want to send me something...
  105.  
  106. WHERE TO GET IT
  107. ---------------
  108. From my home page: http://www.ualberta.ca/~hyc/Programming/
  109. From Hobbes: http://hobbes.nmsu.edu or ftp://hobbes.nmsu.edu
  110. These are the only places that I will put the files in.  Feel free to upload it
  111. to other sites.
  112.  
  113.