<<

Contents

Search

>>

 

ADD_TOOLBAR

 

 

Function

 

 

Syntax:

ADD_TOOLBAR(<Handle>,<Parameter>,<Macroname>[,<Draggable>])

 

<Handle>

= <NUM-EXPRESSION>

<Parameter>

= <STRING-EXPRESSION>

<Macroname>

= <MACRONAME>

<Draggable>

= <NUM-EXPRESSION>

 

 

Meaning:

ADD_TOOLBAR creates an additionaö Toolbar.

 

In the main window, in windows and in splitwindows additional toolbar can be created.

 

ADD_TOOLBAR returns a number which identifies the toolbar and which has to be used to remove the toolbar with REMOVE_TOOLBAR .

 

In the case of an error ADD_TOOLBAR returns the following error codes:

-1: The window <HANDLE> doe not exist
-2: Window not found
-3: It is not possible to create a toolbar in the window <HANDLE>.

 

Parameter:

Handle

Specifies the window in which the additional toolbar is shown. If <handle> <=0, the toolbar is displayed in the main window, otherwise <handle> must either contain a window depth or the identification number of a NOWAIT window.

In splitwindows the splithandle has to be specified.

Parameter

Contains the entries (separated by semicolons), which specify the images to be displayed. An empty entry creates an additional distance to the next image.

 

Each entry has the following structure:

 [#][@]<IMAGE NAME>[,<IMAGE NAME OVER>[,<IMAGE NAME SELECTED> [,<IMAGE NAME OVER SELECTED>[,<NOAUTOTOGGLE>]]]]  |  <HELPTEXT> | <ID>

 

Attention: The character | acts as separator. Therefore <HELPTEXT> and <ID> must not contain this character.

 

If the first character of the entry is "#", the image is positioned right-justified in the icon bar, otherwise left-justified.

 

<IMAGE NAME> specifies the image to be displayed. <IMAGE NAME> can be specified with or without @.

 

<IMAGE NAME OVER> specifies the image to be displayed when the mouse cursor is over the image. <IMAGE NAME OVER> can be specified with or without @.

 

<IMAGE NAME SELECTED> specifies the image to be displayed when the icon has been selected by pushing. <IMAGE NAME SELECTED> can be specifies with or without @. If an <IMAGE NAME SELECTED> is specified, the icon works like a 2-phase button: It is selected by clicking on it and deselected by clicking on it again.

 

If the parameter <NOAUTOTOGGLE> is missing or <NOAUTOTOGGLE> = 0, clicking another icon of the toolbar does not deselect the icon.

 

If the parameter <NOAUTOTOGGLE> is specified and has a numeric value <> 0, the icon is deselected only by clicking the icon again and not by clicking another icon of the toolbar.

 

When the macro <macroname> is executed EBUS_DATA$ contains the current state of the icon: "1" means selected, "0" means deselected.

 

<IMAGE NAME OVER SELECTED> specifies the image to be displayed when the mouse cursor is over the image and the icon is selected. <IMAGE NAME OVER SELECTED> can be specified with or without @.

 

<HELPTEXT> is the helptext to be displayed when the mouse cursor is over the image.

 

<ID> is an identification string which is stored in the variable EBUS_DATA$ when the icon is clicked with the mouse.

 

Macroname

The macro is executed if an icon of the icon bar is clicked with the mouse. EBUS_DATA then contains the number of the icon (counted from 1 from left to right, empty entries are sloe counted) and EBUS_DATA$ contains the <ID>.

 

EBUS_TRANSFER contains the state of the icon: 1 means selected, 0 means deselected. If no <IMAGE NAME SELECTED> is specified with the icon, EBUS_TRANSFER always contains 0.

 

Draggable

= 0: The toolbar ist not draggable.

<> 0: The toolbar is draggable.

 

If this parameter is missing the toolbar is draggable.

 

Attention: This parameter has no effect with Html programs. In Html programs toolbars are not draggable.

 

Sample:

/* Create a toolbar with 2 Icons in the main window with additional space

NR% = ADD_TOOLBAR(0,"@ebussave.gif|Save|Icon-1;;"+

                    "ebusnew.gif|New|Icon-2",MACRO.TOOLBAR)

 

See also:

REMOVE_TOOLBAR

EBUS_TOOLBAR_ADJUST_WINDOW

ADD_TOOLBAR_ICON

REMOVE_TOOLBAR_ICON

ENABLE_TOOLBAR_ICON

EBUS_DATA

EBUS_DATA$