KUIML
Blue Cat's User Interface Programming Language
MENU_ITEM

Description

Adds an item to a parent POPUP_MENU or MENU_ITEM.

Inherited Attributes

None.

Specific Attributes

Name Value Type Default Value Description Comment V. Exp.

name

string

Empty

Name to be displayed in the menu item.

The name is overriden by the name of the action when an action is used.

2.0

No

action_id

action id

Empty

Identifier of the target action to be executed when the menu item is selected.

Optional. When used, the name of the action is displayed, instead of the "name" attribute.

2.0

No

checked_param_id

param id

empty

Identifier of the parameter used to determine if the menu item should be checked.

Optional. When used, the menu item is checked when the target parameter is different from 0.

2.0

No

Examples

See POPUP_MENU element for basic examples.

Below is a more advanced example showing how to use menu items with actions and parameters.

Action and Param Usage

<SKIN text_color="#ffffff" width="300" height="120" layout_type="layer_stack" margin="10">
    <!-- Define action & parameter for the menu item-->
    <ACTION id="my_action" name="Show Alert" type="DisplayMessageBox" message="Alert!"/>
    <PARAM id="my_param" type="boolean" default="1"/>
    
    <!-- The menu-->
    <POPUP_MENU id="menu">
        <MENU_ITEM action_id="my_action"/>
        <MENU_ITEM name="Item2" checked_param_id="my_param"/>
    </POPUP_MENU>
    
    <!-- The button to show the menu-->
    <TEXT value="Click Me!" h_align="left" v_align="top">
        <INVISIBLE_ACTION_BUTTON action_id="menu.Popup" width="100%" height="100%"/>
    </TEXT>
</SKIN>
doc_widgets_menu_item_element1.png