RibbonMenuItem control

A RibbonMenuItem control defines a menu item for the application menu (RibbonApplicationMenu) or the ribbon menu (RibbonMenu) in the RibbonBar control. There are three types of menu items:

  • Normal(0) -- Can be inserted as the master menu item to the application menu or as the menu item to the ribbon menu.

  • Separator(1) -- Can be inserted as a separator to the master menu in the application menu or to the menu in the ribbon menu. A separator is a horizontal line used to visually distinguish between groups of menu items.

  • Recent(2) -- Can be inserted as the recent menu item to the application menu.

The RibbonMenuItem control is the child object of the RibbonApplicationMenu control and the RibbonMenu control. For the hierarchical structure of the ribbon controls and how to get and set them, refer to the section called “Accessing the RibbonBar items in the hierarchy” in Users Guide.

Events

This control has no events. But you can create user events and bind them with this control. You can create the Clicked user event and the Selected user event. For how to create the Clicked user event, see Clicked in PowerScript Reference; for how to create the Selected user event, see Selected in PowerScript Reference.

Properties

RibbonMenuItem property

Datatype

Description

ClassDefinition

PowerObject

An object of type PowerObject containing information about the class definition of the object or control.

Checked

Boolean

Specifies whether the control is checked.

Clicked

String

Specifies the name of the clicked user event to be bound with the menu item.

Enabled

Boolean

Specifies whether the menu item is enabled (can be clicked).

ItemType

Integer

Specifies the type of the menu item.

This property (called Type attribute in XML/JSON) cannot be changed at runtime.

PictureName

String

Specifies the file name of the picture.

The picture will not show if the menu item is added to the recent menu.

RightToLeft

Boolean

Unsupported.

Selected

String

Specifies the name of the selected user event to be bound with the menu item.

Shortcut

String

Specifies the shortcut key for the menu item.

Tag

String

Specifies the tag value assigned to the menu item.

Text

String

Specifies the text that displays in the menu item.

The user can assign an accelerator key by typing an ampersand (&) before the letter in the menu item text. For example, &File designates the F in File as an accelerator key. The user can also assign shortcut keys to the menu item by the Shortcut property.

Visible

Boolean

Specifies whether the menu item is visible. Values are:

TRUE -- Control is visible.

FALSE -- Control is not visible.


Functions

RibbonMenuItem function

Datatype returned

Description

ClassName

String

Returns the name assigned to the control.

GetContextService

Integer

Creates a reference to a context-specific instance of the specified service.

GetParent

PowerObject

Returns a reference to the name of the parent object.

PostEvent

Integer

Adds the specified event to the end of the event queue for the specified object

TriggerEvent

Integer

Triggers a specified event in the control and executes the script for the event.

TypeOf

Object

Returns the type of the control.