WoButtonBar Function
Creates a predefined, two-row button bar that can be included in a VDA Tool.
Usage
bb_parent = WoButtonBar(parent, toolname, [buttons])
Input Parameters
parent — Specifies the widget ID of the parent of the button bar (long). This is the ID of the row/column container that holds the row/column container with the drawn buttons. (See the Discussion.)
toolname — (string) Specifies the unique name of the VDA Tool to which the button bar is to be attached.
buttons — (optional) Specifies an unnamed structure containing the button definitions. This parameter is not needed if the Graphics keyword is specified. See the Discussion for more information.
Returned Value
bb_parent — The parent widget ID of the bank of buttons (long). This is the ID of the row/column container that holds the drawn buttons. (See the Discussion.)
Keywords
Graphics — If nonzero, places a set of predefined buttons in the VDA Tool. See the Discussion section for more information.
Measure — Specifies the number of columns of buttons (for a vertical box) or rows (for a horizontal box).
Position — A two-element array specifying the x, y coordinates of the buttonbar inside the bulletin board widget. (Default: [0,0])
Radio — If nonzero, causes the buttons to behave like radio buttons, where only one button can be selected at a time.
Sensitive — A scalar or array specifying the initial sensitivity of the button or buttons. A value of 0 makes the button insensitive; 1 makes the button sensitive. Use WoButtonBarSetSensitivity to change the sensitivity after the buttons are created.
Spacing — Specifies the amount of space in pixels between buttons. The default is 0.
Vertical — When nonzero, creates a vertically aligned column of buttons.
Attachment Keywords
Bottom — If a widget ID is specified (for example, Bottom=wid), then the bottom of the button bar is attached to the top of the specified widget. If no widget ID is specified (for example, /Bottom), then the bottom of the button bar is attached to the bottom of the parent widget.
Left — If a widget ID is specified (for example, Left=wid), then the left side of the button bar is attached to the right side of the specified widget. If no widget ID is specified (for example, /Left), then the left side of the button bar is attached to the left side of the parent widget.
Right — If a widget ID is specified (for example, Right=wid), then the right side of the button bar is attached to the left side of the specified widget. If no widget ID is specified (for example, /Right), then the right side of the button bar is attached to the right side of the parent widget.
Top — If a widget ID is specified (for example, Top=wid), then the top of the button bar is attached to the bottom of the specified widget. If no widget ID is specified (for example, /Top), then the top of the button bar is attached to the top of the parent widget.
Discussion
The standard button bar is created as a set of drawn buttons inside a row/column container, which is placed inside another row/column container widget. The use of two row/column containers allows a standard button bar to be created that has multiple banks of buttons where each bank can have unique spacing and behavior (e.g., radio buttons).
Using the Standard Button Bar
If the Graphics keyword is specified, a predefined set of standard buttons is provided automatically. These predefined buttons are equipped with functional callbacks. If you choose to use the predefined set of buttons in your application, you do not need to modify the underlying structure of the buttons or the callbacks. Both the predefined callbacks and the underlying button structures are defined in files in the vdatools subdirectory of the Standard Library:
wographicsbuttons.pro — Uses unnamed structures to define pixmaps and callbacks for the buttons.
wographicsbuttonscb.pro — Contains the callback routines for each button.
Using Your Own Button Bar
If you do not choose to use the standard button bar, then you can use these files as templates for creating a customized button bar. Use the optional button parameter to specify the unnamed structure defining the pixmaps and callbacks for the custom button bar. For a customized button bar, you will also have to write and include appropriate callback procedures in your application.
An unnamed structure has the following general definition:
x = {, tag_name1: tag_def1, tag_namen: tag_defn}
The following tag names and tag definitions can be used in the unnamed structure used to define buttons.
LAYOUT_NAME: 'name' — Specifies the name of the row/column layout used to organize the buttons.
DESCRIPTOR: 'name' — Specifies the a descriptor name for the button. A descriptor is a string used to identify a button. This string is also used as the button’s widget ID.
CALLBACK: 'name' — Specifies the name of the callback routine for the button.
STATUS_CALLBACK:
'name' — Specifies the name of the routine that prints the name of the button when the pointer passes over the button.
USERDATA: variable — Specifies a variable to pass to the callback when the button is pressed.
INSENSITIVE_PIXMAP:
'pathname' — Specifies the full pathname of the insensitive pixmap for the button.
PIXMAP:
'pathname' — Specifies the full pathname of the sensitive pixmap for the button.
For an example of an unnamed structure of button definitions, see the file wographicsbuttons.pro in:
(UNIX) <wavedir>/lib/vdatools
(WIN) <wavedir>\lib\vdatools
Where <wavedir> is the main PV‑WAVE directory.
note | For information on how to use the functions on the standard button bar, run one of the graphical VDA Tools, such as WzPlot, and read about the button bar in the Help. |
Example
This call to WoButtonBar is taken from the WzPlot VDA Tool:
(UNIX) <wavedir>/lib/vdatools/wzplot.pro
(WIN) <wavedir>:\lib\vdatools\wzplot.pro
; Creates a standard button bar for a VDA Tool.
tb = WoButtonBar(layout, unique_name, Top=bar, /Graphics, $
/Left, /Right)
See Also