
README.TXT for ToolButton 1.1
September 29, 1992

----------------------------------------------------------------
What is ToolButton?
----------------------------------------------------------------
ToolButton is a custom control for Visual Basic that supports
command and attribute buttons in toolbars.  You can use the
standard button images supplied, and/or you can "roll your own".  A
second custom control, ContextHelp, is bundled with ToolButton to
facilitate implementation of "point and click" style
context-sensitive help. 

Standard button images are supplied for Edit Cut, Edit Copy, Edit
Paste, File New, File Open, File Save, File Print, Help, and
Context Sensitive Help. 

ToolButton can generate six different button faces from one
supplied bitmap.  A command button uses three (Up, Mouse Down, and
Disabled), while an attribute button uses six (former plus Down,
Down Disabled, and Indeterminate).  All you have to do is supply
the "Up" bitmap, and ToolButton takes care of the rest. 

Another nifty feature of ToolButton is the fact that it generates
MouseDown and MouseUp events, so you can put a help message in a
status bar when the user presses a button.  These events are
generated even when the button is disabled. 

Microsoft Word for Windows 2.0 was used as a model for the behavior
of ToolButton and ContextHelp.  Command buttons behave like Word
toolbar buttons, attribute buttons behave like Word ribbon buttons,
and context-sensitive help behaves in a similar fashion to Shift+F1
in Word. 

ToolButton uses the "Buttons & Cursors" code from Microsoft.  This
code is downloadable as IMAGES.ZIP from the WINSDK forum.  I no
longer use the DLL version of this code because source changes
were required to make it compatible with Windows 3.0. 

As mentioned above, ToolButton is compatible with Windows 3.0.
However, the Help Reference requires WinHelp 3.1.

----------------------------------------------------------------
ToolButton Demo
----------------------------------------------------------------
If you would like to see a demonstration of some of ToolButton's
capabilities, load the TOOLDEMO project into Visual Basic.  See
"ToolButton Help Reference" below for instructions on how to view
the Help Reference. 

TOOLDEMO is a just a dumb Notepad clone.  However, it does
demonstrate most of the cool features of ToolButton.  Among the
supported features it does *not* demonstrate are: 

	. Non-standard sized buttons
	. Indeterminate attribute button state
	. Colorful buttons

----------------------------------------------------------------
ToolButton Help Reference
----------------------------------------------------------------
A complete help reference is provided for ToolButton.  You can
access it by double-clicking with the right mouse button on a
ToolButton or ContextHelp control in design mode, by pressing the
help button in TOOLDEMO, or by starting WinHelp manually. 

For all standard VB properties, events, and methods, ToolButton
help is linked to the standard VB help file.  For this to work,
VB.HLP has to be somewhere on your PATH. 

----------------------------------------------------------------
Tips
----------------------------------------------------------------
The ContextHelp control passes the Tag of the control which the
user wants help on.  However, if that control doesn't have a
Tag, or its Tag is an empty string, ContextHelp attempts to
use its parent, then its parent's parent, etc.  You can use this
to your advantage if you have a group of controls which all use
the same section of the help file.  For example, if you have a
frame containing a bunch of option buttons, you can assign the Tag
of the frame, and leave the Tag of the option buttons empty.  If
the user clicks the frame itself or any of the option buttons,
the result will be the same.

Use a control which cannot receive the focus for your toolbars and
status bars.  A good example is the 3D Panel in the Professional
Tool Kit; you get nice shading with this control too.  I didn't do
this in the TOOLDEMO application only because I didn't want to
include more custom controls. 

If you want to display a help message in a status bar for each
ToolButton, put the message in the Tag property at design time.
Print the help message in the MouseDown event, and clear it in
the MouseUp event.  If you have to worry about multiple languages,
load the Tag property at runtime.

Use a control array for all the ToolButtons on a particular toolbar.
This will save you a lot of code.  Toolbar buttons are supposed to
just be shortcuts for menu items, so you can put a Select Case on
the index in the Click event, and call the appropriate menu click
function.

Look at the source code for TOOLDEMO.  Some tricks are there which
I haven't described above, like sizing and positioning all the
controls based on the display device, and intefacing with WinHelp. 

----------------------------------------------------------------
Known problems and limitations
----------------------------------------------------------------
The Esc key does not cancel context-sensitive help, as it does in
Microsoft Word. 

No MouseDown or MouseUp events are generated for the middle or
right mouse buttons.  This is because I didn't want Click to be
generated for these buttons.  I may fix this later by adding a
parameter to the Click and DblClick functions which lets you know
which button was pressed (the standard event functions don't tell
you this). 

A few of the links from ToolButton help to VB help aren't quite
right.  For example, if you click on BackColor, you don't get the
BackColor reference page in VB help.  The reason for this is that I
am using a simple JumpKeyword macro, and it just goes to the first
topic containing that keyword. 

The Tab key in the ToolDemo application activates the Font Italic
menu command.  This is because of a bug in VB which translates the
Tab key into the Ctrl+I accelerator used for this menu command. 

----------------------------------------------------------------
Version History
----------------------------------------------------------------

1.0:
	. First version
	. Over 800 downloads from CompuServe MSBASIC forum

1.1:
	. ContextHelp custom control added
	. Compatible with Windows 3.0
	. Sample bitmap for custom buttons supplied
	. MouseDown/MouseUp generated for disabled buttons
	. Access help reference with double-click of right mouse
	  button instead of single click
	. (About) property 

----------------------------------------------------------------
Credits
----------------------------------------------------------------
ToolButton was created by:

	Brett Foster [CompuServe: 70444,135]
	RR #2
	Almonte, Ontario, Canada
	K0A 1A0

ToolButton is AnyWare:  any contribution is gratefully accepted,
but none is required.  Please send comments and questions via
Section 5 (Visual Basic - Win) of the CompuServe MSBASIC forum
(preferred), or CompuServe mail.

All feedback is GREATLY appreciated!

----------------------------------------------------------------
Supplied Files
----------------------------------------------------------------
TOOLBT.ZIP contains the following files:

. ATTRIBS.BMP	- Sample bitmap of custom button faces used in TOOLDEMO
. README.TXT	- This file
. TOOLBUTT.HLP	- Help reference for ToolButton
. TOOLBUTT.VBX	- The ToolButton custom controls
. TOOLCONS.TXT	- Global constants
. TOOLDEMO.BAS	- Global BAS file for TOOLDEMO
. TOOLDEMO.FRM	- Form file for TOOLDEMO
. TOOLDEMO.MAK	- VB project file for TOOLDEMO
