SophiaFramework UNIVERSE 5.3 |
SFZTextMenu is a responder to create, control, update, and destroy a menu in text format(text menu).
There are 2 types of text menus: page style(default) and scroll style.
The design of a text menu can be customized using its various APIs.
A text, an icon character, or an image can be set to an item of the text menu.
To append an item, call the SFZTextMenu::AppendItem function. To delete an item, call the SFZTextMenu::RemoveItem function. When the SFZTextMenu::Clear function is called, all items will be removed.
The selection key is set with the SFYMenu::SetSelectUpKey / SFYMenu::SetSelectDownKey / SFYMenu::SetSelectRightKey / SFYMenu::SetSelectLeftKey functions. By default, selection keys are set to the UP key, the DOWN key, the RIGHT key, the LEFT key respectively.
In the default implementation, the text menu[SFZTextMenu] will receive the following result events[SFEVT_RESPONDER_RESULT].
The developer can register handlers for these events.
If no handler is registered, the default handler will be booted up when one of the above result events is received. The default handler only closes the menu.
The operation key of the menu is set with the SFYMenu::SetOperateKey function. By default, the operation key is set to the SELECT key.
The access key is set with the SFZTextMenu::SetItemAccessKey function.
The ESCAPE key is set with the SFYMenu::SetEscapeKey function. By default, the ESCAPE key is set to the CLEAR key.
Note | |
---|---|
The timer processing callback scheduled with the SFYMenu::ScheduleTimer function will be canceled automatically when the operation key of the menu or the ESCAPE key is pressed. |
Reference: Result Event[SFEVT_RESPONDER_RESULT] | SFZTextMenu::HandleOperateKey | SFZTextMenu::HandleEscapeKey | SFZTextMenu::HandleSelectUpKey | SFZTextMenu::HandleSelectDownKey | SFZTextMenu::HandleSelectRightKey | SFZTextMenu::HandleSelectLeftKey
The code to use a text menu is as follows:
Note | |
---|---|
To simplify the code, error handling is omitted here. |
Void USRApplication::Main(Void) { SFCError error; // create the window _window = SFZWindow::NewInstance(); _window->SetParent(GetThis()); _window->SetRealBound(GetLocalBound()); _window->SetVirtualBound(SFXRectangle(_window->GetVirtualBound()).SetHeight(640)); _window->SetState(true, true, true, true); _window->SetBackgroundColor(SFXRGBColor(0xDD, 0xFF, 0xDD, 0x00)); // create the text menu SFZTextMenuSmp _textmenu = SFZTextMenu::NewInstance(&error); // register the result handler which means that item is selected _textmenu->RegisterHandler(SFXEventRange(SFEVT_RESPONDER_RESULT, SFEVT_RESPONDER_RESULT, SFP16_BEGIN, SFP16_END), XANDLER_INTERNAL(OnTextMenu)); _textmenu->SetState(true, true, true, true); _textmenu->SetParent(_window); _textmenu->SetTitle("Text Menu"); _textmenu->ToFront(); SFXRectangle menuRect(30,95,165,135); menuRect.SetHeight(_textmenu->GetTitleHeight() + 3 * _textmenu->GetItemHeight()); _textmenu->SetRealBound(menuRect); _textmenu->AppendItem("item 1"); _textmenu->AppendItem("item 2"); _textmenu->AppendItem("item 3"); // disable 3rd item _textmenu->SetItemEnable(2, false); return; } // result handler which means that item is selected XANDLER_IMPLEMENT_VOIDRESULT(USRApplication, OnTextMenu, invoker, reason, result) { // text menu will be passed via invoker // P16 value of result event will be passed via reason switch (reason) { case SFP16_RESULT_OK: // when the operation key is pressed[item needs to be enabled with SetItemEnable()] // the index of the selected item will be passed via the result argument if (result == 0) { // when 1st item is selected ... } else if (result == 1) { // when 2nd item is selected ... } else if (result == 2) { // when 3rd item is selected ... } break; case SFP16_RESULT_ESCAPE: // when the ESCAPE key is pressed or the time scheduled with ScheduleTimer() elapses // 0 will be passed via the result argument // close text menu invoker->Terminate(); // or "_textmenu->Terminate();" break; } return; }
Execution result:
Text Menu [SFZTextMenu] | SFYMenu | SFZGridMenu | SFZFlexListMenu
Constructor/Destructor |
---|
SFZTextMenu( Void ) Constructor of the SFZTextMenu class.
|
~SFZTextMenu( Void ) Destructor of the SFZTextMenu class.
|
Public Functions | |
---|---|
SFCError |
AppendItem(
SFXPathConstRef path
, UInt16 id
) [DEPRECATED]Append an item to this text menu. Use the InsertLast() function.
|
SFCError |
AppendItem(
SFXPathConstRef path
, UInt16 id
, AVKType key
, WChar keyIcon = 0
) [DEPRECATED]Append an item to this text menu. Use the InsertLast() function.
|
SFCError |
AppendItem(
SFXWideStringConstRef text
) [DEPRECATED]Append an item to this text menu. Use the InsertLast() function.
|
SFCError |
AppendItem(
SFXWideStringConstRef text
, AVKType key
, WChar keyIcon = 0
) [DEPRECATED]Append an item to this text menu. Use the InsertLast() function.
|
Void |
Clear( Void ) Delete all items from this menu.
|
SFXBevelColorConstRef |
GetBevelColor( Void ) Get the bevel color for outer frame of this menu.
|
SFXRGBColorConstRef |
GetDefaultItemBackColor( Void ) Get the default background color of unselected item of this menu.
|
SFXRGBColorConstRef |
GetDefaultItemForeColor( Void ) Get the default foreground color of unselected item of this menu.
|
AEEFont |
GetFont( Void ) Get the font of this menu.
|
AVKType |
GetItemAccessKey(
SInt16 index
) Get the access key of the specified item of this menu.
|
SFXRGBColorConstRef |
GetItemBackColor(
SInt16 index
) Get the background color of the specified unselected item of this menu.
|
SInt16 |
GetItemCount( Void ) Get the number of the items of this menu.
|
Bool |
GetItemEnable(
SInt16 index
) Get the value of enable flag of the specified item of this menu.
|
SFXRGBColorConstRef |
GetItemForeColor(
SInt16 index
) Get the foreground color of the specified unselected item of this menu.
|
SInt16 |
GetItemHeight( Void ) Get the item height of this menu.
|
SFBImageSmpConstRef |
GetItemImage(
SInt16 index
) Get the image of the specified item of this menu.
|
SFXMarginConstRef |
GetItemMargin( Void ) Get the margin of the item of this menu.
|
SFZTextMenuSmp |
GetItemSubMenu(
SInt16 index
) Get the sub menu for the specified item of this menu.
|
SFXWideStringConstRef |
GetItemText(
SInt16 index
) Get the text of the specified item of this menu.
|
MenuStyleEnum |
GetMenuStyle( Void ) Get the menu style of this menu.
|
SFZTextMenuSmp |
GetRootMenu( Void ) Get the root menu of this menu.
|
SFXRGBColorConstRef |
GetSelBackColor( Void ) Get the background color of selected item of this menu.
|
SFXRGBColorConstRef |
GetSelForeColor( Void ) Get the foreground color of selected item of this menu.
|
SInt16 |
GetSelect( Void ) Get the index of currently selected item of this menu.
|
SFXWideStringConstRef |
GetTitle( Void ) Get the title of this menu.
|
SFXRGBColorConstRef |
GetTitleBackColor( Void ) Get the background color of the title of this menu.
|
SFXRGBColorConstRef |
GetTitleForeColor( Void ) Get the foreground color of the title of this menu.
|
SInt16 |
GetTitleHeight( Void ) Get the height of the title of this menu.
|
Bool |
HasParentMenu( Void ) Check whether or not this menu has any parent menu.
|
SFCError |
Insert(
SInt32 index
, SFXPathConstRef path
, UInt16 id
) Insert the specified item before the specified index.
|
SFCError |
Insert(
SInt32 index
, SFXPathConstRef path
, UInt16 id
, AVKType key
, WChar keyIcon
) Insert the specified item before the specified index.
|
SFCError |
Insert(
SInt32 index
, SFXWideStringConstRef text
) Insert the specified item before the specified index.
|
SFCError |
Insert(
SInt32 index
, SFXWideStringConstRef text
, AVKType key
, WChar keyIcon
) Insert the specified item before the specified index.
|
SFCError |
InsertFirst(
SFXPathConstRef path
, UInt16 id
) Insert the specified item at the head.
|
SFCError |
InsertFirst(
SFXPathConstRef path
, UInt16 id
, AVKType key
, WChar keyIcon
) Insert the specified item at the head.
|
SFCError |
InsertFirst(
SFXWideStringConstRef text
) Insert the specified item at the head.
|
SFCError |
InsertFirst(
SFXWideStringConstRef text
, AVKType key
, WChar keyIcon
) Insert the specified item at the head.
|
SFCError |
InsertLast(
SFXPathConstRef path
, UInt16 id
) Insert the specified item at the tail.
|
SFCError |
InsertLast(
SFXPathConstRef path
, UInt16 id
, AVKType key
, WChar keyIcon
) Insert the specified item at the tail.
|
SFCError |
InsertLast(
SFXWideStringConstRef text
) Insert the specified item at the tail.
|
SFCError |
InsertLast(
SFXWideStringConstRef text
, AVKType key
, WChar keyIcon
) Insert the specified item at the tail.
|
static SFZTextMenuSmp |
NewInstance(
SFCErrorPtr exception = null
) Create a new instance of this responder class.
|
Void |
Remove(
SInt32 index
) Remove specified items from this text menu.
|
Void |
Remove(
SInt32 begin
, SInt32 end
) Remove specified items from this text menu.
|
Void |
RemoveFirst( Void ) Remove the first item from this text menu.
|
Void |
RemoveItem(
SInt16 index
) [DEPRECATED]Remove the specified item from this text menu. Use the Remove() function.
|
Void |
RemoveLast( Void ) Remove the last item from this text menu.
|
Void |
SetBevelColor(
SFXBevelColorConstRef param
) Set the bevel color for outer frame of this menu to the specified value.
|
Void |
SetDefaultItemBackColor(
SFXRGBColorConstRef param
) Set the default background color of unselected item of this menu to the specified value.
|
Void |
SetDefaultItemForeColor(
SFXRGBColorConstRef param
)
Set the default foreground color of unselected item of this menu to the specified value.
|
Void |
SetFont(
AEEFont param
) Set the font of this menu to the specified value.
|
SFCError |
SetItemAccessKey(
SInt16 index
, AVKType key
, WChar keyIcon = 0
) Set the access key and the key icon of the specified item of this menu to specified values.
|
SFCError |
SetItemBackColor(
SInt16 index
, SFXRGBColorConstRef param
) Set the background color of the specified unselected item of this menu to the specified value.
|
SFCError |
SetItemEnable(
SInt16 index
, Bool param
) Set the enable flag of the specified item of this menu to the specified value.
|
SFCError |
SetItemForeColor(
SInt16 index
, SFXRGBColorConstRef param
) Set the foreground color of the specified unselected item of this menu to the specified value.
|
Void |
SetItemHeight(
SInt16 param
) Set the item height of this menu to the specified value. [pixels]
|
SFCError |
SetItemImage(
SInt16 index
, SFXPathConstRef path
) Set the image of the specified item of this menu to the specified value.
|
SFCError |
SetItemImage(
SInt16 index
, SFXPathConstRef path
, UInt16 id
) Set the image of the specified item of this menu to the specified value.
|
SFCError |
SetItemImage(
SInt16 index
, SFBImageSmpConstRef param
) Set the image of the specified item of this menu to the specified value.
|
Void |
SetItemMargin(
SFXMarginConstRef param
) Set the margin of the item of this menu to the specified value.
|
SFCError |
SetItemSubMenu(
SInt16 index
, SFZTextMenuSmp subMenu
) Set the sub menu of the specified item of this menu to the specified value.
|
SFCError |
SetItemText(
SInt16 index
, SFXPathConstRef index
, UInt16 id
) Set the text of the specified item of this menu to the specified value.
|
SFCError |
SetItemText(
SInt16 index
, SFXWideStringConstRef param
) Set the text of the specified item of this menu to the specified value.
|
Void |
SetMenuStyle(
MenuStyleEnum param
) Set the menu style of this menu to the specified value.
|
Void |
SetSelBackColor(
SFXRGBColorConstRef param
) Set the background color of selected item of this menu to the specified value.
|
Void |
SetSelForeColor(
SFXRGBColorConstRef param
) Set the foreground color of selected item of this menu to the specified value.
|
Void |
SetSelect(
SInt16 param
) Set the index of currently selected item of this menu to the specified value.
|
SFCError |
SetTitle(
SFXPathConstRef path
, UInt16 id
) Set the title of this menu to the specified value.
|
SFCError |
SetTitle(
SFXWideStringConstRef param
) Set the title of this menu to the specified value.
|
Void |
SetTitleBackColor(
SFXRGBColorConstRef param
) Set the background color of the title of this menu to the specified value.
|
Void |
SetTitleForeColor(
SFXRGBColorConstRef param
) Set the foreground color of the title of this menu to the specified value.
|
Void |
SetTitleHeight(
SInt16 param
) Set the height of the title of this menu to the specified value. [pixels]
|
Void |
CancelTimer( Void )
(inherits from SFYMenu)
Cancel the timer of this menu.
|
Void |
ClearHandler( Void )
(inherits from SFYResponder)
Unregister all handlers from this responder.
|
Void |
ClearTracer( Void )
(inherits from SFYResponder)
Unregister all dispatching rules from the tracer of this responder.
|
SFCError |
Distribute(
SFXEventConstRef event
, BoolPtr result = null
)
(inherits from SFYResponder)
Distribute the specified event.
|
SFXRGBColorConstRef |
GetBackgroundColor( Void )
(inherits from SFYWidget)
Get the background color.
|
SFYResponderSmp |
GetChildBack( Void )
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBack(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBack(
UInt32 id
)
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBack(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBackward(
SInt32 index
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBackward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBackward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBackward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
SInt32 |
GetChildCount( Void )
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
SInt32 |
GetChildCount(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
SInt32 |
GetChildCount(
UInt32 id
)
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
SInt32 |
GetChildCount(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
SFYResponderSmp |
GetChildForward(
SInt32 index
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildForward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildForward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildForward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildFront( Void )
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildFront(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildFront(
UInt32 id
)
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildFront(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
SFYDistributerPtr |
GetDistributer( Void )
(inherits from SFYResponder)
Get the distributer bound with this responder.
|
AVKType |
GetEscapeKey( Void )
(inherits from SFYMenu)
Get the ESCAPE key of this menu.
|
SFYResponderSmp |
GetFrame( Void )
(inherits from SFYResponder)
Get the frame which has been attached to this responder.
|
SFXRectangle |
GetGlobalBound( Void )
(inherits from SFYResponder)
Get the globle region of this responder.
|
UInt32 |
GetID( Void )
(inherits from SFYResponder)
Get the ID of this responder instance.
|
SFXRectangle |
GetLocalBound( Void )
(inherits from SFYResponder)
Get the local region of this responder.
|
SInt32 |
GetNthBackward( Void )
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthBackward(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthBackward(
UInt32 id
)
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthBackward(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthForward( Void )
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthForward(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthForward(
UInt32 id
)
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthForward(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
AVKType |
GetOperateKey( Void )
(inherits from SFYMenu)
Get the operation key of this menu.
|
SFYResponderSmp |
GetParent( Void )
(inherits from SFYResponder)
Get the parent responder of this responder.
|
Bool |
GetPropertyTransparent( Void )
(inherits from SFYResponder)
Get the transparency attribute of this responder.
|
SFXRectangleConstRef |
GetRealBound( Void )
(inherits from SFYResponder)
Get the real region of this responder.
|
VoidPtr |
GetReference( Void )
(inherits from SFYResponder)
Get the reference of this responder.
|
SFYRendererPtr |
GetRenderer( Void )
(inherits from SFYResponder)
Get the renderer bound with this responder.
|
SFYResponderSmp |
GetRoot( Void )
(inherits from SFYResponder)
Get the root responder.
|
AVKType |
GetSelectDownKey( Void )
(inherits from SFYMenu)
Get the DOWN key of this menu.
|
AVKType |
GetSelectLeftKey( Void )
(inherits from SFYMenu)
Get the LEFT key of this menu.
|
AVKType |
GetSelectRightKey( Void )
(inherits from SFYMenu)
Get the RIGHT key of this menu.
|
AVKType |
GetSelectUpKey( Void )
(inherits from SFYMenu)
Get the UP key of this menu.
|
Bool |
GetStateActive(
Bool inherit = false
)
(inherits from SFYResponder)
Get the active state of this responder.
|
Bool |
GetStateEnable(
Bool inherit = false
)
(inherits from SFYResponder)
Get the enable state of this responder.
|
Bool |
GetStateFocus(
Bool inherit = false
)
(inherits from SFYResponder)
Get the focus state of this responder.
|
Bool |
GetStateValid(
Bool inherit = false
)
(inherits from SFYResponder)
Get the valid state of this responder.
|
Bool |
GetStateVisible(
Bool inherit = false
)
(inherits from SFYResponder)
Get the visible state of this responder.
|
SFXRectangle |
GetSuitableBound( Void )
(inherits from SFYResponder)
Get the suitable region of this responder.
|
SFXRectangle |
GetSuitableBound(
SFXRectangleConstRef rectangle
)
(inherits from SFYResponder)
Get the suitable region of this responder.
|
SFXRectangle |
GetSuitableBound(
SFXRectangleConstRef param
, HorizontalEnum horizontal
, VerticalEnum vertical
)
(inherits from SFYResponder)
Get the suitable region of this responder.
|
SFXMargin |
GetSuitableMargin( Void )
(inherits from SFYResponder)
Get the suitable frame margin region of this responder.
|
SFCType |
GetType( Void )
(inherits from SFYResponder)
Get the type of this responder class.
|
SFXRectangleConstRef |
GetVirtualBound( Void )
(inherits from SFYResponder)
Get the virtual region of this responder.
|
Bool |
HasFrame( Void )
(inherits from SFYResponder)
Check whether or not this responder is a content-responder.
|
Void |
Initialize( Void )
(inherits from SFYResponder)
Initialize this responder.
|
Bool |
IsBack( Void )
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsBack(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsBack(
UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsBack(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsFrame( Void )
(inherits from SFYResponder)
Check whether or not this responder is an attachment-frame.
|
Bool |
IsFront( Void )
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsFront(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsFront(
UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsFront(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthBackward(
SInt32 index
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthBackward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthBackward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthBackward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthForward(
SInt32 index
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthForward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthForward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthForward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsRoot( Void )
(inherits from SFYResponder)
Check whether or not this responder is the root responder.
|
SFCError |
Recover( Void )
(inherits from SFYResponder)
Recover the intersection region between this responder and the responder space by using the saved bitmap to restore the device bitmap.
|
SFCError |
RegisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
SFCError |
RegisterHandler(
SFXEventRangeConstRef range
, SFYHandler::HandlerSPP spp
, VoidPtr reference
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
SFCError |
RegisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::RuleRecConstPtr rule
, SInt32 length
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
SFCError |
RegisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::HandlerSPPConstPtr spp
, VoidPtrConstPtr reference
, SInt32 length
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
SFCError |
RegisterTracer(
SFXEventRangeConstRef range
, SFYTracer::RuleRecConstRef rule
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
SFCError |
RegisterTracer(
SFXEventRangeConstRef range
, SFYTracer::OrderEnum order
, SFYTracer::StateEnum state
, Bool overload
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
SFCError |
RegisterTracer(
SFXEventRangeConstPtr range
, SFYTracer::RuleRecConstPtr rule
, SInt32 length
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
SFCError |
RegisterTracer(
SFXEventRangeConstPtr range
, SFYTracer::OrderEnumConstPtr order
, SFYTracer::StateEnumConstPtr state
, BoolConstPtr overload
, SInt32 length
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
SFCError |
Render(
Bool force = false
)
(inherits from SFYResponder)
Boot up the renderer for redrawing this responder and its descendant responders.
|
Void |
RewindTimer( Void )
(inherits from SFYMenu)
Reset the time until this menu is automatically closed.
|
Void |
ScheduleTimer(
UInt32 param
)
(inherits from SFYMenu)
Schedule the timer that HandleEscapeKey() will be called after the specified time elapses. [milliseconds]
|
Void |
SetBackgroundColor(
SFXRGBColorConstRef param
)
(inherits from SFYWidget)
Set the background color to the specified value.
|
Void |
SetDistributer(
SFYDistributerPtr param
)
(inherits from SFYResponder)
Bind this responder with the specified distributer.
|
Void |
SetEscapeKey(
AVKType param
)
(inherits from SFYMenu)
Set the ESCAPE key of this menu to the specified value.
|
SFCError |
SetFrame(
SFYResponderSmpConstRef param
)
(inherits from SFYResponder)
Attach the specified frame to this frame.
|
Void |
SetID(
UInt32 param
)
(inherits from SFYResponder)
Set the ID value of this responder to the specified value.
|
Void |
SetOperateKey(
AVKType param
)
(inherits from SFYMenu)
Set the operation key of this menu to the specified value.
|
SFCError |
SetParent(
SFYResponderSmpConstRef param
)
(inherits from SFYResponder)
Set the parent responder of this responder to the specified responder.
|
Void |
SetProperty(
Bool transparent
)
(inherits from SFYResponder)
Set the property of this responder to the specified value.
|
Void |
SetPropertyTransparent(
Bool param
)
(inherits from SFYResponder)
Set the transparency attribute of this responder to the specified value.
|
Void |
SetRealBound(
SFXRectangleConstRef param
)
(inherits from SFYResponder)
Set the real region of this responder to the specified region.
|
Void |
SetReference(
VoidPtr param
)
(inherits from SFYResponder)
Set the reference value of this responder to the specified value.
|
Void |
SetRenderer(
SFYRendererPtr param
)
(inherits from SFYResponder)
Bind this responder with the specified renderer.
|
Void |
SetSelectDownKey(
AVKType param
)
(inherits from SFYMenu)
Set the DOWN key of this menu to the specified value.
|
Void |
SetSelectLeftKey(
AVKType param
)
(inherits from SFYMenu)
Set the LEFT key of this menu to the specified value.
|
Void |
SetSelectRightKey(
AVKType param
)
(inherits from SFYMenu)
Set the RIGHT key of this menu to the specified value.
|
Void |
SetSelectUpKey(
AVKType param
)
(inherits from SFYMenu)
Set the UP key of this menu to the specified value.
|
Void |
SetState(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Set all states of this responder to specified values together.
|
Void |
SetStateActive(
Bool param
)
(inherits from SFYResponder)
Set the active state of this responder to the specified value.
|
Void |
SetStateEnable(
Bool param
)
(inherits from SFYResponder)
Set the enable state of this responder to the specified value.
|
Void |
SetStateFocus(
Bool param
)
(inherits from SFYResponder)
Set the focus state of this responder to the specified value.
|
Void |
SetStateVisible(
Bool param
)
(inherits from SFYResponder)
Set the visible state of this responder to the specified value.
|
Void |
SetVirtualBound(
SFXRectangleConstRef param
)
(inherits from SFYResponder)
Set the virtual region of this responder to the specified value.
|
SFCError |
Snapshot(
SFBBitmapSmpConstRef bitmap
)
(inherits from SFYResponder)
Get a snapshot image of the intersection region between this responder and the responder space by using the saved bitmap.
|
Void |
Terminate( Void )
(inherits from SFYResponder)
Terminate this responder.
|
Void |
ToBack( Void )
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToBack(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToBack(
UInt32 id
)
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToBack(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToFront( Void )
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToFront(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToFront(
UInt32 id
)
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToFront(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthBackward(
SInt32 index
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthBackward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthBackward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthBackward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthForward(
SInt32 index
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthForward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthForward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthForward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Void |
UnregisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
Void |
UnregisterHandler(
SFXEventRangeConstRef range
, SFYHandler::HandlerSPP spp
, VoidPtr reference
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
Void |
UnregisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::RuleRecConstPtr rule
, SInt32 length
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
Void |
UnregisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::HandlerSPPConstPtr spp
, VoidPtrConstPtr reference
, SInt32 length
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
Void |
UnregisterTracer(
SFXEventRangeConstRef range
)
(inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
|
Void |
UnregisterTracer(
SFXEventRangeConstPtr range
, SInt32 length
)
(inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
|
T const & |
static_catch(
Void
)
(inherits from static_exception)
Get the current exception.
|
Protected Functions | |
---|---|
Void |
HandleBoundReal( Void ) This function will be called when the real region is changed.
|
Void |
HandleBoundVirtual( Void )
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event is received.
[Perform the processing when the virtual region is changed.]
|
Void |
HandleEscapeKey( Void ) This function will be called when the SFEVT_KEY event of the ESCAPE key is received.
|
Void |
HandleOperateKey( Void ) This function will be called when the SFEVT_KEY event of the operation key is received.
|
Void |
HandleRenderRequest(
SFXGraphicsPtr graphics
)
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received.
[Draw this menu.]
|
Void |
HandleSelectDownKey( Void ) This function will be called when the DOWN key is pressed.
|
Void |
HandleSelectLeftKey( Void ) This function will be called when the LEFT key is pressed.
|
Void |
HandleSelectRightKey( Void ) This function will be called when the RIGHT key is pressed.
|
Void |
HandleSelectUpKey( Void ) This function will be called when the UP key is pressed.
|
static SFYResponderSmp |
Factory(
SFYResponderPtr responder
, SFCErrorPtr exception = null
)
(inherits from SFYResponder)
This function is used to implement the NewInstance function.
|
SFYResponderSmp |
GetThis( Void )
(inherits from SFYResponder)
Get the smart pointer of this responder.
|
Void |
HandleBoundGlobal(
SFXRectangleConstRef rectangle
)
(inherits from SFYWidget)
This function will be called when the global region is changed.
|
Void |
HandleBoundOptimize(
SFXRectanglePtr rectangle
)
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE) event is received.
[Calculate the suitable rectangle size of this responder within the specified hint rectangle.]
|
Void |
HandleBoundRequest(
SFXRectanglePtr rectangle
)
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event is received.
[Calculate the suitable rectangle size of this responder.]
|
Void |
Invalidate( Void )
(inherits from SFYResponder)
Register the specified redraw region of this responder.
|
Void |
Invalidate(
SFXRectangleConstRef param
)
(inherits from SFYResponder)
Register the specified redraw region of this responder.
|
Void |
InvokeBackward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
)
(inherits from SFYResponder)
Call the handlers for the specified event from the end of the handler list registered into this responder.
|
Void |
InvokeForward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
)
(inherits from SFYResponder)
Call the handlers for the specified event from the head of the handler list registered into this responder.
|
Void |
SetType(
SFCType param
)
(inherits from SFYResponder)
Set the Type value of this responder to the specified 4-character value.
|
Void |
static_throw(
static_exception< T > const & param
)
(inherits from static_exception)
Set an exception.
|
Void |
static_throw(
T const & param
)
(inherits from static_exception)
Set an exception.
|
Bool |
static_try(
Void
)
(inherits from static_exception)
Confirm whether or not the exception is retained.
|
Types |
---|
CodeEnum Constant that represents the SFZTextMenu class.
|
MenuStyleEnum Constant that represents the enum of the menu style.
|
HorizontalEnum
(inherits from SFYResponder)
Constants that represent the horizontal alignment.
|
VerticalEnum
(inherits from SFYResponder)
Constants that represent the vertical alignment.
|
[ protected, explicit ] SFZTextMenu(Void);
This constructor performs the initializations as follows:
Table 242. Event handler
Event | Content of the handler |
---|---|
SFEVT_KEY event of the access key set with SFZTextMenu::SetItemAccessKey | Call the SFZTextMenu::HandleOperateKey function. |
Result event[SFEVT_RESPONDER_RESULT] | Terminate this menu. If this menu is a sub menu, terminate all its parent menus too. |
Note | |
---|---|
In a responder inheriting from SFZTextMenu the corresponding handler will be called when the above event occurs. |
SFYResponder::SetType | SFZTextMenu::CodeEnum | SFZTextMenu::MenuStyleEnum | SFZTextMenu::SetMenuStyle | SFZTextMenu::SetFont | SFZTextMenu::SetBevelColor | SFZTextMenu::SetTitleBackColor | SFZTextMenu::SetTitleForeColor | SFZTextMenu::SetDefaultItemBackColor | SFZTextMenu::SetDefaultItemForeColor | SFZTextMenu::SetSelBackColor | SFZTextMenu::SetSelForeColor | SFZTextMenu::SetTitle | SFZTextMenu::SetTitleHeight | SFZTextMenu::SetItemHeight | SFZTextMenu::SetItemMargin | SFZTextMenu::SetSelect | SFZTextMenu::SetItemAccessKey | SFZTextMenu::HandleOperateKey | SFXBevelColor | SFXRGBColor | SFXMargin | Type | Event | Key Event[SFEVT_KEY]
[ protected, virtual ] virtual ~SFZTextMenu(Void);
Delete all items from this text menu.
[ public ] SFCError AppendItem( SFXPathConstRef path // path to resource file UInt16 id // object id );
[ public ] SFCError AppendItem( SFXPathConstRef path // path to resource file UInt16 id // object id AVKType key // access key WChar keyIcon = 0 // key icon );
[ public ] SFCError AppendItem( SFXWideStringConstRef text // text );
[ public ] SFCError AppendItem( SFXWideStringConstRef text // text AVKType key // access key WChar keyIcon = 0 // key icon );
This function appends an item to this menu. The appended item becomes the last item of this menu.
Caution | |
---|---|
Since this function is deprecated, use the SFZTextMenu::InsertLast function instead. |
SFZTextMenu::InsertLast | SFZTextMenu::RemoveItem | SFZTextMenu::Clear
[ public ] Void Clear(Void);
This function deletes all items from this menu.
[ public, const ] SFXBevelColorConstRef GetBevelColor(Void);
Bevel color (SFXBevelColor) of this menu, which is the color of the outer frame to draw this menu in the 3D style.
[ public, const ] SFXRGBColorConstRef GetDefaultItemBackColor(Void);
This function gets the default background color(SFXRGBColor) of unselected item of this menu.
[ public, const ] SFXRGBColorConstRef GetDefaultItemForeColor(Void);
This function gets the default foreground color(SFXRGBColor) to draw the text of unselected item of this menu.
[ public, const ] AEEFont GetFont(Void);
This function gets the font to draw the item and the title of this menu.
This function gets the access key of the specified item of this menu. AVK_UNDEFINED will be returned if the access key is not set.
[ public, const ] SFXRGBColorConstRef GetItemBackColor( SInt16 index // index of item );
This function gets the background color(SFXRGBColor) of the specified unselected item of this menu.
[ public, const ] SInt16 GetItemCount(Void);
This function gets the number of the items of this menu.
This function gets the value of enable flag of the specified item of this menu. If the specified item is valid, "true" will be returned. Otherwise "false" will be returned.
[ public, const ] SFXRGBColorConstRef GetItemForeColor( SInt16 index // index of item );
This function gets the foreground color(SFXRGBColor) to draw the text of the specified unselected item of this menu.
[ public, const ] SInt16 GetItemHeight(Void);
This function gets the item height of this menu.
[ public, const ] SFBImageSmpConstRef GetItemImage( SInt16 index // index of item );
Pointer to the image attached with the item.
This function gets the image of the specified item of this menu.
[ public, const ] SFXMarginConstRef GetItemMargin(Void);
This function gets the margin between the border and the text of the item of this menu.
This margin region is filled in the bevel color set with the SFZTextMenu::SetBevelColor function.
SFZTextMenu::SetItemMargin | SFZTextMenu::GetBevelColor | SFXMargin | SFXBevelColor
[ public ] SFZTextMenuSmp GetItemSubMenu( SInt16 index // index of item );
[ public, const ] SFXWideStringConstRef GetItemText( SInt16 index // index of item );
This function gets the text of the specified item of this menu.
[ public, const ] MenuStyleEnum GetMenuStyle(Void);
This function gets the menu style of this menu.
[ public ] SFZTextMenuSmp GetRootMenu(Void);
Root menu of this menu[The parent menu at the highest position is called "Root menu".]
This function gets the root menu of this menu.
Tip | |
---|---|
To close a menu which has a parent menu, call only the SFYResponder::Terminate function of its root menu gotten by calling this function. |
[ public, const ] SFXRGBColorConstRef GetSelBackColor(Void);
This function gets the background color(SFXRGBColor) of selected item of this menu.
[ public, const ] SFXRGBColorConstRef GetSelForeColor(Void);
This function gets the foreground color(SFXRGBColor) of selected item of this menu.
[ public, const ] SInt16 GetSelect(Void);
Index of currently selected item.
This function gets the index of currently selected item of this menu.
[ public, const ] SFXWideStringConstRef GetTitle(Void);
Menu title.
This function gets the title of this menu.
[ public, const ] SFXRGBColorConstRef GetTitleBackColor(Void);
Background color (SFXRGBColor) to fill the rectangle containing the title.
This function gets the background color(SFXRGBColor) of the title of this menu, in which the rectangle containing the title is filled.
[ public, const ] SFXRGBColorConstRef GetTitleForeColor(Void);
Foreground color (SFXRGBColor) of the title.
This function gets the foreground color(SFXRGBColor) of the title of this menu, in which the title is drawn.
[ public, const ] SInt16 GetTitleHeight(Void);
Height of the title.
This function gets the height of the title of this menu.
[ protected, virtual ] Void HandleBoundReal(Void);
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event is received.
In case you want to perform your own processing, override this function.
The default implementation is as follows:
Sending the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event | |
---|---|
The (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event will occur when the real region is changed by calling the SFYResponder::SetRealBound function. |
Processing when the real region is changed | |
---|---|
Other than overriding this virtual function, there is another method to define and implement the handler for the region event[XANDLER_DECLARE_VOIDBOUND], and register it into the responder. In the processing when the real region is updated, this virtual function is executed first, and next the handlers for the region event are executed in the registered order. |
Internal implementation of the SFZTextMenu::HandleBoundReal function is as follows:
/*protected virtual */Void SFZTextMenu::HandleBoundReal(Void) { SetVirtualBound(SFXRectangle(SFXGrid::ZeroInstance(), GetRealBound().GetSize())); if (_itemHeight != 0) { _field = (GetLocalBound().GetHeight() - _titleHeight) / _itemHeight; } Invalidate(); return; }// SFZTextMenu::HandleBoundReal //
SFYResponder::SetRealBound | SFXEvent | Real Region | Virtual Region | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND]
[ protected, virtual ] Void HandleBoundVirtual(Void);
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event is received.
In case you want to perform your own processing when the virtual region is changed, override this virtual function.
The default implementation is to equalize the virtual region with the real region.
Sending the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event | |
---|---|
The (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event will occur when the virtual region is changed by calling the SFYResponder::SetRealBound or SFYResponder::SetVirtualBound function. |
Another method when the virtual region is changed | |
---|---|
Other than overriding this virtual function, it is possible to define and implement the handler for region event[XANDLER_DECLARE_VOIDBOUND], and register it into the responder. In the processing when the virtual region is updated, this virtual function is executed first, and next the handlers for region event are executed in the registered order. In almost all cases, the method to override this virtual function is adopted since defining, implementing and registering the handler for region event can be omitted. |
Internal implementation of the SFZTextMenu::HandleBoundVirtual function is as follows:
/*protected virtual */Void SFZTextMenu::HandleBoundVirtual(Void) { SetVirtualBound(SFXRectangle(SFXGrid::ZeroInstance(), GetRealBound().GetSize())); return; }// SFZTextMenu::HandleBoundVirtual //
SFYResponder::SetRealBound | SFXEvent | Real Region | Virtual Region | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND]
[ protected, virtual ] Void HandleEscapeKey(Void);
This function will be called when the SFEVT_KEY event(key event[SFEVT_KEY]) of the ESCAPE key set with the SFYMenu::SetEscapeKey function is received.
In case you want to perform your own processing, override this function.
The default implementation is as follows:
Internal implementation of the SFZTextMenu::HandleEscapeKey function is as follows:
/*protected virtual */Void SFZTextMenu::HandleEscapeKey(Void) { if (HasParentMenu()) { SetState(false, false, false, false); SFZTextMenuSmp parent(static_pointer_cast<SFZTextMenu>(GetParent())); if (parent != null) { parent->SetState(true, true, true, true); parent->ToFront(); } } else { InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_ESCAPE, 0), false); } return; }// SFZTextMenu::HandleEscapeKey //
SFYMenu::SetEscapeKey | SFXEvent | Result Event[SFEVT_RESPONDER_RESULT] | Key Event[SFEVT_KEY]
[ protected, virtual ] Void HandleOperateKey(Void);
This function will be called when the SFEVT_KEY event(key event[SFEVT_KEY]) of the operaion key set with the SFYMenu::SetOperateKey function is received.
In case you want to perform your own processing, override this function.
The default implementation is as follows:
Internal implementation of the SFZTextMenu::HandleOperateKey function is as follows:
enum CodeEnum { CODE_TYPE = four_char_code('m', 't', 'm', 'n') }; /*protected virtual */Void SFZTextMenu::HandleOperateKey(Void) { MenuItemPtr item; SFZTextMenuSmp subMenu; item = GetMenuItem(_selectedItem); if (item != null && item->enable) { if (item->subMenu != null) { subMenu = item->subMenu; subMenu->SetState(true, true, true, true); subMenu->SetMenuStyle(GetMenuStyle()); subMenu->SetSelect(0); subMenu->ToFront(); } else { InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_OK, GetSelect()), false); } } return; }// SFZTextMenu::HandleOperateKey //
SFYMenu::SetOperateKey | SFZTextMenu::SetItemEnable | SFXEvent | key event[SFEVT_KEY] | Result Event[SFEVT_RESPONDER_RESULT] | Key Event[SFEVT_KEY]
[ protected, virtual, const ] Void HandleRenderRequest( SFXGraphicsPtr graphics // graphic object );
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received.
In case you want to perform your own drawing of this responder, override this function.
The default implementation is to draw this menu.
The method to darw a responder | |
---|---|
In addition to overriding this virtual function, it is possible to define and implement the handler for drawing event(drawing handler)[XANDLER_DECLARE_VOIDRENDER], and register it into the responder. Then, the overridden virtual function will be called first, and next the drawing handlers registered into the responder will be booted up in the registered order. In almost all cases, the method to override this function is used to draw the responder since there is no need to declare and register the drawing handler. |
Procedure of drawing a responder | |
---|---|
The drawing handler will be booted up when the drawing event(SFEVT_RESPONDER_RENDER) occurs. And then the drawing handler draw the responder actually. The drawing event will be sent to only the responders including the region to be redrawn out of the redraw regions registered into the renderer using the SFYResponder::InvokeBackward function after the SFYResponder::Render function boots up the renderer. Here, the SFYResponder::Render function will be called at the following situations:
If calling the SFYResponder::Render function with specifying "true" as an argument, the drawing event will be sent to all the responders to be actually displayed on the screen which are located below the responder in the responder tree, regardless of the registration of redraw region. |
Internal implementation of the SFZTextMenu::HandleRenderRequest function is as follows:
enum MenuStyleEnum { PAGE_STYLE = 0, SCROLLABLE_STYLE, DEFAULT_STYLE = PAGE_STYLE }; /*protected virtual */Void SFZTextMenu::HandleRenderRequest(SFXGraphicsPtr graphics) const { DrawMenu(graphics); return; }// SFZTextMenu::HandleRenderRequest // /*private */Void SFZTextMenu::DrawMenu(SFXGraphicsPtr graphics) const { SFXRectangle menuRect(GetLocalBound()); SFXRectangle titleRect; SFXRectangle pageRect; SFXRectangle contentRect; SFXRectangle temp; SInt32 pageSize; SInt32 pageNumber; SInt32 pageCount; graphics->FillBevelRectangle(menuRect, _color.bevel); titleRect = menuRect; titleRect.SetHeight(_titleHeight); pageRect = titleRect; pageRect.AddLeft(pageRect.GetWidth() - 2 - SFXGraphics::MeasureSingleText(AEE_FONT_NORMAL, "9/9")); contentRect = menuRect; contentRect.AddTop(_titleHeight); pageSize = _field; contentRect.SetHeight(static_cast<SInt16>(_itemHeight * pageSize)); menuRect.SetHeight(_titleHeight + contentRect.GetHeight()); graphics->SetFont(_font); temp = titleRect; temp.Deflate(1, 1); graphics->FillRectangle(temp, _color.titleBack); graphics->SetFont(_font); graphics->DrawSingleText(_title, titleRect.GetOrigin() + SFXGrid(2, 2), titleRect, _color.titleFore); if (_style == PAGE_STYLE) { if (pageSize != 0) { pageNumber = Ceil(_selectedItem + 1, pageSize); pageCount = Ceil(GetItemCount(), pageSize); pageNumber = (pageCount == 0) ? 0 : pageNumber; graphics->SetFont(_font); graphics->DrawSingleText(SFXAnsiString::Format("%d/%d", pageNumber, pageCount), pageRect.GetOrigin() + SFXGrid(0, 2), pageRect, _color.titleFore, IDF_ALIGN_CENTER); DrawPage(graphics, contentRect, pageSize, pageNumber); } } else if (_style == SCROLLABLE_STYLE) { pageRect.AddLeft(_itemHeight); DrawPage(graphics, contentRect, pageRect); } return; }// SFZTextMenu::DrawMenu // /*private */Void SFZTextMenu::DrawPage(SFXGraphicsPtr graphics, SFXRectangleConstRef rect, SInt32 pageSize, SInt32 pageNumber) const { SInt32 i; SInt32 firstIndex; MenuItemPtr item; SFXRectangle contentRect(rect); SFXRectangle itemRect; firstIndex = (pageNumber - 1) * pageSize; contentRect.SetHeight(_itemHeight); for (i = firstIndex; i < firstIndex + pageSize; ++ i) { if ((item = GetMenuItem(i)) != null) { itemRect = contentRect; itemRect.Deflate(_itemMargin); DrawItem(graphics, itemRect, item); contentRect.AddY(_itemHeight); } else { break; } } return; }// SFZTextMenu::DrawPage // /*private */Void SFZTextMenu::DrawPage(SFXGraphicsPtr graphics, SFXRectangleConstRef rect, SFXRectangleConstRef scroll) const { SInt32 i; MenuItemPtr item; SFXRectangle upRect(scroll); SFXRectangle downRect; SFXRectangle contentRect(rect); SFXRectangle itemRect; upRect.SubBottom(upRect.GetHeight() / 2); upRect.Deflate(1, 1); downRect = upRect; //downRect.AddY(upRect.GetHeight() + 1); downRect.Offset(0, upRect.GetHeight() + 2); if (_selectedItem > 0) { DrawTriangle(graphics, upRect, _color.selFore, 0); } if (_selectedItem < GetItemCount() - 1) { DrawTriangle(graphics, downRect, _color.selFore, 1); } contentRect.SetHeight(_itemHeight); for (i = 0; i < _field; ++ i) { if ((item = GetMenuItem(i + _topIndex)) != null) { itemRect = contentRect; itemRect.Deflate(_itemMargin); DrawItem(graphics, itemRect, item); contentRect.AddY(_itemHeight); } else { break; } } return; }// SFZTextMenu::DrawPage // /*private */Void SFZTextMenu::DrawItem(SFXGraphicsPtr graphics, SFXRectangleConstRef rect, MenuItemPtr item) const { SFXRectangle itemRect(rect); SFXRectangle iconRect; SFXRectangle imageRect; SFXRGBColor itemColor(item->foreColor); if (item == GetMenuItem(_selectedItem)) { graphics->FillRectangle(itemRect, _color.selBack); itemColor.Set(_color.selFore); } else { graphics->FillRectangle(itemRect, item->backColor); } if (!item->enable) { itemColor = DiffLightness(item->backColor); } if (item->subMenu != null) { iconRect = itemRect; iconRect.Deflate(iconRect.GetWidth() - iconRect.GetHeight() / 3, 0, -1, 0); iconRect.Deflate(0, iconRect.GetHeight() / 3 + 1, 0, 0); DrawTriangle(graphics, iconRect, itemColor, 2); itemRect.SubRight(iconRect.GetWidth() + 1); } if (item->keyIcon != 0) { iconRect = itemRect; iconRect.SetWidth(_itemHeight); itemRect.AddLeft(_itemHeight); graphics->SetFont(_font); graphics->DrawSingleText(SFXWideString(item->keyIcon), iconRect, itemColor, IDF_ALIGN_LEFT); } if (item->image != null) { imageRect = itemRect; imageRect.SetWidth(_itemHeight); itemRect.AddLeft(_itemHeight); AEEImageInfo info; SInt16 dx; SInt16 dy; item->image->GetInfo(&info); if (info.cx > 0 && info.cy > 0) { dx = (imageRect.GetWidth() - info.cx) / 2; dy = (imageRect.GetHeight() - info.cy) / 2; imageRect.SetSize(info.cx, info.cy); graphics->DrawImage(item->image, imageRect.GetOrigin() + SFXGrid(dx, dy)); } } graphics->SetFont(_font); graphics->DrawSingleText(item->text, itemRect, itemColor, IDF_ALIGN_LEFT); return; }// SFZTextMenu::DrawItem // /*private */Void SFZTextMenu::DrawTriangle(SFXGraphicsPtr graphics, SFXRectangleConstRef rect, SFXRGBColorConstRef color, SInt16 direction) const { SFXTriangle triangle; SInt16 width((rect.GetWidth() / 4) * 2); SFXPixel pixel; switch (direction) { case 0: //up pixel.Set(rect.GetVertexLeftBottom()); triangle.SetFirst(pixel); pixel.Offset(width, 0); triangle.SetSecond(pixel); pixel.Offset(0 - width / 2, 0 - width / 2); triangle.SetThird(pixel); break; case 1: //down pixel.Set(rect.GetVertexLeftTop()); triangle.SetFirst(pixel); pixel.Offset(width, 0); triangle.SetSecond(pixel); pixel.Offset(0 - width / 2, width / 2); triangle.SetThird(pixel); break; case 2: //right pixel.Set(rect.GetVertexLeftTop()); triangle.SetFirst(pixel); pixel.Offset(0, width * 2); triangle.SetSecond(pixel); pixel.Offset(width, 0 - width); triangle.SetThird(pixel); break; default: break; } graphics->SetForeColor(color); graphics->SetFillColor(color); graphics->SetFillMode(true); graphics->DrawTriangle(triangle); return; }// SFZTextMenu::DrawTriangle //
SFYResponder::Invalidate | SFYResponder::Render | SFYResponder::InvokeBackward | SFXEvent | Drawing Event[SFEVT_RESPONDER_RENDER] | Handler for the Drawing Event[XANDLER_DECLARE_VOIDRENDER] | Rendering | Event Loop | Responder Tree
[ protected, virtual ] Void HandleSelectDownKey(Void);
This function will be called when the SFEVT_KEY event(key event[SFEVT_KEY]) of the DOWN key set with the SFYMenu::SetSelectDownKey function is received.
In case you want to perform your own processing, override this function.
The default implementation is as follows:
In case of the paging style
In case of the scrollable style
Internal implementation of the SFZTextMenu::HandleSelectDownKey function is as follows:
enum MenuStyleEnum { PAGE_STYLE = 0, SCROLLABLE_STYLE, DEFAULT_STYLE = PAGE_STYLE }; /*protected virtual */Void SFZTextMenu::HandleSelectDownKey(Void) { if (_selectedItem < GetItemCount() - 1) { ++_selectedItem; } else if (_style == PAGE_STYLE && _selectedItem == GetItemCount() - 1) { _selectedItem = 0; } RefreshMenu(); return; }// SFZTextMenu::HandleSelectDownKey // /*private */Void SFZTextMenu::RefreshMenu(Void) { if (_style == SCROLLABLE_STYLE) { if (_field > 0 && _selectedItem >= 0 && _selectedItem < GetItemCount()) { if (_topIndex > GetItemCount() - _field) { _topIndex = GetItemCount() - _field; } if (_topIndex < 0) { _topIndex = 0; } if (_topIndex > _selectedItem) { _topIndex = _selectedItem; } else if (_topIndex < _selectedItem - _field + 1) { _topIndex = _selectedItem - _field + 1; } } } Invalidate(); return; }// SFZTextMenu::RefreshMenu
[ protected, virtual ] Void HandleSelectLeftKey(Void);
This function will be called when the SFEVT_KEY event(key event[SFEVT_KEY]) of the LEFT key set with the SFYMenu::SetSelectLeftKey function is received.
In case you want to perform your own processing, override this function.
The default implementation is as follows:
Internal implementation of the SFZTextMenu::HandleSelectLeftKey function is as follows:
/*protected virtual */Void SFZTextMenu::HandleSelectLeftKey(Void) { if (HasParentMenu()) { SetState(false, false, false, false); SFYResponderSmp parent = GetParent(); if (parent != null) { parent->SetState(true, true, true, true); parent->ToFront(); } } return; }// SFZTextMenu::HandleSelectLeftKey //
[ protected, virtual ] Void HandleSelectRightKey(Void);
This function will be called when the SFEVT_KEY event(key event[SFEVT_KEY]) of the RIGHT key set with the SFYMenu::SetSelectRightKey function is received.
In case you want to perform your own processing, override this function.
The default implementation is as follows:
Internal implementation of the SFZTextMenu::HandleSelectRightKey function is as follows:
/*protected virtual */Void SFZTextMenu::HandleSelectRightKey(Void) { MenuItemPtr item; SFZTextMenuSmp subMenu; if ((item = GetMenuItem(_selectedItem)) != null) { if (item->subMenu != null && item->enable) { subMenu = item->subMenu; subMenu->SetState(true, true, true, true); subMenu->SetMenuStyle(GetMenuStyle()); subMenu->SetSelect(0); subMenu->ToFront(); } } return; }// SFZTextMenu::HandleSelectRightKey //
SFYMenu::SetSelectRightKey | SFXEvent | Key Event[SFEVT_KEY]
[ protected, virtual ] Void HandleSelectUpKey(Void);
This function will be called when the SFEVT_KEY event(key event[SFEVT_KEY]) of the UP key set with the SFYMenu::SetSelectUpKey function is received.
In case you want to perform your own processing, override this function.
In case of the paging style
In case of the scrollable style
Internal implementation of the SFZTextMenu::HandleSelectUpKey function is as follows:
enum MenuStyleEnum { PAGE_STYLE = 0, SCROLLABLE_STYLE, DEFAULT_STYLE = PAGE_STYLE }; /*protected virtual */Void SFZTextMenu::HandleSelectUpKey(Void) { if (_selectedItem > 0) { --_selectedItem; } else if (_style == PAGE_STYLE && _selectedItem == 0) { _selectedItem = GetItemCount() - 1; if (_selectedItem < 0) { _selectedItem = 0; } } RefreshMenu(); return; }// SFZTextMenu::HandleSelectUpKey // /*private */Void SFZTextMenu::RefreshMenu(Void) { if (_style == SCROLLABLE_STYLE) { if (_field > 0 && _selectedItem >= 0 && _selectedItem < GetItemCount()) { if (_topIndex > GetItemCount() - _field) { _topIndex = GetItemCount() - _field; } if (_topIndex < 0) { _topIndex = 0; } if (_topIndex > _selectedItem) { _topIndex = _selectedItem; } else if (_topIndex < _selectedItem - _field + 1) { _topIndex = _selectedItem - _field + 1; } } } Invalidate(); return; }// SFZTextMenu::RefreshMenu
[ public, const ] Bool HasParentMenu(Void);
This fucntion checks whether or not this menu has any parent menu.
SFZTextMenu::HandleEscapeKey | SFZTextMenu::HandleSelectLeftKey | SFZTextMenu::GetRootMenu
[ public ] SFCError Insert( SInt32 index // index of item SFXPathConstRef path // path to resource file UInt16 id // object id );
[ public ] SFCError Insert( SInt32 index // index of item SFXPathConstRef path // path to resource file UInt16 id // object id AVKType key // access key WChar keyIcon // key icon );
[ public ] SFCError Insert( SInt32 index // index of item SFXWideStringConstRef text // text );
[ public ] SFCError Insert( SInt32 index // index of item SFXWideStringConstRef text // text AVKType key // access key WChar keyIcon // key icon );
This function inserts the specified item before the specified index.
If the value of the specified index is less than or equals 0, the item will be inserted at the head.
If the value of the specified index is greater than or equals the number of items, the item will be inserted at the tail.
[ public ] SFCError InsertFirst( SFXPathConstRef path // path to resource file UInt16 id // object id );
[ public ] SFCError InsertFirst( SFXPathConstRef path // path to resource file UInt16 id // object id AVKType key // access key WChar keyIcon // key icon );
[ public ] SFCError InsertFirst( SFXWideStringConstRef text // text );
[ public ] SFCError InsertFirst( SFXWideStringConstRef text // text AVKType key // access key WChar keyIcon // key icon );
This function inserts the specified item at the head.
[ public ] SFCError InsertLast( SFXPathConstRef path // path to resource file UInt16 id // object id );
[ public ] SFCError InsertLast( SFXPathConstRef path // path to resource file UInt16 id // object id AVKType key // access key WChar keyIcon // key icon );
[ public ] SFCError InsertLast( SFXWideStringConstRef text // text );
[ public ] SFCError InsertLast( SFXWideStringConstRef text // text AVKType key // access key WChar keyIcon // key icon );
This function inserts the specified item at the tail.
[ public, static ] SFZTextMenuSmp NewInstance( SFCErrorPtr exception = null // error value );
Return the error value generated inside the function.
This function creates a new instance of this responder class.
If succeeds, a not null pointer will be returned, and the "exception" argument is SFERR_NO_ERROR. If fails such as insufficient memory, a null pointer will be returned, and the "exception" argument holds the error value.
The code to create a new instance of this responder class is as follows:
SFZTextMenuSmp _textmenu;
SFCError error;
if ((_textmenu = SFZTextMenu::NewInstance(&error)) != null) {
...
}
[ public ] Void Remove( SInt32 index // index of item to delete );
[ public ] Void Remove( SInt32 begin // beginning index to remove(this index is included) SInt32 end // ending index to remove(this index is not included) );
This function removes the item at the specified index or the items in the specified index range from this text menu.
If the specified index is less than 0 or greater than or equals the number of items, no item will be removed
If the beginning index to remove is greater than or equals the number of items or the ending index to remove is less than or equals 0, no item will be removed
If the beginning index to remove is less than or equals 0, it will be reset to 0.
If the ending index to remove is greater than the number of items, it will be reset to the number of items.
SFZTextMenuSmp menu; // create instance etc. ... // insert item at the tail if (menu->InsertLast("0 index") == SFERR_NO_ERROR) { // insert item at the tail if (menu->InsertLast("1 index") == SFERR_NO_ERROR) { // insert item at the tail if (menu->InsertLast("2 index") == SFERR_NO_ERROR) { // insert item at the tail if (menu->InsertLast("3 index") == SFERR_NO_ERROR) { // select "2 index" item menu->SetSelect(2); //////////////////////////// // state of menu // // 0: "0 index" // // 1: "1 index" // // 2: "2 index" <---***// // 3: "3 index" // //////////////////////////// // remove items from "1 index" to "2 index" menu->Remove(1, 3); //////////////////////////// // state of menu // // 0: "0 index" // // 1: "3 index" <---***// //////////////////////////// } } } }
[ public ] Void RemoveFirst(Void);
This function removes the first item from this text menu.
SFZTextMenu::Clear | SFZTextMenu::Remove | SFZTextMenu::RemoveLast | SFZTextMenu::InsertFirst
This function removes the item at the specified index from this text menu.
If the specified index is less than 0 or greater than or equals the number of items, no item will be removed
Caution | |
---|---|
Since this function is deprecated, use the SFZTextMenu::Remove function instead. |
[ public ] Void RemoveLast(Void);
This function removes the last item from this text menu.
SFZTextMenu::Clear | SFZTextMenu::Remove | SFZTextMenu::RemoveFirst | SFZTextMenu::InsertLast
[ public ] Void SetBevelColor( SFXBevelColorConstRef param // value to set );
This function sets the bevel color(SFXBevelColor) for the outer frame of this menu to draw this menu in the 3D style to the specified value.
Default: SFXBevelColor(SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00), SFXRGBColor(0xEE, 0xEE, 0xEE, 0x00), SFXRGBColor(0x88, 0x88, 0x88, 0x00)).
[ public ] Void SetDefaultItemBackColor( SFXRGBColorConstRef param // default background color to set );
This function sets the default background color(SFXRGBColor) of unselected item of this menu to the specified value.
Default: SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00)[white color]
Default background color of unselected item | |
---|---|
The default background color of unselected item can be changed using the SFZTextMenu::SetItemBackColor function. If you want to make the background color of unselected item be the same one, the background color needs to be set using this function. The SFZTextMenu::SetItemBackColor function to set it individually is not recommended. However, the background color of selected item is always the one set with the SFZTextMenu::SetSelBackColor function. |
SFZTextMenu::GetDefaultItemBackColor | SFZTextMenu::SetDefaultItemForeColor | SFZTextMenu::SetItemBackColor | SFZTextMenu::SetSelBackColor | SFZTextMenu::SetItemEnable
[ public ] Void SetDefaultItemForeColor( SFXRGBColorConstRef param // default foreground color to set );
This function sets the default foreground color(SFXRGBColor) to draw the text of unselected item of this menu to the specified value.
Default: SFXRGBColor(0x00, 0x00, 0x00, 0x00)[black color]
Default foreground color of unselected item | |
---|---|
The default foreground color of unselected item can be changed using the SFZTextMenu::SetItemForeColor function. If you want to make the foreground color of all unselected items be the same one, the foreground color needs to be set using this function. The SFZTextMenu::SetItemForeColor function to set it individually is not recommended. However, the foreground color of selected item is always the one set with the SFZTextMenu::SetSelForeColor function, except when the enable flag of the item is set to "false" using the SFZTextMenu::SetItemEnable function. |
Foreground color of unselected item when the enable flag of the item is set to "false" | |
---|---|
If the enable flag of the item is set to "false" using the SFZTextMenu::SetItemEnable function, the text will not be drawn in the foreground color of this item set with this function. In this case, the foreground color will be the color subtracted 0x33 from each RGB value of the background color of this item if the brightness of background color is bigger than 0x7F, otherwise it will be the color added 0x33 on each RGB value of the background color of this item. The brightness of color is the value obtained using the SFXRGBColor::GetBrightness function. |
SFZTextMenu::GetDefaultItemForeColor | SFZTextMenu::SetDefaultItemBackColor | SFZTextMenu::SetItemForeColor | SFZTextMenu::SetSelForeColor | SFZTextMenu::SetItemEnable | SFXRGBColor::GetBrightness | SFXRGBColor
This function sets the font of this menu to the specified value, which is used to draw the item and the title of this menu.
Default: AEE_FONT_NORMAL.
[ public ] SFCError SetItemAccessKey( SInt16 index // index of item AVKType key // access key WChar keyIcon = 0 // key icon );
This function sets the access key and the key icon of the specified item of this menu to specified values.
Note | |
---|---|
The access key is valid only if the enable flag of the corresponding item is set to "true" using the SFZTextMenu::SetItemEnable function. |
The code to set an access key and a key icon for an item is as follows:
// set access key to AVK_1, key icon to 0xFBF6 for first item of _textmenu menu
_textmenu->SetItemAccessKey(0, AVK_1, 0xFBF6);
[ public ] SFCError SetItemBackColor( SInt16 index // index of item SFXRGBColorConstRef param // background color to set );
This function sets the background color(SFXRGBColor) of the specified unselected item of this menu to the specified value.
Default: The default background color set with the SFZTextMenu::SetDefaultItemBackColor function. SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00)[white color] if the default background color is not set.
Foreground color of unselected item | |
---|---|
For the foreground color of unselected item, refer to SFZTextMenu::SetItemForeColor. |
Foreground color of selected item | |
---|---|
For the foreground color of selected item, refer to SFZTextMenu::SetSelForeColor. |
Background color of selected item | |
---|---|
For the background color of selected item, refer to SFZTextMenu::SetSelBackColor. |
SFZTextMenu::SetDefaultItemBackColor | SFZTextMenu::GetItemBackColor | SFZTextMenu::SetItemForeColor | SFZTextMenu::SetSelForeColor | SFZTextMenu::SetSelBackColor | SFXRGBColor
[ public ] SFCError SetItemEnable( SInt16 index // index of item Bool param // value to set. (true if item is valid, false otherwise) );
This function sets the enable flag of the specified item of this menu to the specified value.
Default: "true"(The item is valid.)
When the enable flag of the item is set to "false" | |
---|---|
Even if the operation key or the access key is pressed, the result event will not be sent. The sub-menu will not be displayed if it exists. The foreground color will be the color subtracted 0x33 from each RGB value of the background color of this item if the brightness of background color is bigger than 0x7F, otherwise it will be the color added 0x33 on each RGB value of the background color of this item. The brightness of color is the value obtained using the SFXRGBColor::GetBrightness function. |
SFZTextMenu::GetItemEnable | SFZTextMenu::HandleOperateKey | SFZTextMenu::SetItemForeColor | Result Event[SFEVT_RESPONDER_RESULT]
[ public ] SFCError SetItemForeColor( SInt16 index // index of item SFXRGBColorConstRef param // foreground color to set );
This function sets the foreground color(SFXRGBColor) to draw the text of the specified unselected item of this menu to the specified value.
Default: The default foreground color set with the SFZTextMenu::SetDefaultItemForeColor function. SFXRGBColor(0x00, 0x00, 0x00, 0x00)[black color] if the default background color is not set.
Foreground color of unselected item when the enable flag of the item is set to "false" | |
---|---|
If the enable flag of the item is set to "false" using the SFZTextMenu::SetItemEnable function, the text will not be drawn in the foreground color of this item set with this function. In this case, the foreground color will be the color subtracted 0x33 from each RGB value of the background color of this item if the brightness of background color is bigger than 0x7F, otherwise it will be the color added 0x33 on each RGB value of the background color of this item. The brightness of color is the value obtained using the SFXRGBColor::GetBrightness function. |
Background color of unselected item | |
---|---|
For the background color of unselected item, refer to SFZTextMenu::SetItemBackColor. |
Foreground color of selected item | |
---|---|
For the foreground color of selected item, refer to SFZTextMenu::SetSelForeColor. |
Background color of selected item | |
---|---|
For the background color of selected item, refer to SFZTextMenu::SetSelBackColor. |
SFZTextMenu::SetDefaultItemForeColor | SFZTextMenu::GetItemForeColor | SFZTextMenu::SetItemBackColor | SFZTextMenu::SetSelForeColor | SFZTextMenu::SetSelBackColor | SFZTextMenu::SetItemEnable | SFXRGBColor::GetBrightness | SFXRGBColor
This function sets the item height of this menu to the specified value. All items of this menu have the same height value.
Default: font height + 2 [pixels]
[ public ] SFCError SetItemImage( SInt16 index // index of item SFXPathConstRef path // path to resource file );
[ public ] SFCError SetItemImage( SInt16 index // index of item SFXPathConstRef path // path to resource file UInt16 id // object id );
[ public ] SFCError SetItemImage( SInt16 index // index of item SFBImageSmpConstRef param // image );
This function sets the image of the specified item of this menu to the specified value.
[ public ] Void SetItemMargin( SFXMarginConstRef param // value to set );
This function sets the margin between the border and the text of the item of this menu to the specified value.
This margin region is filled in the bevel color set with the SFZTextMenu::SetBevelColor function.
Default: SFXMargin(2, 0).
SFZTextMenu::GetItemMargin | SFZTextMenu::GetBevelColor | SFXMargin | SFXBevelColor
[ public ] SFCError SetItemSubMenu( SInt16 index // index of item SFZTextMenuSmp subMenu // sub menu );
This function sets the sub menu of the specified item of this menu to the specified value.
[ public ] SFCError SetItemText( SInt16 index // index of item SFXPathConstRef index // path to resource file UInt16 id // object id );
[ public ] SFCError SetItemText( SInt16 index // index of item SFXWideStringConstRef param // text to set );
This function sets the text of the specified item of this menu to the specified value.
[ public ] Void SetMenuStyle( MenuStyleEnum param // menu to set );
This function sets the menu style of this menu to the specified value. Text menu can be set to be the scrollable style (SFZTextMenu::SCROLLABLE_STYLE) or the paging style (SFZTextMenu::PAGE_STYLE).
Default: SFZTextMenu::PAGE_STYLE.
[ public ] Void SetSelBackColor( SFXRGBColorConstRef param // background color to set );
This function sets the background color(SFXRGBColor) of selected item of this menu to the specified value.
Default: SFXRGBColor(0x11, 0x22, 0xBB, 0x00)[blue color]
Foreground color of selected item | |
---|---|
For the foreground color of selected item, refer to SFZTextMenu::SetSelForeColor. |
Foreground color of unselected item | |
---|---|
For the foreground color of unselected item, refer to SFZTextMenu::SetItemForeColor. |
Background color of unselected item | |
---|---|
For the background color of unselected item, refer to SFZTextMenu::SetItemBackColor. |
SFZTextMenu::GetSelBackColor | SFZTextMenu::SetSelForeColor | SFZTextMenu::SetItemForeColor | SFZTextMenu::SetItemBackColor | SFXRGBColor
[ public ] Void SetSelForeColor( SFXRGBColorConstRef param // foreground color to set );
This function sets the foreground color(SFXRGBColor) of selected item of this menu to the specified value.
Default: SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00)[white color]
Background color of selected item | |
---|---|
For the background color of selected item, refer to SFZTextMenu::SetSelBackColor. |
Foreground color of unselected item | |
---|---|
For the foreground color of unselected item, refer to SFZTextMenu::SetItemForeColor. |
Background color of unselected item | |
---|---|
For the background color of unselected item, refer to SFZTextMenu::SetItemBackColor. |
SFZTextMenu::GetSelForeColor | SFZTextMenu::SetItemForeColor | SFZTextMenu::SetItemBackColor | SFZTextMenu::SetSelBackColor | SFZTextMenu::SetItemEnable | SFXRGBColor::GetBrightness | SFXRGBColor
This function sets the index of currently selected item of this menu to the specified value.
[ public ] SFCError SetTitle( SFXPathConstRef path // path to resource file UInt16 id // object id );
[ public ] SFCError SetTitle( SFXWideStringConstRef param // text to set );
This function sets the title of this menu to the specified value.
The title is set by specifying the string as an argument directly, or by reading from the resource file.
Default: ""[null string]
[ public ] Void SetTitleBackColor( SFXRGBColorConstRef param // value to set );
This function sets the background color(SFXRGBColor) of the title of this menu to the specified value, in which the rectangle containing the title is filled.
Default: SFXRGBColor(0xDD, 0xDD, 0xDD, 0x00)[gray color]
[ public ] Void SetTitleForeColor( SFXRGBColorConstRef param // value to set );
This function sets the foreground color(SFXRGBColor) of the title of this menu to the specified value, in which the title is drawn.
Default: SFXRGBColor(0x00, 0x00, 0x00, 0x00)[black color]
This function sets the height of the title of this menu to the specified value. If this value is set to "0", the title will be hidden and never drawn.
Default: font height + 2 [pixels]
enum CodeEnum { CODE_TYPE = four_char_code('m', 't', 'm', 'n') }; SFMTYPEDEFTYPE(CodeEnum)
enum MenuStyleEnum { PAGE_STYLE = 0, // paging style(method of switching pages) SCROLLABLE_STYLE, // scrollable style DEFAULT_STYLE = PAGE_STYLE // Default: paging style }; SFMTYPEDEFTYPE(MenuStyleEnum)
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |