fgl_setactionlabel()

 

Assigns a label to an action.

 

Syntax:

 

CALL fgl_setactionlabel("ActionName" STRING, "LabelName" STRING, "icon" STRING, Order# INTEGER, IsStatic BOOLEAN, "ToolTip" STRING)

 

Arguments:

 

1. Action

The name of the action.

2. Label

The label name. 

3. Icon (Optional)

A relative (../images/icon.png) or absolute path (qx://application/querixlogo.png) to an icon. If the icon file is not attached to the program, it won’t be displayed to the label.

4. Order (Optional)

An integer value or variable value  which indicates where the label will be positioned on the toolbar.

5. IsStatic (Optional)

Defines if an action toolbar button is visible, even if a default action cannot be triggered at the moment.

The default value is FALSE.

6. Tooltip (Optional)

Tooltip information is shown when the cursor points to a label.

 

Usage and examples:

 

The fgl_setactionlabel() function assigns a label (with an icon, image or both) to an action.  

 

Here is an example illustrating how an action label can be set and manipulated:

 

MAIN

    OPEN WINDOW w at 20,20 WITH 10 ROWS, 40 COLUMNS

    MENU "m1"

    BEFORE MENU

        CALL setMyActionView()

        ON ACTION "ActName1"

        CALL fgl_winmessage("Information1","info_text","info")

        ON ACTION "ActName2"

        CALL fgl_winmessage("Information2","info_text2","info")

        COMMAND"exit"

        EXIT MENU

    END MENU

END MAIN

 

FUNCTION setMyActionView()

CALL fgl_setactionlabel("ActName1","DisplayInfo", "cup", 1, TRUE, "tooltip1")

CALL fgl_setactionlabel("ActName2","DisplayInfo2", "cup", 1, TRUE, "tooltip2")

END FUNCTION

 

You can disable the action label by calling the function as shown below:

CALL fgl_setactionlabel("myAct", "")

 

If the dialog keyword is added to the function name, such function affects only the toolbar in the currently active form. See fgl_dialog_setactionlabel() for more information.

 

 

Related articles:

Action Basics

List of Predefined Actions

fgl_dialog_setactionlabel()

fgl_setkeylabel()

fgl_getkeylabel()

Using Functions to Manipulate Toolbar at Runtime