Edits the properties of a toolbar.



toolbar, button, method, fg, bg, actionkey, insert, redraw, "label", "command", "message")



An integer, the target toolbar:


Main Worksheet toolbar


Activated Window toolbar.


Data cursor toolbar


Drawing toolbar



An integer, the location, counted from left, starting from 1. Set to -1 to place a button as the last button on the toolbar.



An integer, the the method for rendering the buttons on the screen:


BIT MAPPED. Button is rendered using either its pre-installed bitmap or the filename specified by "label".


DRAWN. Button is rendered using its pre-installed drawn figure.


WRITTEN. Button is a string, supplied by "label."


NONE. The button is removed from the screen.



Optional. An integer, the foreground color. Color mapping varies, depending on method. Set to -1 to specify the default.



Optional. An integer, the background color. Color mapping varies, depending on method. Set to -1 to specify the default.



Optional. An integer. Returns a single character code to the application. Keys are integer key codes, based on ASCII. Non-ASCII keys are private to the application. Action keys are used internally in the application and are mentioned here for completeness, but "command" strings (below) are the preferred method of customization.



Optional. An integer, the new button insertion mode for the location specified by button.


Overwrite the existing button at the specified location.


Insert the new button at the specified location (default).



Optional. An integer, the button redraw mode.


Do not redraw.


Redraw immediately (default).



A string to label the button under the WRITTEN rendering method. For BIT MAPPED (method 1), this is the path to a loadable bitmap file.



A string. This is the action taken when the button is pressed. Valid strings include any commands that can be executed in the current state of the application.



Optional. A string. This help message is displayed on the status line when the mouse is held over the button. Defaults to the button label.


toolbar(1, -1, 4, LRED, " Noise ", "gnorm(1000,1)")


Adds a button called "Noise", to the end of the main Worksheet toolbar. When pressed, the button creates a 1000 point random noise series in the current Window.


toolbar(1, -1, 8)


removes the button.


Add a button called "Stats", to the main worksheet toolbar, which pops up the "Summary Statistics" menu:


toolbar(1, 8, 4, RED, " Stats", '_MF("")')


Likewise, you can convert the "style" button to a menu of choices:


toolbar(1,5,2, " ", '_MF("")')


toolbar(1, -1, 1, gethome + "data\charts.png", "grand(7, 1);bars;bargap(0);rainbow", "Bars")


Adds a bitmap button to the end of the main Worksheet toolbar. When pressed, the button creates a 7 point bar chart in the current Window.


"Command", if present, overrides actionkey. An empty command string (" ") will allow the actionkey, if any, to take precedence.


BIT MAPPED rendering may not be available on all platforms.


It is possible to install buttons that are inappropriate to the state of the worksheet (e.g., a button to fetch new data, which would be fine on the main Worksheet toolbar, would be inappropriate to the data cursor toolbar).


If a toolbar button function requires quotes, use double quotes, then surround the entire string with single quotes.


To make a toolbar button permanent, add the toolbar function to the splmain() routine in the file dadisp.spl. For example, in dadisp.spl:


// dadisp.spl



    toolbar(1, 8, 4, LRED, " Stats", '_MF("")')



The button now appears on the toolbar for every DADiSP session.


See $INITWKS for a macro that executes when a Worksheet is loaded. $INITWKS can be used to customize specific Worksheets with automatically loading toolbar buttons.

See Also: