### Toolbars

A toolbar is a window whose buttons represent tools or menu items and actions. The toolbar can be located along the top, bottom, or sides of a frame window or can "float" and be positioned anywhere on your desktop. The floating toolbar can then be moved independently or you can "pin" the toolbar to the frame window. You can also have multiple tool bars with a variety of different toolbar buttons using text, bitmaps, or both.

A toolbar button class inherits from ICustomButton and provides drawing behaviour for the buttons in a toolbar. These buttons accept text and a bitmap and can draw bitmaps transparently without the need for a mask bitmap. Bitmaps used in these buttons must be created with one color reserved as the transparent color. By default this color is pink (255, 0, 255) but it can be changed on a per button basis.

The classes that comprise the toolbar are also shipped with common text and bitmaps for frequently used functions found on a toolbar. This ensures a common look among applications and products. In addition, toolbar buttons support a standard style to ensure a consistent look across applications.

The toolbar is essentially a frame extension with buttons that represent common actions. You can add both fly-over help and drag-and-drop support on the toolbar. You can use the direct manipulation support to rearrange the toolbar buttons within an application or add new buttons from a menu (PM only).

The IToolBar class creates and manages a toolbar area for a frame window. You can use the following classes to create tool bars:

IToolBar
  Creates a toolbar, positions that toolbar as a frame extension or as a floating toolbar, and adds and removes toolbar buttons.

  When you construct controls for a toolbar, you must explicitly add them to the toolbar using one of the following member functions:

  - IToolBar::addAsFirst
  - IToolBar::addAsLast
  - IToolBar::addAsPrevious
  - IToolBar::addAsNext
IToolBarButton
  Creates and manages the toolbar button window. IToolBarButton provides support for displaying a bitmap, text, or bitmap and text on a toolbar button. If you specify a particular style for the view of your toolbar button, this style is changed when the button is added to the toolbar if it differs from the toolbar style itself.

The following classes are used by IToolBar and IToolBarButton to implement a toolbar:

IToolBarContainer
  Provides a set canvas for layout control for multiple toolbars within a frame extension. Objects of this class are created automatically by IToolBar objects to house one or more toolbars.
IToolBarTitle
  Creates title bars that are smaller in height than the system title bar. This is created automatically whenever you create a floating toolbar using the IToolBar class.
IToolBarFrameWindow
  Represents a frame window to contain floating toolbars. IToolBarFrameWindows are created when you construct a floating toolbar.

  The maximize and restore button on an IToolBarFrameWindow allows you to expand and collapse the toolbar contained in the toolbar frame window. You can shrink the toolbar to recover screen area when you are not actively using the toolbar and later expand the toolbar to show all toolbar controls.

  IToolBarFrameWindows are visually distinct from other PM frame windows. The title bar height of IToolBarFrameWindows are smaller than other frame windows. In addition, this small frame window contains two buttons that appear where the frame window's minimize and maximize buttons normally are.

  The left button is a toggle button that allows you to pin or attach a toolbar frame window to its owning frame window. This keeps the toolbar in the same location relative to its owner frame window when the owner is moved.

  The right button allows you to expand and collapse the toolbar contained in the toolbar frame window. You can then reduce the size of the toolbar when it is not in use. Select the button again to expand the toolbar and show all the toolbar controls.

ICustomButton
  Provides the base class for IToolBarButtons and creates and manages the custom button window. Custom buttons allow the application to customize the button appearance by providing an ICustomButtonHandler to draw the button.
ICustomButtonDrawEvent
  Provides information about a custom button event for ICustomButtonHandler event-handling functions.
ICustomButtonDrawHandler
  Processess ICustomButton drawing events. Attach objects of this class only to ICustomButton objects.

Direct Manipulation

Adding Toolbars
Providing Help Information
Using Default Direct Manipulation
Enabling Direct Manipulation
Adding Images to Drag Items

IFlyOverHelp
IToolBar
IToolBarButton
IToolBarContainer
IToolBarTitle
IToolBarFrameWindow
ICustomButton
ICustomButtonDrawEvent
ICustomButtonDrawHandler