Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


:: com :: sun :: star :: awt ::

interface XPopupMenu
Base Interfaces
XPopupMenuXMenu

XMenu
(referenced interface's summary:)
specifies a simple menu.
Description
controls a popup menu.

Methods' Summary
insertSeparator inserts a separator at the specified position.  
setDefaultItem sets the menu default item.  
getDefaultItem returns the menu default item.  
checkItem sets the state of the item to be checked or unchecked.  
isItemChecked returns whether the item is checked or unchecked.  
execute executes the popup menu and returns the selected item or 0, if cancelled.  
isInExecute queries if the PopupMenu is being.  
endExecute ends the execution of the PopupMenu.  
setAcceleratorKeyEvent sets the KeyEvent for the menu item.  
getAcceleratorKeyEvent retrieves the KeyEvent for the menu item.  
setItemImage sets the image for the menu item.  
getItemImage retrieves the image for the menu item.  
Methods' Details
insertSeparator
[oneway] void
insertSeparator( [in] short  nItemPos );

Description
inserts a separator at the specified position.
Parameter nItemPos
specifies the position where the menu separator will be insterted.
setDefaultItem
[oneway] void
setDefaultItem( [in] short  nItemId );

Description
sets the menu default item.
Parameter nItemId
specifies the menu item identifier.
getDefaultItem
short
getDefaultItem();

Description
returns the menu default item.
Returns
the ID of the default item.
checkItem
[oneway] void
checkItem( [in] short  nItemId,
[in] boolean  bCheck );

Description
sets the state of the item to be checked or unchecked.
Parameter nItemId
specifies the menu item identifier.
Parameter bCheck
specifies if the item is checked (true) or unchecked (false).
isItemChecked
boolean
isItemChecked( [in] short  nItemId );

Description
returns whether the item is checked or unchecked.
Parameter nItemId
specifies the menu item identifier.
Returns
true if the item is checked, false otherwise.
execute
short
execute( [in] XWindowPeer  Parent,
[in] Rectangle  Position,
[in] short  Direction );

Description
executes the popup menu and returns the selected item or 0, if cancelled.
Parameter Parent
the parent window.
Parameter Position
a Rectangle representing the coordinates system where the popup menu should be executed.
Parameter Direction
the direction in which a popup menu will grow, as specified by one of the PopupMenuDirection constants.
Returns
returns the selected item or 0, if cancelled.
isInExecute
boolean
isInExecute();

Description
queries if the PopupMenu is being.

Returns true only if the PopupMenu is being executed as a result of invoking XPopupMenu::execute(); that is, for a PopupMenu activated by a MenuBar item, this methods returns false.

Returns
true if the PopupMenu is being executed, false otherwise.
See also
XPopupMenu::execute()
endExecute
void
endExecute();

Description
ends the execution of the PopupMenu.

XPopupMenu::execute() will then return 0.

See also
XPopupMenu::execute()
setAcceleratorKeyEvent
void
setAcceleratorKeyEvent( [in] short  nItemId,
[in] KeyEvent  aKeyEvent );

Description
sets the KeyEvent for the menu item.

The KeyEvent is only used as a container to transport the shortcut information, this methods only draws the text corresponding to this keyboard shortcut. The client code is responsible for listening to keyboard events (typicaly done via XUserInputInterception), and dispatch the respective command.

Parameter nItemId
specifies the menu item identifier for which the KeyEvent should be set.
Parameter aKeyEvent
specifies the KeyEvent for the menu item.
getAcceleratorKeyEvent
KeyEvent
getAcceleratorKeyEvent( [in] short  nItemId );

Description
retrieves the KeyEvent for the menu item.

The KeyEvent is only used as a container to transport the shortcut information, so that in this case ::com::sun::star::lang::EventObject::Source is NULL.

Parameter nItemId
specifies the menu item identifier for which the KeyEvent should be retrieved.
Returns
the KeyEvent struct assigned to the requested menu item.
setItemImage
void
setItemImage( [in] short  nItemId,
[in] ::com::sun::star::graphic::XGraphic  xGraphic,
[in] boolean  bScale );

Description
sets the image for the menu item.
Parameter nItemId
specifies the menu item identifier for which the image should be set.
Parameter xGraphic
specifies the image for the menu item.
Parameter bScale
if true, the image will be scaled to the standard size used internally by the implementation.
getItemImage
::com::sun::star::graphic::XGraphic
getItemImage( [in] short  nItemId );

Description
retrieves the image for the menu item.
Parameter nItemId
specifies the menu item identifier for which the image should be retrieved.
Returns
a ::com::sun::star::graphic::XGraphic reference to the current image for the requested menu item.
Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.