fgl_dialog_setactionlabel()

 

Assigns a label to an action on the toolbar in the current interactive instruction.

 

Syntax:

 

CALL fgl_dialog_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_dialog_setactionlabel() function is used to assign a label (with an icon, image or both) to an action on the toolbar in the current interactive instruction.

 

In the example below, an action is set for a label in the current dialog:

 

MAIN

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

    MENU "m1"

    BEFORE MENU

        CALL setMyActionView_w()

        ON ACTION "ActName1"

        CALL setMyActionView_w2()  

        COMMAND "exit"

        EXIT MENU

    END MENU

END MAIN

 

FUNCTION setMyActionView_w()

    CALL fgl_dialog_setactionlabel("ActName1","LABEL_1", "cup", 1, TRUE, "tooltip1")

END FUNCTION

 

FUNCTION setMyActionView_w2()

    OPEN WINDOW w2 at 15,15 WITH 10 ROWS, 40 COLUMNS

    MENU "m2"

        BEFORE MENU

        CALL fgl_dialog_setactionlabel("ActName2","LABEL_2", "cup", 1, TRUE, "tooltip2")

        COMMAND "exit"

        EXIT MENU

    END MENU

    CLOSE WINDOW w2

END FUNCTION

 

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

CALL fgl_dialog_setactionlabel("myAct", "")

 

 

Related articles:

Action Basics

The List of the Predefined Actions

fgl_setactionlabel()

fgl_setkeylabel()

fgl_getkeylabel()