interface XMenu in module com::sun::star::awt::

(Global Index)

Syntax

interface XMenu : com::sun::star::uno::XInterface ;

Description

represents a simple menu.

Method Summary

addMenuListener adds the specified menu listener to receive events from this menu.

removeMenuListener removes the specified menu listener so it no longer receives item events from this menu.

insertItem inserts an item into the menu. This appends the item if the position is greater than or equal to getItemCount() or if it is negative.

removeItem remove one or more items from the menu.

getItemCount returns the number of items in the menu.

getItemId returns the id of the item at the specified position.

getItemPos returns the position of the item with the specified id.

enableItem enables or disables the menu item.

isItemEnabled returns the state of the menu item.

setItemText sets the text for the menu item.

getItemText

setPopupMenu set the popup menu for a specified menu item.

getPopupMenu returns the popup menu from the menu item.

Method Details



addMenuListener

Syntax

oneway void addMenuListener (
com::sun::star::awt::XMenuListener xListener );

Description

adds the specified menu listener to receive events from this menu.


removeMenuListener

Syntax

oneway void removeMenuListener (
com::sun::star::awt::XMenuListener xListener );

Description

removes the specified menu listener so it no longer receives item events from this menu.


insertItem

Syntax

oneway void insertItem (
short nItemId,
string aText,
short nItemStyle,
short nPos );

Description

inserts an item into the menu. This appends the item if the position is greater than or equal to getItemCount() or if it is negative.


removeItem

Syntax

oneway void removeItem (
short nPos,
short nCount );

Description

remove one or more items from the menu.


getItemCount

Syntax

short getItemCount ();

Description

returns the number of items in the menu.


getItemId

Syntax

short getItemId (
short nPos );

Description

returns the id of the item at the specified position.


getItemPos

Syntax

short getItemPos (
short nId );

Description

returns the position of the item with the specified id.


enableItem

Syntax

oneway void enableItem (
short nItemId,
boolean bEnable );

Description

enables or disables the menu item.


isItemEnabled

Syntax

boolean isItemEnabled (
short nItemId );

Description

returns the state of the menu item.


setItemText

Syntax

oneway void setItemText (
short nItemId,
string aText );

Description

sets the text for the menu item.


getItemText

Syntax

string getItemText (
short nItemId );

Returns

the string for the given item id.

setPopupMenu

Syntax

oneway void setPopupMenu (
short nItemId,
com::sun::star::awt::XPopupMenu aPopupMenu );

Description

set the popup menu for a specified menu item.


getPopupMenu

Syntax

com::sun::star::awt::XPopupMenu getPopupMenu (
short nItemId );

Description

returns the popup menu from the menu item.

Top of Page