Function group/class: Toolbar/wxToolBar
A toolbar is an array of bitmap buttons, implemented by drawing bitmaps onto a canvas, instead of using the native button implementation. Since the toolbar inherits from canvas, you can use all canvas functions on a toolbar object.
Each tool can be specified as a normal button, on/off toggle, and disabled or enabled. Tool layout is automatic or manual. Left click and right click events may be intercepted, using OnLeftClick and OnRightClick callbacks. The OnMouseEnter callback is used to update the status line (for example) with help text as the mouse moves over the tools. See window-add-callback for details on these callbacks.
Normal subwindow geometry considerations are applicable (i.e., in a frame with more than one subwindow, you must resize the subwindows when you receive an OnSize event from the frame). The exception is for Multiple Document Interface (MDI) frames under Windows, where you must call frame-set-tool-bar to associate the toolbar with the MDI client window, and after initializing the toolbar height, further resizing is unnecessary.
Toolbars are often displayed as a horizontal strip under the menubar, or in a floating frame. If you wish to draw a border for the toolbar, you must intercept the toolbar's OnPaint handler. In this overriden callback, you must first call the toolbar's toolbar-on-paint function to draw all the tools, and then draw the border onto the toolbar canvas.
Note that under Windows, you must supply bitmaps that are 16 pixels wide and 15 pixels high: they will be placed on a tool button that is 24 by 22 pixels. If you wish to supply bitmaps of a different size, you must call toolbar-set-default-size to set the overall tool button size (as opposed to the bitmap size), or use the toolbar in non-button-creation mode by supplying an extra argument to toolbar-create to disable this functionality.
Note also that in some circumstances, especially for the WIN32 version of wxCLIPS, there are problems with the buttonbar (the symptoms are bitmaps scrambled randomly). If this happens, revert to the normal toolbar by passing 0 in the create-buttons argument to toolbar-create, or download a Windows 95 version of wxCLIPS.
Under X, tool buttons are the same size as the supplied button and there is no need to call toolbar-set-default-size.
Canvas callbacks apply, plus:
Different toolbar code kicks in according to the platform, and the arguments given to tool-bar-create.
Note: under Windows 95, a wxButtonBar cannot be moved to any position other than the top-left of the frame.