Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

SetMasterItem – PB Docs 2022 – PowerBuilder Library

SetMasterItem – PB Docs 2022

SetMasterItem

PowerScript function

Description

Sets a master menu item for the application menu in the RibbonBar
control.

Applies to

RibbonApplicationMenu control

Syntax

Argument

Description

controlname

The name of the RibbonApplicationMenu control in which you
want to set the master menu item.

ParentIndex (optional)

The index of the master menu item (RibbonMenuItem) whose
submenu item you want to set.

If not specified, the master menu item will be set; if
specified to a valid value, the submenu item of the master menu
item (whose index is ParentIndex) will be set; if specified to
an invalid value, an error would occur and this operation would
return -1.

Index

The index for the master menu item or submenu item for
which you want to set. If index is invalid, an error would occur
and this operation would return -1.

Item

A RibbonMenuItem item you want to set. Only RibbonMenuItem
with “Normal(0)” or “Separator(1)” ItemType is supported. If
RibbonMenuItem is with other ItemType such as “Recent(2)”, an
error would occur and this operation would return -1.

Return value

Integer.

Returns 1 if it succeeds and -1 if an error occurs. If any
argument’s value is null, returns null.

Usage

Only the menu item with the “Normal” or “Separator” type (that is
RibbonMenuItem with ItemType 0 or 1) can be added as a master menu
item.

The master menu can have no more than two levels.

The user events to be bound with the master menu item must be
defined correctly according to the requirements of RibbonMenuItem. For
details, see Clicked in PowerScript Reference and Selected in PowerScript Reference.

Examples

This example inserts the “MenuItem” master menu item and the
“SubMenuItem” submenu item and then sets values for their properties
(including Text, PictureName, Clicked etc.).

See also

AddMasterSeparatorItem

ClearRecentItems

DeleteMasterItem

DeleteRecentItem

GetMasterItem

GetMasterItemCount

GetRecentItem

GetRecentItemCount

GetRecentTitle

InsertMasterItem

InsertMasterItemFirst

InsertMasterItemLast

InsertRecentItem

InsertRecentItemFirst

InsertRecentItemLast

SetRecentItem

SetRecentTitle


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x