Win95 Toolbar With Tooltips Common Control

Keywords: WIN95 TOOLBAR TOOLTIPS COMMON CONTROLS WINDOWS 95 OWL APPEXPERT

Windows 95 program demonstrates Common Controls Toolbar with Tooltips.
Use the standard Windows 95 bitmaps and/or custom bitmaps as desired.
Select either large or small bitmaps and add text to toolbar buttons.
Toolbar buttons can be re-arranged using the built-in Customize Toolbar
dialog box, or by (shift) dragging with the mouse. Uses Borland C++
version 4.52, OWL, and AppExpert. This program is FREEWARE uploaded by
the author.

The following changes are made to OWL class behavior to give add the
Toolbar and implement the needed message handlers.

class ToolBar
Derived from TWindow with specific Attributes to make it a toolbar
common control with tooltips. See source file for detailed comments.

ToolCtrlApp::InitMainWindow ()
Common controls are initialized, toolbar is created and inserted
into the frame window.

ToolCtrlApp::CmToolBarLargeBitmaps ()
Toggles between large and small bitmaps through the ToolBar class.

ToolCtrlApp::CmEnToolBarLargeBitmaps ()
Checks and unchecks menu selection.

ToolCtrlApp::CmToolBarShowText ()
Deletes the existing toolbar and creates a new one with or without
text on the buttons.

ToolCtrlApp::CmEnToolBarShowText (TCommandEnabler &tce)
Checks and unchecks menu selection.

ToolCtrlApp::CmToolBarCustomize ()
Calls the Windows 95 built in Customize Toolbar dialog box. Buttons
can also be rearranged using the mouse by Shift-Dragging.

SDIDecFrame::EvCommonControlNotify ()
This function handles the messages sent by Windows 95 common controls.
If WM_NOTIFY is received here it must have been sent by a commoncontrols
customize dialog box directly to the application main window. Forward it
to the child window (Toolbar) identified by pNmhdr->idFrom.

SDIDecFrame::RemoveChild ()
This function is needed because TDecoratedFramm::RemoveChild(child)
is a protected function and can't be called from a derived class.

class ToolBarButtonEnabler
A command enabler for the toolbar. This makes the toolbar automatically
enable and disable the buttons, just like the OWL TControlBar.

TBBUTTON initTbButton[] = {
Initialization parameters for the button bar. Includes one line per
button added. A better way to do this would be to implement a
ToolBar::InsertButton(...) function to insert each button from the
TApplication::InitMainWindow().



