PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBMenuCtl
Wrapper Class for the IMenuCtl interface.
#include <SFBMenuCtl.h.hpp>
class SFBMenuCtl : public SFBControl;
SFMTYPEDEFWRAPPER(SFBMenuCtl)

Inheritance diagram

 Inheritance diagram of SFBMenuCtlClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
O O O O

Reference

BREW API IMenuCtl

Member

Public Functions
Bool AddItem( ACharConstPtr resFile , UInt16 resID , UInt16 itemID , UInt32 data )
Add a new item to a menu.
Bool AddItem( UInt16 itemID , WCharPtr text , UInt32 data )
Add a new item to a menu.
Bool AddItem( SFXAnsiStringConstRef resFile , UInt16 resID , UInt16 itemID , UInt32 data )
Add a new item to a menu.
Bool AddItem( UInt16 itemID , SFXWideStringPtr text , UInt32 data )
Add a new item to a menu.
Bool AddItemEx( CtlAddItem* item )
Add an item to a menu, list, or icon view.
Bool AddOwnerDrawItem( UInt16 itemID , UInt32 itemData )
ADD an owner draw item to a menu.
Bool DeleteAll( Void )
Delete all items from a menu control object.
Bool DeleteItem( UInt16 itemID )
Delete an item from the menu control object.
Void EnableCommand( Bool enable )
Enable the menu control object to send the specified command to the AEE Shell when it receives an event generated by a device user pressing the SELECT key.
UInt16 EnumNextSel( Void )
This function should only be used only with Multi Select menus (MP_MULTI_SEL).
Bool EnumSelInit( Void )
This function should only be used only with Multi Select menus (MP_MULTI_SEL).
Void GetColors( AEEMenuColors* colors )
Get the color of menu elements.
UInt16 GetFocus( Void )
This function should only be used only with Multi Select menus (MP_MULTI_SEL).
Bool GetItem( UInt16 itemID , CtlAddItem* item )
Query all of the relevant values associated with an item.
SInt32 GetItemCount( Void )
Return the count of the number of items in a menu.
Bool GetItemData( UInt16 itemID , UInt32Ptr data )
Get the data associated with an item in the given menu control object.
UInt16 GetItemID( SInt32 index )
Return the item ID given the index of the item.
Void GetItemRect( UInt16 index , SFXRectanglePtr rect , UInt16 index )
Get rect used to draw that item in menu control.
SInt32 GetItemTime( UInt16 itemID , UInt16Ptr duration )
If the menu control is calendar, this function retrieves the start time and duration (the difference between the end time and the start time) of the item specified by the item ID.
UInt16 GetSel( Void )
Get the item identifier of the menu control object’s current selection.
Void GetStyle( AEEItemStyle* normal , AEEItemStyle* selected )
Get the display style for the items.
Void MoveItem( UInt16 itemID , SInt32 direction )
Move an item by one position in the specified direction.
static
SFBMenuCtlSmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBMenuCtl instance.
static
SFBMenuCtlSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBMenuCtl instance.
Void SetColors( AEEMenuColors* colors )
By default, the color of menu elements are determined by entries in the system color table defined by the device manufacturer.
Void SetFocus( UInt16 itemID )
This function is only to be used with Multi Select menus (MP_MULTI_SEL).
Bool SetItem( UInt16 itemID , UInt16 flags , CtlAddItem* item )
Set any field in an item after the item has been created.
Void SetItemText( UInt16 itemID , ACharConstPtr resFile , UInt16 resID )
Set a new item text name, given the item ID.
Void SetItemText( UInt16 itemID , WCharPtr text )
Set a new item text name, given the item ID.
Void SetItemText( UInt16 itemID , SFXAnsiStringConstRef resFile , UInt16 resID )
Set a new item text name, given the item ID.
Void SetItemText( UInt16 itemID , SFXWideStringPtr text )
Set a new item text name, given the item ID.
Void SetItemTime( UInt16 itemID , UInt16 minStart , UInt16 duration )
Set the calendar menu control.
Void SetSel( UInt16 itemID )
Make an item the current selection of the menu control object and requests a redraw if the MP_NO_REDRAW property is not set.
Void SetSelEx( UInt16 itemID , Bool selected )
This function must be used only with Multi Select menus (MP_MULTI_SEL).
Void SetStyle( AEEItemStyle* normal , AEEItemStyle* selected )
Set the display style for the items.
Bool SetTitle( ACharConstPtr resFile , UInt16 resID )
Set the title of a menu control object.
Bool SetTitle( WCharPtr text )
Set the title of a menu control object.
Bool SetTitle( SFXAnsiStringConstRef resFile , UInt16 resID )
Set the title of a menu control object.
Bool SetTitle( SFXWideStringPtr text )
Set the title of a menu control object.
Void Sort( AEEMenuSortType type )
Sort the items in a menu.
Void SortCustom( PFNMENUSORTCOMPARE notify , VoidPtr data )
Sort a menu using a user-supplied comparison callback, allowing menus to be sorted by criteria other than simple name/value comparisons.
UInt32 GetProperties( Void ) (inherits from SFBControl)
Return the control-specific properties or flags.
Void GetRect( SFXRectanglePtr rect ) (inherits from SFBControl)
Get the rectangle of the control.
SFXRectangle GetRect( Void ) (inherits from SFBControl)
Get the rectangle of the control.
Bool HandleEvent( AEEEvent event , UInt16 wParam , UInt32 dwParam ) (inherits from SFBControl)
Pass events to a control. The BREW controls process various events to allow a device user to enter a text, time, or date value or choose an item from a menu. Refer to the descriptions of each control for the events it handles. Your applet must pass a control all of the events, unless the control is part of a dialog. Below is an example of an application passing all of the events to the controls of the application.
Bool HandleEvent( SFXEventConstRef event ) (inherits from SFBControl)
Pass events to a control. The BREW controls process various events to allow a device user to enter a text, time, or date value or choose an item from a menu. Refer to the descriptions of each control for the events it handles. Your applet must pass a control all of the events, unless the control is part of a dialog. Below is an example of an application passing all of the events to the controls of the application.
Bool IsActive( Void ) (inherits from SFBControl)
Return the active or focus state of the control.
Bool Redraw( Void ) (inherits from SFBControl)
Instruct the control to redraw its contents.
Void Reset( Void ) (inherits from SFBControl)
Instruct the control to reset (free/delete) its contents and to immediately leave active/focus mode.
Void SetActive( Bool active = true ) (inherits from SFBControl)
Instruct the control to enter/leave focus or selected mode.
Void SetProperties( UInt32 properties ) (inherits from SFBControl)
Set control-specific properties or flags.
Void SetRect( SFXRectangleConstRef rect ) (inherits from SFBControl)
Set the active screen coordinates of the control. This may result in the control redrawing its contents.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBMenuCtl::AddItem
Add a new item to a menu.
[ public ]
Bool AddItem(
    ACharConstPtr resFile   // null-terminated string that contains the resource file name
    UInt16 resID            // resource identifier that identifies a text resource
    UInt16 itemID           // item identifier that uniquely identifies an item
    UInt32 data             // item data associated with the item
);
[ public ]
Bool AddItem(
    UInt16 itemID   // item identifier that uniquely identifies an item
    WCharPtr text   // null-terminated string that contains the item name
    UInt32 data     // item data associated with the item
);
[ public ]
Bool AddItem(
    SFXAnsiStringConstRef resFile   // resource file name
    UInt16 resID                    // resource identifier that identifies a text resource
    UInt16 itemID                   // item identifier that uniquely identifies an item
    UInt32 data                     // item data associated with the item
);
[ public ]
Bool AddItem(
    UInt16 itemID           // item identifier that uniquely identifies an item
    SFXWideStringPtr text   // string that contains the item name
    UInt32 data             // item data associated with the item
);

Reference

BREW API IMENUCTL_AddItem | SFBMenuCtl::DeleteItem | SFBControl::Redraw | SFBControl::SetActive


SFBMenuCtl::AddItemEx
Add an item to a menu, list, or icon view.
[ public ]
Bool AddItemEx(
    CtlAddItem* item   // pointer to the CtlAddItem structure
);

Reference

BREW API IMENUCTL_AddItemEx | SFBControl::Redraw | SFBMenuCtl::AddItem


SFBMenuCtl::AddOwnerDrawItem
ADD an owner draw item to a menu.
[ public ]
Bool AddOwnerDrawItem(
    UInt16 itemID     // item identifier that uniquely identifies an item
    UInt32 itemData   // item data associated with the item 
);

Return value

  • If succeeds: true
  • If failed: false

Version

This function is available in BREW 3.1.

Reference

BREW API IMENUCTL_AddOwnerDrawItem | SFBMenuCtl::DeleteItem | SFBControl::Redraw | SFBControl::SetActive


SFBMenuCtl::DeleteAll
Delete all items from a menu control object.
[ public ]
Bool DeleteAll(Void);

Reference

BREW API IMENUCTL_DeleteAll


SFBMenuCtl::DeleteItem
Delete an item from the menu control object.
[ public ]
Bool DeleteItem(
    UInt16 itemID   // item identifier used when the item was added to the menu
);

Reference

BREW API IMENUCTL_DeleteItem


SFBMenuCtl::EnableCommand
Enable the menu control object to send the specified command to the AEE Shell when it receives an event generated by a device user pressing the SELECT key.
[ public ]
Void EnableCommand(
    Bool enable   // enable/disable flag
);

Reference

BREW API IMENUCTL_EnableCommand | SFBControl::HandleEvent


SFBMenuCtl::EnumNextSel
This function should only be used only with Multi Select menus (MP_MULTI_SEL).
[ public ]
UInt16 EnumNextSel(Void);

Reference

BREW API IMENUCTL_EnumNextSel | SFBMenuCtl::EnumSelInit


SFBMenuCtl::EnumSelInit
This function should only be used only with Multi Select menus (MP_MULTI_SEL).
[ public ]
Bool EnumSelInit(Void);

Reference

BREW API IMENUCTL_EnumSelInit | SFBMenuCtl::EnumNextSel


SFBMenuCtl::GetColors
Get the color of menu elements.
[ public ]
Void GetColors(
    AEEMenuColors* colors   // color value
);

Version

This function is available in BREW 3.1.

Reference

BREW API IMENUCTL_GetColors


SFBMenuCtl::GetFocus
This function should only be used only with Multi Select menus (MP_MULTI_SEL).
[ public ]
UInt16 GetFocus(Void);

Reference

BREW API IMENUCTL_GetFocus | SFBMenuCtl::SetFocus


SFBMenuCtl::GetItem
Query all of the relevant values associated with an item.
[ public ]
Bool GetItem(
    UInt16 itemID      // item ID
    CtlAddItem* item   // item information structure
);

Reference

BREW API IMENUCTL_GetItem | CtlAddItem | SFBMenuCtl::SetItem


SFBMenuCtl::GetItemCount
Return the count of the number of items in a menu.
[ public ]
SInt32 GetItemCount(Void);

Reference

BREW API IMENUCTL_GetItemCount | SFBMenuCtl::GetItemID


SFBMenuCtl::GetItemData
Get the data associated with an item in the given menu control object.
[ public ]
Bool GetItemData(
    UInt16 itemID    // item identifier used when this item is added to the menu
    UInt32Ptr data   // placeholder for item data
);

Reference

BREW API IMENUCTL_GetItemData | SFBMenuCtl::AddItem


SFBMenuCtl::GetItemID
Return the item ID given the index of the item.
[ public ]
UInt16 GetItemID(
    SInt32 index   // index of the item
);

Reference

BREW API IMENUCTL_GetItemID


SFBMenuCtl::GetItemRect
Get rect used to draw that item in menu control.
[ public, public ]
Void GetItemRect(
    UInt16 index           // index of item
    SFXRectanglePtr rect   // item rectangle
    UInt16 index           // index of item
);

Version

This function is available in BREW 3.1.

Reference

BREW API IMENUCTL_GetItemRect


SFBMenuCtl::GetItemTime
If the menu control is calendar, this function retrieves the start time and duration (the difference between the end time and the start time) of the item specified by the item ID.
[ public ]
SInt32 GetItemTime(
    UInt16 itemID        // item Identifier
    UInt16Ptr duration   // duration in minutes
);

Reference

BREW API IMENUCTL_GetItemTime | SFBMenuCtl::SetItemTime


SFBMenuCtl::GetSel
Get the item identifier of the menu control object’s current selection.
[ public ]
UInt16 GetSel(Void);

Reference

BREW API IMENUCTL_GetSel | SFBMenuCtl::SetSel


SFBMenuCtl::GetStyle
Get the display style for the items.
[ public ]
Void GetStyle(
    AEEItemStyle* normal     // style for normal items
    AEEItemStyle* selected   // style for selected items
);

Version

This function is available in BREW 3.1.

Reference

BREW API IMENUCTL_GetStyle


SFBMenuCtl::MoveItem
Move an item by one position in the specified direction.
[ public ]
Void MoveItem(
    UInt16 itemID      // item identifier 
    SInt32 direction   // direction: Value of -1:UP Value of 1:DOWN 
);

Reference

BREW API IMENUCTL_MoveItem


SFBMenuCtl::NewInstance
Create a new SFBMenuCtl instance.
[ public, static ]
SFBMenuCtlSmp NewInstance(
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBMenuCtlSmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBMenuCtl::SetColors
By default, the color of menu elements are determined by entries in the system color table defined by the device manufacturer.
[ public ]
Void SetColors(
    AEEMenuColors* colors   // pointer to the structure containing both a bitmask to indicate 
                            // the item whose color needs to be changed, and the color values
);

Reference

BREW API IMENUCTL_SetColors | AEEMenuColors


SFBMenuCtl::SetFocus
This function is only to be used with Multi Select menus (MP_MULTI_SEL).
[ public ]
Void SetFocus(
    UInt16 itemID   // id of the item to set
);

Reference

BREW API IMENUCTL_SetFocus | SFBMenuCtl::GetFocus


SFBMenuCtl::SetItem
Set any field in an item after the item has been created.
[ public ]
Bool SetItem(
    UInt16 itemID      // item id
    UInt16 flags       // mask of valid fields in CtlAddItem structure
    CtlAddItem* item   // item information structure
);

Reference

BREW API IMENUCTL_SetItem | CtlAddItem | SFBMenuCtl::GetItem | SFBControl::Redraw


SFBMenuCtl::SetItemText
Set a new item text name, given the item ID.
[ public ]
Void SetItemText(
    UInt16 itemID           // item identifier
    ACharConstPtr resFile   // null-terminated string containing the resource file name
    UInt16 resID            // resource Id
);
[ public ]
Void SetItemText(
    UInt16 itemID   // item identifier
    WCharPtr text   // new item text in string form
);
[ public ]
Void SetItemText(
    UInt16 itemID                   // item identifier
    SFXAnsiStringConstRef resFile   // resource file name
    UInt16 resID                    // resource id
);
[ public ]
Void SetItemText(
    UInt16 itemID           // item identifier
    SFXWideStringPtr text   // new item text in string form
);

Reference

BREW API IMENUCTL_SetItemText


SFBMenuCtl::SetItemTime
Set the calendar menu control.
[ public ]
Void SetItemTime(
    UInt16 itemID     // item identifier
    UInt16 minStart   // start time in minutes
    UInt16 duration   // duration in minutes
);

Reference

BREW API IMENUCTL_SetItemTime | SFBMenuCtl::GetItemTime


SFBMenuCtl::SetSel
Make an item the current selection of the menu control object and requests a redraw if the MP_NO_REDRAW property is not set.
[ public ]
Void SetSel(
    UInt16 itemID   // item identifier used when this item is added to the menu
);

Reference

BREW API IMENUCTL_SetSel | SFBMenuCtl::GetSel


SFBMenuCtl::SetSelEx
This function must be used only with Multi Select menus (MP_MULTI_SEL).
[ public ]
Void SetSelEx(
    UInt16 itemID   // id of the item to set
    Bool selected   // select/deselect the item
);

Reference

BREW API IMENUCTL_SetSelEx


SFBMenuCtl::SetStyle
Set the display style for the items.
[ public ]
Void SetStyle(
    AEEItemStyle* normal     // style for normal items
    AEEItemStyle* selected   // style for selected items
);

Reference

BREW API IMENUCTL_SetStyle | AEEItemStyle


SFBMenuCtl::SetTitle
Set the title of a menu control object.
[ public ]
Bool SetTitle(
    ACharConstPtr resFile   // null-terminated string containing resource file name
    UInt16 resID            // resource identifier
);
[ public ]
Bool SetTitle(
    WCharPtr text   // null-terminated character string to be used for the menu title
);
[ public ]
Bool SetTitle(
    SFXAnsiStringConstRef resFile   // resource file name
    UInt16 resID                    // resource identifier
);
[ public ]
Bool SetTitle(
    SFXWideStringPtr text   // null-terminated character string to be used for the menu title
);

Reference

BREW API IMENUCTL_SetTitle SFBControl::Redraw


SFBMenuCtl::Sort
Sort the items in a menu.
[ public ]
Void Sort(
    AEEMenuSortType type   // sort type
);

Reference

BREW API IMENUCTL_Sort | AEEMenuSortType | SFBMenuCtl::SortCustom


SFBMenuCtl::SortCustom
Sort a menu using a user-supplied comparison callback, allowing menus to be sorted by criteria other than simple name/value comparisons.
[ public ]
Void SortCustom(
    PFNMENUSORTCOMPARE notify   // user sort comparison callback
    VoidPtr data                // pointer to user context passed to comparison function
);

Reference

BREW API IMENUCTL_SortCustom | PFNMENUSORTCOMPARE | SFBMenuCtl::Sort