TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | List of all members
iWidgetMenu Struct Referenceabstract
Inheritance diagram for iWidgetMenu:
iUnknown

Detailed Description

Menu interface.

Remarks
The keyboard input for the menu is :
Escape : Close the current menu.
Home/End : Select the first/last menu item.
Up/Down : Select the previous/next menu item.
Ctrl/Shit+Up/Down or PgUp/PgDn : Select the next menu item before/after a separator.
Left : Close the current sub-menu. Wont close the main menu.
Right : Open the current sub-menu.
Enter/Space : Select/Click the current menu item.
If the NoCloseOnNCClick style is set the main menu will not close when escape is pressed.

Public Member Functions

virtual tBool ClearItems ()=0
 Clear/removes all the items in the menu. More...
 
virtual iWidgetMenuItemAddItem (const achar *aaszName, iHString *ahspID, tWidgetMenuItemFlags aFlags)=0
 Add a menu item. More...
 
virtual tBool RemoveItem (iWidgetMenuItem *apItem)=0
 Remove the item at the specified index. More...
 
virtual tU32 GetNumItems () const =0
 Get the number of items. More...
 
virtual iWidgetMenuItemGetItem (tU32 anIndex) const =0
 Get the item at the specified index. More...
 
virtual iWidgetMenuItemGetItemFromName (const achar *aaszName) const =0
 Get the index of the first item with the specified name. More...
 
virtual iWidgetMenuItemGetItemFromID (iHString *ahspID) const =0
 Get the index of the first item with the specified id. More...
 
virtual tBool Open ()=0
 Open the menu. More...
 
virtual tBool Close ()=0
 Close the menu. More...
 
virtual tBool SortItems ()=0
 Sort the items. More...
 
virtual tU32 GetMenuWidth () const =0
 Get the menu's width in pixels. {Property}. More...
 
virtual tU32 GetMenuHeight () const =0
 Get the menu's height in pixels. {Property}. More...
 
virtual tU32 GetItemWidth () const =0
 Get the item's width in pixels. {Property}. More...
 
virtual tU32 GetItemHeight () const =0
 Get the item's height in pixels. {Property}. More...
 
virtual void UpdateSizes ()=0
 Update the menu's sizes. More...
 
- Public Member Functions inherited from iUnknown
virtual tBool IsOK () const =0
 Check if the object is valid. More...
 
virtual tI32 AddRef ()=0
 Signal that one more reference of the object has been created. More...
 
virtual tI32 Release ()=0
 Release a reference of the object. More...
 
virtual void DeleteThis ()=0
 Bypass any reference counting and delete this object. More...
 
virtual void Invalidate ()=0
 Invalidate the object. More...
 
virtual iUnknownQueryInterface (const tUUID &aIID)=0
 Query an interface. More...
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0
 Fill a UUID list containing the UUIDs of the implemented interfaces. More...
 
virtual tI32 SetNumRefs (tI32 anNumRefs)=0
 Set the reference counter directly. More...
 
virtual tI32 GetNumRefs () const =0
 Get the number of references to this object. More...
 

Member Function Documentation

virtual tBool ClearItems ( )
pure virtual

Clear/removes all the items in the menu.

virtual iWidgetMenuItem* AddItem ( const achar aaszName,
iHString ahspID,
tWidgetMenuItemFlags  aFlags 
)
pure virtual

Add a menu item.

Parameters
aaszNameis the name and text of the item. It can contain a & that will notify the shortcut key to use.
ahspIDis the ID of the item.
aFlagsare the flags of the item.
Returns
The index of the item, or eInvalidHandle if the item can't be added.
virtual tBool RemoveItem ( iWidgetMenuItem apItem)
pure virtual

Remove the item at the specified index.

Parameters
apItemis the item to remove.
Returns
eFalse if the index is invalid, eTrue if the item has been removed.
Remarks
This function will search the item in the sub menus.
virtual tU32 GetNumItems ( ) const
pure virtual

Get the number of items.

Remarks
This function doesn't include the sub menus. {Property}
virtual iWidgetMenuItem* GetItem ( tU32  anIndex) const
pure virtual

Get the item at the specified index.

Remarks
This function doesn't include the sub menus. {Property}
virtual iWidgetMenuItem* GetItemFromName ( const achar aaszName) const
pure virtual

Get the index of the first item with the specified name.

Remarks
This function will search the item in the sub menus. {Property}
virtual iWidgetMenuItem* GetItemFromID ( iHString ahspID) const
pure virtual

Get the index of the first item with the specified id.

Remarks
This function will search the item in the sub menus. {Property}
virtual tBool Open ( )
pure virtual

Open the menu.

virtual tBool Close ( )
pure virtual

Close the menu.

virtual tBool SortItems ( )
pure virtual

Sort the items.

virtual tU32 GetMenuWidth ( ) const
pure virtual

Get the menu's width in pixels. {Property}.

virtual tU32 GetMenuHeight ( ) const
pure virtual

Get the menu's height in pixels. {Property}.

virtual tU32 GetItemWidth ( ) const
pure virtual

Get the item's width in pixels. {Property}.

virtual tU32 GetItemHeight ( ) const
pure virtual

Get the item's height in pixels. {Property}.

virtual void UpdateSizes ( )
pure virtual

Update the menu's sizes.

Remarks
If the item list changed since the last call this is done automatically when Open, GetMenuWidth/Height or GetItemWidth/Height is called.