README.TXT for ToolButton 1.0 ------------------------------------------------------------------------ What is ToolButton? ------------------------------------------------------------------------ ToolButton is a custom control for Visual Basic that uses BTTNCUR.DLL to support command and attribute buttons in toolbars. You can use the standard button images supplied, and/or you can "roll your own". BTTNCUR.DLL is a licensed redistributable dynamic-link library that provides applications with new standard toolbar button images as defined in the "The Windows Interface: An Application Design Guide" and "The Windows Interface: A Visual Design Guide." It is supplied by Microsoft with these books, and is also available for download on the WINSDK forum (look for IMAGES.ZIP). 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. ------------------------------------------------------------------------ Credits ------------------------------------------------------------------------ ToolButton was uploaded by the author: Brett Foster [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 the MSBASIC forum or Compu$erve mail. ------------------------------------------------------------------------ Supplied Files ------------------------------------------------------------------------ TOOLBUTT.ZIP contains the following files: . README.TXT - This file . TOOLBUTT.VBX - The ToolButton custom control . TOOLBUTT.HLP - Help reference for ToolButton . TOOLDEMO.MAK - Demonstration VB project . TOOLDEMO.BAS - Global BAS file for TOOLDEMO . TOOLDEMO.FRM - Form file for TOOLDEMO . BTTNCUR.DLL - Described above ------------------------------------------------------------------------ ToolButton Demo ------------------------------------------------------------------------ If you would like to see a demonstration of some of ToolButton's capabilities, load the TOOLDEMO project into Visual Basic. If you display the TOOLDEMO form in design mode, you can click on any of the ToolButtons with the right mouse button to access the online help reference. TOOLDEMO is a just a dumb Notepad clone. However, it does demonstrate most of the cool features of ToolButton. Among the features it does *not* demonstrate are: . Non-standard sized buttons . Indeterminate attribute button state . File Print and Context-Sensitive Help buttons . Colorful buttons ------------------------------------------------------------------------ ToolButton Help Reference ------------------------------------------------------------------------ A complete help reference is provided for ToolButton. You can access it by clicking with the right mouse button on a ToolButton 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 ------------------------------------------------------------------------ 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. ------------------------------------------------------------------------ Known problems and limitations ------------------------------------------------------------------------ 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.