Methods are used to dynamically manage the tool bar: you can add or delete tools, and modify all their characteristics.
Directions assigned to method parameters:
(I) |
Input |
(O) |
Output |
List of return codes for the various methods
_BAR_ERR_OK |
Method run successfully. |
_BAR_ERR_PARAM |
One or more invalid parameters. |
_BAR_ERR_TYPE |
One or more of the method's variables is the wrong Adelia type. |
_BAR_ERR_EXEC |
Anomaly during execution (this should never happen). |
_BAR_ERR_STRING_LENGTH |
The method must return a character string longer than the Adelia variable. |
Adds a tool in a specified position.
The ToolName parameter must be a name consisting only of letters, digits and the underscore character (_). It must not already have been used by another tool.
The Position parameter must be set to between 1 and the number of tools in the tool bar, or have a predefined value.
Syntax | ||||||||||||||||||||||||
CALL_METHOD ObjectName ADD_TOOL Position ToolName Styles ReturnCode |
||||||||||||||||||||||||
Parameters |
||||||||||||||||||||||||
Position (I) |
NUM_BIN_2 |
Position of the new tool. Possible value: _BAR _ POS_END : The tool is added at the end. |
||||||||||||||||||||||
ToolName (I) |
ALPHA(30) |
Tool name. |
||||||||||||||||||||||
Styles (I) |
NUM_BIN_4 |
Combination (sum) of the new tool's styles. Select a coherent combination of the following styles: Behavior styles: Select just one of the following styles:
Position styles (only for toggles and options): Select just one of the following styles:
Other styles which can be combined with each other and with the previous ones:
|
||||||||||||||||||||||
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK |
NUM_BIN_4 |
Styles |
NUM_BIN_4 |
ReturnCode |
/* Creating a Save button which is visible and inactive in first position
Styles=_BAR_BTN_STL_BUTTON + _BAR_BTN_STL_VISIBLE
CALL_METHOD MY_BAR ADD_TOOL 1 'SAVE_BTN' Styles Returncode
/* Creating a toggle switch button which is visible, active and depressed in second position
(eg. for an automatic saving)
Styles=_BAR_BTN_STL_TOGGLE + _BAR_BTN_STL_DOWN + _BAR_BTN_STL_VISIBLE + _BAR_BTN_STL_ACTIVE
CALL_METHOD MY_BAR ADD_TOOL 2 'AUTO_SAVE_BTN' Styles Returncode
Adjusts the tool bar's position and size according to its content (i.e. the number of buttons and their text) and its properties (i.e. automatic placement, multiline setting and text position). This method is useful when the tool bar's automatic placement type sets its width according to the width of the parent window. This method therefore must be called whenever the user resizes the parent window.
Syntax | ||
CALL_METHOD ObjectName AUTO_SIZE ReturnCode |
||
Parameters |
||
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK |
Deletes the tool with the specified name.
Syntax | ||
CALL_METHOD ObjectName DELETE_TOOL ToolName ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM |
Returns a tool's image in an Adelia IMAGE variable. The image is in the DIB format.
Syntax | ||
CALL_METHOD ObjectName GET_TOOL_BITMAP ToolName Bitmap ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
Bitmap (O) |
IMAGE |
Image used for the tool. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM |
Returns a tool's description.
Syntax | ||
CALL_METHOD ObjectName GET_TOOL_DESCRIPTION ToolName Description ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
Description (O) |
ALPHA(n) |
Description of the tool. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM _BAR_ERR_TYPE |
Returns the name of the tool located in the specified position.
The Position parameter must be set to between 1 and the number of tools in the tool bar.
Syntax | ||
CALL_METHOD ObjectName GET_TOOL_NAME Position ToolName ReturnCode |
||
Parameters |
||
Position (I) |
ALPHA(30) |
Position of the tool. |
ToolName (O) |
ALPHA(30) |
Name of the tool. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM |
Returns the styles used for a tool.
Syntax | ||
CALL_METHOD ObjectName GET_TOOL_STYLES ToolName Styles ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
Styles (O) |
NUM_BIN_4 |
Styles of the tool. Possibles values: Refer to the ADD_TOOL method above. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM |
Returns the tool's text.
Syntax | ||
CALL_METHOD ObjectName GET_TOOL_TEXT ToolName Text ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
Text (O) |
ALPHA(n) |
Text of the tool. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM _BAR_ERR_TYPE _BAR_ERR_STRING_LENGTH |
Returns the text used for the tool's Tooltip.
Syntax | ||
CALL_METHOD ObjectName GET_TOOLTIP_TEXT ToolName TooltipText ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
TooltipText (O) |
ALPHA(n) |
Text of the tooltip. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM _BAR_ERR_TYPE _BAR_ERR_STRING_LENGTH |
Note: This method is not available in Mobile generation for Pocket PC and Smartphone platforms.
Changes the tool's styles by adding and removing styles.
Syntax | ||
CALL_METHOD ObjectName MODIFY_TOOL_STYLES ToolName AddedStyles RemovedStyles ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
AddedStyles (I) |
NUM_BIN_4 |
Styles added to the tool. Possibles values: Refer to the ADD_TOOL method above. |
RemovedStyles (I) |
NUM_BIN_4 |
Styles removed from the tool. Possibles values: Refer to the ADD_TOOL method above. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM |
NUM_BIN_4 |
AddedStyles |
NUM_BIN_4 |
RemovedStyles |
NUM_BIN_4 |
ReturnCode |
/* Deactivating the Save button
RemovedStyles=_BAR_BTN_STL_ACTIVE
CALL_METHOD MY_BAR MODIFY_TOOL_STYLES 'SAVE_BTN' 0 RemovedStyles Returncode
/* Changing a tool behaving as a depressed toggle button
/* The other styles remained unchanged
AddedStyles=_BAR_BTN_STL_TOGGLE + _BAR_BTN_STL_DOWN
RemovedStyles=_BAR_BTN_STL_BUTTON
CALL_METHOD MY_BAR MODIFY_TOOL_STYLES 'TOGGLE_BTN' AddedStyles RemovedStyles Returncode
Sets a tool's image from an IMAGE-type Adelia variable.
The content of the variable is either an image in DIB (Device-Independent Bitmap) format or a file containing an image with one of the following extensions: bmp, cut, emf, eps, ico, gif, iff, jpg, jp2, mng, pbm, pcx, pgm, png, ppm, psp, tif, tga, wmf.
Syntax | ||
CALL_METHOD ObjectName SET_TOOL_BITMAP ToolName Bitmap ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
Bitmap (I) |
IMAGE |
Image used for the tool. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM |
Uses a bitmap file to set a tool's image.
Syntax | ||
CALL_METHOD ObjectName SET_TOOL_BITMAP_FROM_FILE ToolName File ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
File (I) |
ALPHA(n) |
Full name of the file containing the image. The following extensions are supported for the Bitmap file: bmp, cut, emf, eps, ico, gif, iff, jpg, jp2, mng, pbm, pcx, pgm, png, ppm, psp, tif, tga and wmf. With the Adelia Mobile runtime, the only formats allowed are: bmp, gif, jpg, png and ico. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM _BAR_ERR_TYPE |
Sets an IMAGE accessible from a URL address as a tool's image.
The following image file extensions are supported: bmp, cut, emf, eps, ico, gif, iff, jpg, jp2, mng, pbm, pcx, pgm, png, ppm, psp, tif, tga, wmf.
Syntax | ||
CALL_METHOD ObjectName SET_TOOL_BITMAP_FROM_URL ToolName ImageUrl ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
ImageUrl (I) |
ALPHA(500) |
URL address specifying the Image file. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: -1: Error while adding image. >0: Error while executing http query. 0: Operation completed successfully. |
Conditions for use | None. |
Note: This method is not implemented in Java and Mobile generation.
Sets the tool's description. This text can be used to fill a status bar, for example.
Syntax | ||
CALL_METHOD ObjectName SET_TOOL_DESCRIPTION ToolName Description ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
Description (I) |
ALPHA(n) |
Description of the tool. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM _BAR_ERR_TYPE |
Sets the tool's styles.
Syntax | ||
CALL_METHOD ObjectName SET_TOOL_STYLES ToolName Styles ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
Styles (I) |
NUM_BIN_4 |
Styles used for the tool. Possibles values: Refer to the ADD_TOOL method above. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM
|
NUM_BIN_4 |
Styles |
NUM_BIN_4 |
ReturnCode |
Specifies the tool's text.
Syntax | ||
CALL_METHOD ObjectName SET_TOOL_TEXT ToolName Text ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
Text (I) |
ALPHA(n) |
Text assigned to the tool. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM _BAR_ERR_TYPE |
Specifies the text for the tool's Tooltip.
Syntax | ||
CALL_METHOD ObjectName SET_TOOLTIP_TEXT ToolName TooltipText ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
TooltipText (I) |
ALPHA(n) |
Text used in the tooltip. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM _BAR_ERR_TYPE |
Note: This method is not available in Mobile generation for Pocket PC and Smartphone platforms.
Tests whether a tool has one or more styles. The method returns the value *TRUE if the tool has all the styles in the specified combination.
Syntax | ||
CALL_METHOD ObjectName TOOL_HAS_STYLES ToolName Styles Possession ReturnCode |
||
Parameters |
||
ToolName (I) |
ALPHA(30) |
Tool name. |
Styles (I) |
NUM_BIN_4 |
Styles used for the tool. Possibles values: Refer to the ADD_TOOL method above. |
Possession (O) |
BOOL |
*TRUE if the tool has all the specified styles, else *FALSE. |
ReturnCode (O) |
NUM_BIN_4 |
Method's return code. Possibles values: _BAR_ERR_OK _BAR_ERR_PARAM |
NUM_BIN_4 |
Styles |
BOOL |
Possession |
NUM_BIN_4 |
ReturnCode |
/* When the tool is an active and visible button
Styles=_BAR_BTN_STL_BUTTON + _BAR_BTN_STL_VISIBLE
CALL_METHOD MY_BAR TOOL_HAS_STYLES 'BTN' Styles Possession Returncode
/* Possession is then set to *TRUE
Styles=_BAR_BTN_STL_VISIBLE + _BAR_BTN_STL_ACTIVE
CALL_METHOD MY_BAR TOOL_HAS_STYLES 'BTN' Styles Possession Returncode
/* Possession is then set to *TRUE
Styles=_BAR_BTN_STL_TOGGLE + _BAR_BTN_STL_VISIBLE
CALL_METHOD MY_BAR TOOL_HAS_STYLES 'BTN' Styles Possession Returncode
/* Possession is then set to *FALSE