Contents of the README.TXT file
Bitmap Buttons by Daniel Thomas Donated to the public domain
You should have 4 files:
ReadMe.txt this file
Buttons.pas Bitmap Buttons unit
ButnTest.pas sample program
ButnTest.res sample resource file
The Buttons Unit defines 2 objects for use in creating and handling Bitmap
Buttons. A button has 3 general appearances:
note: the other states, "selected" and "default" are not currently
handled - see the NOTES section, below
The tSingleBitmapButton object uses one bitmap, and draws lines to simulate
the three states. You create a single bitmap for the button, with a gray
background. You do not paint the "edges" or the border, but leave room for
them in the gray background. You can create the button bitmaps in virtually
any size (within reason) - this holds true for tMultiBitmapButtons, also.
The tMultiBitmapButton object uses 3 bitmaps, one for each state. The
purpose for this object is to allow you complete control over how the
button will look in each of its states. For instance, a "pressed" button
doesn't have to look like every other pressed button - be imaginative!
You create each button in its entirety (don't you wish TPW had a spelling
checker?), including the border and edges. It would be advisable to make
them all the same size (the object assumes that they are).
The sample program ButnTest.pas includes examples of both types of buttons.
Just compile it and run. In the sample program, clicking on one button will
disable and re-enable the other button, so you can see what a "disabled"
button looks like.
The ButnTest.res file has the bitmaps for these buttons.
THINGS LEFT TO DO:
There isn't a keyboard interface.
There is nothing to differentiate a "default" button. My suggestion
would be for tSingleBitmapButtons to draw a thicker border (thicker
towards the inside, not the outside), and tMultiBitmapButtons to have
an additional bitmap for this state - remember that the purpose of
tMultiBitmapButtons is to give total control to the programmer.
There is nothing to show a "selected" button. In normal buttons, this is
shown by a dotted-line box around the text. I would recommend something
like a dotted line box for tSingleBitmapButtons, and an additional bitmap
Painting on dialogs is not currently supported. If you're going to take
into account changing system font sizes, etc, it can get complicated.
Finally, you are free to use this code in any way you wish. No
restrictions (although if you change something and post it to a BBS, please
indicate your changes - I don't want someone blaming me for your lousy
If you make any improvements, for instance the "things left to do", I would
really appreciate it if you'd send them to me. Some day I hope that this
unit will be complete. Right now, it does what *I* need it to do .
2301 N. Huron Circle
Placentia, CA 92670