PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFYMenu
Abstract base class of a responder which represents a menu.
#include <SFYMenu.h.hpp>
class SFYMenu : public SFYWidget;
<link linkend="sec.macro.core.typedef.SFMTYPEDEFCLASS">SFMTYPEDEFCLASS</link>(SFYMenu)
        

Inheritance diagram

 Inheritance diagram of SFYMenuClass

Collaboration diagram

 Collaboration diagram of SFYMenuClass

Description

SFYMenu is the abstract base class to define and implement a user-defined container.

For instance, a menu such as SFZTextMenu, SFZGridMenu or SFZFlexListMenu is implemented by inheriting from SFYMenu.

In SFYMenu, there are functions to close itself after the specified period, implement some default handlers(virtual functions), and handle key events of menu operation, ESCAPE, and scroll keys.

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 abstract menu[SFYMenu] 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 ESCAPE key is set with the SFYMenu::SetEscapeKey function. By default, the ESCAPE key is set to the CLEAR key.

[Note] 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] | SFYMenu::HandleOperateKey | SFYMenu::HandleEscapeKey | SFYMenu::HandleSelectUpKey | SFYMenu::HandleSelectDownKey | SFYMenu::HandleSelectRightKey | SFYMenu::HandleSelectLeftKey

The handlers(virtual functions) below for key events on the menu operation, ESCAPE, and selection keys, region event[SFEVT_RESPONDER_BOUND], drawing event[SFEVT_RESPONDER_RENDER] are registered into SFYMenu.

In a menu inheriting from SFYMenu, the following handlers(virtual functions) will be booted up first when the event is received.

Table 212. Events and their Handlers

Event Handler(Virtual function) Default behaviour Override
SFEVT_KEY event of the operation key set with SFYMenu::SetOperateKey SFYMenu::HandleOperateKey Send the result event *1 Optional
SFEVT_KEY event to be set using SFYMenu::SetEscapeKey SFYMenu::HandleEscapeKey Send the result event *2 Optional
SFEVT_KEY event of the UP key set with SFYMenu::SetSelectUpKey SFYMenu::HandleSelectUpKey - Optional
SFEVT_KEY event of the DOWN key set with SFYMenu::SetSelectDownKey SFYMenu::HandleSelectDownKey - Optional
SFEVT_KEY event of the RIGHT key set with SFYMenu::SetSelectRightKey SFYMenu::HandleSelectRightKey - Optional
SFEVT_KEY event of the LEFT key set with SFYMenu::SetSelectLeftKey SFYMenu::HandleSelectLeftKey - Optional
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event SFYWidget::HandleBoundRequest - Recommended
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE) event SFYWidget::HandleBoundOptimize - Recommended
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event SFYMenu::HandleBoundReal Adjust virtual region *3 Optional
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event SFYWidget::HandleBoundVirtual - Optional
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_GLOBAL) event SFYWidget::HandleBoundGlobal - Optional
(SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event SFYWidget::HandleRenderRequest - Optional

* "-" in the default behaviour column represents that nothing is implemented.

[Note] NOTE

*1. Execute SFYResponder::InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_CANCEL, 0), false). Just before the SFYMenu::HandleOperateKey function is called, the timer processing callback scheduled with the SFYMenu::ScheduleTimer function will be canceled internally.

*2. Execute SFYResponder::InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_ESCAPE, 0), false). Just before the SFYMenu::HandleEscapeKey function is called, the timer processing callback scheduled with the SFYMenu::ScheduleTimer function will be canceled internally.

*3. Execute SFYResponder::SetVirtualBound(SFXRectangle(SFXGrid::ZeroInstance(), GetRealBound().GetSize())).

The following is the code necessary to make a user-defined menu.

Example 871. Declaration

SFMTYPEDEFRESPONDER(USRMenu)
class USRMenu: public SFYMenu {
    SFMSEALRESPONDER(USRMenu)
    SFMRESPONDERINSTANTIATETHREE(USRMenu, SFYMenu, SFYWidget, SFYResponder)
public:

    // define responder type
    // small alphabet and symbol must not be used since they are reserved for SophiaFramework UNIVERSE
    enum CodeEnum {
        CODE_TYPE = four_char_code('U', 'M', 'N', 'U')
    };
    SFMTYPEDEFTYPE(CodeEnum)

public:
    static USRMenuSmp NewInstance(SFCErrorPtr exception = null);
protected:
    explicit USRMenu(Void) static_throws;
    virtual ~USRMenu(Void);

    // virtual functions defined in the parent class and recommended to be implemented
    virtual Void HandleOperateKey(Void);
    virtual Void HandleSelectUpKey(Void);
    virtual Void HandleSelectDownKey(Void);
    virtual Void HandleBoundRequest(SFXRectanglePtr rectangle) const;
    virtual Void HandleBoundOptimize(SFXRectanglePtr rectangle) const;
    virtual Void HandleBoundReal(Void);
    virtual Void HandleBoundVirtual(Void);
    virtual Void HandleRenderRequest(SFXGraphicsPtr graphics) const;
};

Example 872. Implementation

USRMenu::USRMenu(Void) static_throws
{
    if (static_try()) {

        // set the responder type
 SetType(CODE_TYPE);

        // here describe the initialization
    }
}

USRMenu::~USRMenu(Void)
{
    // here describe the finalization
}

USRMenuSmp USRMenu::NewInstance(SFCErrorPtr exception)
{
    return static_pointer_cast<USRMenu>(Factory(::new USRMenu, exception));
}

Void USRMenu::HandleOperateKey(Void)
{
    // here describe processing necessary when the operation key is pressed
    // in general, send event as below
    // "_select" variable represents number of selected item
    InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_OK, _select), false);
    return;
}

Void USRMenu::HandleSelectUpKey(Void)
{
    // here describe processing necessary when UP key is pressed
    // example: move selected item up by one
    return;
}

Void USRMenu::HandleSelectDownKey(Void)
{
    // here describe processing necessary when DOWN key is pressed
    // example: move selected item down by one
    return;
}

Void USRMenu::HandleBoundRequest(SFXRectanglePtr rectangle) const
{
    // calculate the suitable menu size
    // set the rectangle argument to the calculated suitable menu size
    // for the rectangle argument, it is recommended to set only its size and not to change its origin in this function
    return;
}

Void USRMenu::HandleBoundOptimize(SFXRectanglePtr rectangle) const
{
    // calculate the suitable menu size within rectangular region given by the rectangle argument
    // set the rectangle argument to the calculated suitable menu size
    // for the rectangle argument, it is recommended to set only its size and not to change its origin in this function
    return;
}

Void USRMenu::HandleBoundReal(Void)
{
    // here describe the size recalculation if necessary when the real region is changed
    return;
}

Void USRMenu::HandleBoundVirtual(Void)
{
    // here describe the size recalculation if necessary when the virtual region is changed
    return;
}

Void USRMenu::HandleRenderRequest(SFXGraphicsPtr graphics) const
{
    // draw menu
    return;
}

Reference

Menu(Basic) | SFZTextMenu | SFZGridMenu | SFZFlexListMenu | SFZRoot | Key Event[SFEVT_KEY] | Region Event[SFEVT_RESPONDER_BOUND] | Drawing Event[SFEVT_RESPONDER_RENDER]

Member

Constructor/Destructor
SFYMenu( Void )
Constructor of the SFYMenu class.
~SFYMenu( Void )
Destructor of the SFYMenu class.
Public Functions
Void CancelTimer( Void )
Cancel the timer of this menu.
AVKType GetEscapeKey( Void )
Get the ESCAPE key of this menu.
AVKType GetOperateKey( Void )
Get the operation key of this menu.
AVKType GetSelectDownKey( Void )
Get the DOWN key of this menu.
AVKType GetSelectLeftKey( Void )
Get the LEFT key of this menu.
AVKType GetSelectRightKey( Void )
Get the RIGHT key of this menu.
AVKType GetSelectUpKey( Void )
Get the UP key of this menu.
Void RewindTimer( Void )
Reset the time until this menu is automatically closed.
Void ScheduleTimer( UInt32 param )
Schedule the timer that HandleEscapeKey() will be called after the specified time elapses. [milliseconds]
Void SetEscapeKey( AVKType param )
Set the ESCAPE key of this menu to the specified value.
Void SetOperateKey( AVKType param )
Set the operation key of this menu to the specified value.
Void SetSelectDownKey( AVKType param )
Set the DOWN key of this menu to the specified value.
Void SetSelectLeftKey( AVKType param )
Set the LEFT key of this menu to the specified value.
Void SetSelectRightKey( AVKType param )
Set the RIGHT key of this menu to the specified value.
Void SetSelectUpKey( AVKType param )
Set the UP key of this menu to the specified value.
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.
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.
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.
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 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.
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.
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 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 HandleEscapeKey( Void )
This function will be called when the SFEVT_KEY event of the ESCAPE key is received or the time scheduled by ScheduleTimer() elapses.
Void HandleOperateKey( Void )
This function will be called when the SFEVT_KEY event of the operation key is received.
Void HandleSelectDownKey( Void )
This function will be called when the SFEVT_KEY event of the DOWN key is received.
Void HandleSelectLeftKey( Void )
This function will be called when the SFEVT_KEY event of the LEFT key is received.
Void HandleSelectRightKey( Void )
This function will be called when the SFEVT_KEY event of the RIGHT key is received.
Void HandleSelectUpKey( Void )
This function will be called when the SFEVT_KEY event of the UP key is received.
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 HandleBoundVirtual( Void ) (inherits from SFYWidget)
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 HandleRenderRequest( SFXGraphicsPtr graphics ) (inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received. [Draw 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 SFYMenu class.
HorizontalEnum (inherits from SFYResponder)
Constants that represent the horizontal alignment.
VerticalEnum (inherits from SFYResponder)
Constants that represent the vertical alignment.

SFYMenu::SFYMenu
Constructor of the SFYMenu class.
[ protected, explicit ]
SFYMenu(Void);

Description

This constructor performs the initializations as follows:

  1. Set the type of this responder to ".mnu".
  2. Set the background color of this responder to SFXRGBColor(0xEE, 0xEE, 0xEE, 0x00) [light gray color].
  3. Set the operation key to AVK_SELECT.
  4. Set the ESCAPE key to AVK_CLR.
  5. Set the UP key to AVK_UP.
  6. Set the DOWN key to AVK_DOWN.
  7. Set the LEFT key to AVK_LEFT.
  8. Set the RIGHT key to AVK_RIGHT.
  9. Register the event handlers in the table below into this responder.

Table 213. Event handler

Event Content of the handler
SFEVT_KEY event of the operation key set with SFYMenu::SetOperateKey Cancel the timer processing scheduled with the SFYMenu::ScheduleTimer function and call the SFYMenu::HandleOperateKey function.
SFEVT_KEY event of the ESCAPE key set with SFYMenu::SetEscapeKey Cancel the timer processing scheduled with the SFYMenu::ScheduleTimer function and call the SFYMenu::HandleEscapeKey function.
SFEVT_KEY event of the UP key set with SFYMenu::SetSelectUpKey Call the SFYMenu::HandleSelectUpKey function.
SFEVT_KEY event of the DOWN key set with SFYMenu::SetSelectDownKey Call the SFYMenu::HandleSelectDownKey function.
SFEVT_KEY event of the LEFT key set with SFYMenu::SetSelectLeftKey Call the SFYMenu::HandleSelectLeftKey function.
SFEVT_KEY event of the RIGHT key set with SFYMenu::SetSelectRightKey Call the SFYMenu::HandleSelectRightKey function.
Result event[SFEVT_RESPONDER_RESULT] Terminate this menu.
Timer event set with SFYMenu::ScheduleTimer Call the SFYMenu::HandleEscapeKey function and then redraw the screen.
Applet-suspend event[SFEVT_APP_SUSPEND] Cancel the timer processing to close this menu after the specified time elapses.
Applet-resume event[SFEVT_APP_RESUME] Restart the timer processing to close this menu after the specified time elapses.
[Note] Note
In a responder inheriting from SFYMenu, the corresponding handler will be called when one of the above events occurs.

Internal Implementation

Internal implementation of this constructor is as follows:

/*protected */SFYMenu::SFYMenu(Void) static_throws : _state(STATE_IDLE)
{
    static SFXRGBColor::AtomRecConst            rgb[] = {
        {{{0x00, 0xEE, 0xEE, 0xEE}}}
    };
    static SFXEventRange::AtomRecConst          trange[] = {
        {     SFEVT_APP_RESUME,       SFEVT_APP_RESUME,           SFP16_BEGIN,            SFP16_END},
        {     SFEVT_APP_SUSPEND,      SFEVT_APP_SUSPEND,          SFP16_BEGIN,            SFP16_END},
        #if TARGET_VERSION_GE(3, 0, 0)
        {       SFEVT_KEY_PRESS,      SFEVT_KEY_RELEASE,          SFP16_BEGIN,            SFP16_END},
        #else
        {       SFEVT_KEY_PRESS,         SFEVT_KEY_HELD,          SFP16_BEGIN,            SFP16_END},
        #endif
        {             SFEVT_KEY,              SFEVT_KEY,          SFP16_BEGIN,            SFP16_END},
        {             SFEVT_KEY,              SFEVT_KEY,          SFP16_BEGIN,            SFP16_END},
        { SFEVT_RESPONDER_STATE,  SFEVT_RESPONDER_STATE,    SFP16_STATE_VALID,    SFP16_STATE_VALID},
        {SFEVT_RESPONDER_RESULT, SFEVT_RESPONDER_RESULT,          SFP16_BEGIN,            SFP16_END}
    };
    SFYHandler::RuleRec                         trule[lengthof(trange)];

    if (static_try()) {
        SetType(CODE_TYPE);
        trule[0].spp = XANDLER_FUNCTION(OnAppResume);
        trule[0].reference = this;
        trule[1].spp = XANDLER_FUNCTION(OnAppSuspend);
        trule[1].reference = this;
        trule[2].spp = XANDLER_FUNCTION(OnShield);
        trule[2].reference = this;
        trule[3].spp = XANDLER_FUNCTION(OnKey);
        trule[3].reference = this;
        trule[4].spp = XANDLER_FUNCTION(OnRewind);
        trule[4].reference = this;
        trule[5].spp = XANDLER_FUNCTION(OnStateValid);
        trule[5].reference = this;
        trule[6].spp = XANDLER_FUNCTION(OnMenuResult);
        trule[6].reference = this;
        static_throw(RegisterHandler(atomic_cast(trange), trule, lengthof(trange)));
        if (static_try()) {
            SetBackgroundColor(rgb[0]);
            _timer.Set(XALLBACK_INTERNAL(OnTimer));
            _msec = 0;
            _key.operate = AVK_SELECT;
            _key.escape = AVK_CLR;
            _key.up = AVK_UP;
            _key.down = AVK_DOWN;
            _key.left = AVK_LEFT;
            _key.right = AVK_RIGHT;
        }
    }
}// SFYMenu::SFYMenu //

/*private */XANDLER_IMPLEMENT_VOIDRESUME(SFYMenu, OnAppResume, invoker, environment)
{
    unused(invoker);
    unused(environment);
    if (_state == STATE_FIRE) {
        _timer.Schedule(_msec);
    }
    return;
}// XANDLER_IMPLEMENT_VOIDRESUME(SFYMenu, OnAppResume) //

/*private */XANDLER_IMPLEMENT_VOIDSUSPEND(SFYMenu, OnAppSuspend, invoker, reason, info)
{
    unused(invoker);
    unused(reason);
    unused(info);
    if (_state != STATE_IDLE) {
        _timer.Cancel();
    }
    return;
}// XANDLER_IMPLEMENT_VOIDSUSPEND(SFYMenu, OnAppSuspend) //

/*private */XANDLER_IMPLEMENT_BOOLEVENT(SFYMenu, OnShield, invoker, event)
{
    unused(invoker);
    return (event.GetP16() == _key.operate || event.GetP16() == _key.escape || event.GetP16() == _key.up || event.GetP16() == _key.down || event.GetP16() == _key.left || event.GetP16() == _key.right);
}// XANDLER_IMPLEMENT_BOOLEVENT(SFYMenu, OnShield) //

/*private */XANDLER_IMPLEMENT_BOOLEVENT(SFYMenu, OnKey, invoker, event)
{
    Bool                                        result(false);

    unused(invoker);
    if (event.GetP16() == _key.operate) {
        CancelTimer();
        HandleOperateKey();
        result = true;
    }
    else if (event.GetP16() == _key.escape) {
        CancelTimer();
        HandleEscapeKey();
        result = true;
    }
    else if (event.GetP16() == _key.up) {
        HandleSelectUpKey();
        result = true;
    }
    else if (event.GetP16() == _key.down) {
        HandleSelectDownKey();
        result = true;
    }
    else if (event.GetP16() == _key.left) {
        HandleSelectLeftKey();
        result = true;
    }
    else if (event.GetP16() == _key.right) {
        HandleSelectRightKey();
        result = true;
    }
    return result;
}// XANDLER_IMPLEMENT_BOOLEVENT(SFYMenu, OnKey) //

/*private */XANDLER_IMPLEMENT_BOOLEVENT(SFYMenu, OnRewind, invoker, event)
{
    unused(invoker);
    unused(event);
    RewindTimer();
    return false;
}// XANDLER_IMPLEMENT_BOOLEVENT(SFYMenu, OnRewind) //

/*private */XANDLER_IMPLEMENT_VOIDSTATE(SFYMenu, OnStateValid, invoker, reason, state)
{
    unused(invoker);
    unused(reason);
    if (!state) {
        CancelTimer();
    }
    return;
}// XANDLER_IMPLEMENT_VOIDSTATE(SFYMenu, OnStateValid) //

/*private */XANDLER_IMPLEMENT_VOIDRESULT(SFYMenu, OnMenuResult, invoker, reason, result)
{
    unused(invoker);
    unused(reason);
    unused(result);
    Terminate();
    return;
}// XANDLER_IMPLEMENT_VOIDRESULT(SFYMenu, OnMenuResult) //

/*private */XALLBACK_IMPLEMENT_SFXTIMER(SFYMenu, OnTimer)
{
    SFYResponderSmp                             root;
    SFCError                                    error;

    error = SFERR_NO_ERROR;
    if ((root = GetRoot()) != null) {
        if (_state == STATE_FIRE) {
            _state = STATE_IDLE;
            _msec = 0;
            Invalidate();
            HandleEscapeKey();
            error = root->Render();
        }
    }
    else {
        error = SFERR_FAILED;
    }
    if (error != SFERR_NO_ERROR) {
        // internal fault!
    }
    return;
}// XALLBACK_IMPLEMENT_SFXTIMER(SFYMenu, OnTimer) //

Reference

SFYResponder::SetType | SFYMenu::CodeEnum | SFYMenu::SetOperateKey | SFYMenu::HandleOperateKey | SFYMenu::SetEscapeKey | SFYMenu::HandleEscapeKey | SFYMenu::SetSelectUpKey | SFYMenu::HandleSelectUpKey | SFYMenu::SetSelectDownKey | SFYMenu::HandleSelectDownKey | SFYMenu::SetSelectLeftKey | SFYMenu::HandleSelectLeftKey | SFYMenu::SetSelectRightKey | SFYMenu::HandleSelectRightKey | SFYMenu::ScheduleTimer | SFXRGBColor | SFXEvent | Type | Event | Key Event[SFEVT_KEY] | Applet-Suspend Event[SFEVT_APP_SUSPEND] | Applet-Resume Event[SFEVT_APP_RESUME] | Result Event[SFEVT_RESPONDER_RESULT]


SFYMenu::~SFYMenu
Destructor of the SFYMenu class.
[ protected, virtual ]
virtual ~SFYMenu(Void);

Description

This destructor cancels the timer processing.

Reference

SFYMenu::CancelTimer


SFYMenu::CancelTimer
Cancel the timer of this menu.
[ public ]
Void CancelTimer(Void);

Description

If this function is called, the menu will not be closed after the time set with the SFYMenu::ScheduleTimer function elapses.

Reference

SFYMenu::ScheduleTimer | SFYMenu::RewindTimer


SFYMenu::GetEscapeKey
Get the ESCAPE key of this menu.
[ public, const ]
AVKType GetEscapeKey(Void);

Description

This function gets the ESCAPE key of this menu set with the SFYMenu::SetEscapeKey function.

Reference

SFYMenu::SetEscapeKey


SFYMenu::GetOperateKey
Get the operation key of this menu.
[ public, const ]
AVKType GetOperateKey(Void);

Description

This function gets the operation key of this menu set with the SFYMenu::SetOperateKey function.

Reference

SFYMenu::SetOperateKey


SFYMenu::GetSelectDownKey
Get the DOWN key of this menu.
[ public, const ]
AVKType GetSelectDownKey(Void);

Description

This function gets the DOWN key of this menu set with the SFYMenu::SetSelectDownKey function.

Reference

SFYMenu::SetSelectDownKey


SFYMenu::GetSelectLeftKey
Get the LEFT key of this menu.
[ public, const ]
AVKType GetSelectLeftKey(Void);

Description

This function gets the LEFT key of this menu set with the SFYMenu::SetSelectLeftKey function.

Reference

SFYMenu::SetSelectLeftKey


SFYMenu::GetSelectRightKey
Get the RIGHT key of this menu.
[ public, const ]
AVKType GetSelectRightKey(Void);

Description

This function gets the RIGHT key of this menu set with the SFYMenu::SetSelectRightKey function.

Reference

SFYMenu::SetSelectRightKey


SFYMenu::GetSelectUpKey
Get the UP key of this menu.
[ public, const ]
AVKType GetSelectUpKey(Void);

Description

This function gets the UP key of this menu set with the SFYMenu::SetSelectUpKey function.

Reference

SFYMenu::SetSelectUpKey


SFYMenu::HandleBoundReal
This function will be called when the real region is changed.
[ protected, virtual ]
Void HandleBoundReal(Void);

Description

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 when the real region is updated, override this function.

The default implementation is to equalize the virtual region with the real region.

[Note] 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.

[Note] 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.

In almost all cases, the method to override this virtual function is adopted since defining, implementing and registering the handler for the region event can be omitted.

Internal Implementation

Internal implementation of the SFYMenu::HandleBoundReal function is as follows:

/*protected virtual */Void SFYMenu::HandleBoundReal(Void)
{
    SetVirtualBound(SFXRectangle(SFXGrid::ZeroInstance(), GetRealBound().GetSize()));
    return;
}// SFYMenu::HandleBoundReal //

Reference

SFYResponder::SetRealBound | SFXEvent | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND]


SFYMenu::HandleEscapeKey
This function will be called when the SFEVT_KEY event of the ESCAPE key is received or the time scheduled by ScheduleTimer() elapses.
[ protected, virtual ]
Void HandleEscapeKey(Void);

Description

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 or the time scheduled by the SFYMenu::ScheduleTimer elapses without the operation nor ESCAPE key press.

In case you want to perform your own processing, override this function.

The default implementation is to send the result event [SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_ESCAPE, 0)], which will boot up the result handler.

[Note] Note
Implementation of the default result handler is only to close this menu.

Internal Implementation

Internal implementation of the SFYMenu::HandleEscapeKey function is as follows:

/*protected virtual */Void SFYMenu::HandleEscapeKey(Void)
{
    InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_ESCAPE, 0), false);
    return;
}// SFYMenu::HandleEscapeKey //

Reference

SFYMenu::SetEscapeKey | SFYMenu::ScheduleTimer | SFYMenu::SetOperateKey | SFXEvent | Result Event[SFEVT_RESPONDER_RESULT] | Key Event[SFEVT_KEY]


SFYMenu::HandleOperateKey
This function will be called when the SFEVT_KEY event of the operation key is received.
[ protected, virtual ]
Void HandleOperateKey(Void);

Description

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 to send the result event [SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_CANCEL, 0)], which will boot up the result handler.

[Note] Note
Implementation of the default result handler is only to close this menu.

Internal Implementation

Internal implementation of the SFYMenu::HandleOperateKey function is as follows:

/*protected virtual */Void SFYMenu::HandleOperateKey(Void)
{
    InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_CANCEL, 0), false);
    return;
}// SFYMenu::HandleOperateKey //

Reference

SFYMenu::SetOperateKey | SFXEvent | Result Event[SFEVT_RESPONDER_RESULT] | Key Event[SFEVT_KEY]


SFYMenu::HandleSelectDownKey
This function will be called when the SFEVT_KEY event of the DOWN key is received.
[ protected, virtual ]
Void HandleSelectDownKey(Void);

Description

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 does nothing.

Internal Implementation

Internal implementation of the SFYMenu::HandleSelectDownKey function is as follows:

/*protected virtual */Void SFYMenu::HandleSelectDownKey(Void)
{
    return;
}// SFYMenu::HandleSelectDownKey //

Reference

SFYMenu::SetSelectDownKey | SFXEvent | Key Event[SFEVT_KEY]


SFYMenu::HandleSelectLeftKey
This function will be called when the SFEVT_KEY event of the LEFT key is received.
[ protected, virtual ]
Void HandleSelectLeftKey(Void);

Description

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 does nothing.

Internal Implementation

Internal implementation of the SFYMenu::HandleSelectLeftKey function is as follows:

/*protected virtual */Void SFYMenu::HandleSelectLeftKey(Void)
{
    return;
}// SFYMenu::HandleSelectLeftKey //

Reference

SFYMenu::SetSelectLeftKey | SFXEvent | Key Event[SFEVT_KEY]


SFYMenu::HandleSelectRightKey
This function will be called when the SFEVT_KEY event of the RIGHT key is received.
[ protected, virtual ]
Void HandleSelectRightKey(Void);

Description

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 does nothing.

Internal Implementation

Internal implementation of the SFYMenu::HandleSelectRightKey function is as follows:

/*protected virtual */Void SFYMenu::HandleSelectRightKey(Void)
{
    return;
}// SFYMenu::HandleSelectRightKey //

Reference

SFYMenu::SetSelectRightKey | SFXEvent | Key Event[SFEVT_KEY]


SFYMenu::HandleSelectUpKey
This function will be called when the SFEVT_KEY event of the UP key is received.
[ protected, virtual ]
Void HandleSelectUpKey(Void);

Description

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.

The default implementation does nothing.

Internal Implementation

Internal implementation of the SFYMenu::HandleSelectUpKey function is as follows:

/*protected virtual */Void SFYMenu::HandleSelectUpKey(Void)
{
    return;
}// SFYMenu::HandleSelectUpKey //

Reference

SFYMenu::SetSelectUpKey | SFXEvent | Key Event[SFEVT_KEY]


SFYMenu::RewindTimer
Reset the time until this menu is automatically closed.
[ public ]
Void RewindTimer(Void);

Description

This function resets the time until this menu is automatically closed, which has been set with the SFYMenu::ScheduleTimer function.

Reference

SFYMenu::ScheduleTimer | SFYMenu::CancelTimer


SFYMenu::ScheduleTimer
Schedule the timer that HandleEscapeKey() will be called after the specified time elapses. [milliseconds]
[ public ]
Void ScheduleTimer(
    UInt32 param   // time to set
);

Description

This function schedules the timer that the SFYMenu::HandleEscapeKey function will be called and the screen will be redrawn when neither the operation key nor the ESCAPE key has been pressed for the specified time. [milliseconds]

[Tip] Scheduling of timer processing callback

This function registers the timer processing callback that the SFYMenu::HandleEscapeKey function will be called and the screen will be redrawn when the specified time elapses.

If the operation key set with the SFYMenu::SetOperateKey function or the ESCAPE key set with the SFYMenu::SetEscapeKey function is pressed before the specified time elapses, this timer processing callback will be canceled.

If this timer processing callback is scheduled at the suspend time, it will be canceled and re-scheduled at the resume time automatically.

When the valid state of this menu becomes invalid, if this timer processing callback is scheduled, it will be canceled automatically.

Reference

SFYMenu::HandleEscapeKey | SFYMenu::CancelTimer | SFYMenu::RewindTimer | SFYMenu::SetOperateKey | SFYMenu::SetEscapeKey | State


SFYMenu::SetEscapeKey
Set the ESCAPE key of this menu to the specified value.
[ public ]
Void SetEscapeKey(
    AVKType param   // key to set
);

Description

This function sets the ESCAPE key of this menu to the specified value.

The SFYMenu::HandleEscapeKey function will be called when this key is pressed.

Default: AVK_CLR

Reference

SFYMenu::HandleEscapeKey | SFYMenu::GetEscapeKey


SFYMenu::SetOperateKey
Set the operation key of this menu to the specified value.
[ public ]
Void SetOperateKey(
    AVKType param   // key to set
);

Description

This function sets the operation key of this menu to the specified value.

The SFYMenu::HandleOperateKey function will be called when this key is pressed.

Default: AVK_SELECT

Reference

SFYMenu::HandleOperateKey | SFYMenu::GetOperateKey


SFYMenu::SetSelectDownKey
Set the DOWN key of this menu to the specified value.
[ public ]
Void SetSelectDownKey(
    AVKType param   // key to set
);

Description

This function sets the DOWN key of this menu to the specified value.

The SFYMenu::HandleSelectDownKey function will be called when this key is pressed.

Default: AVK_DOWN

Reference

SFYMenu::HandleSelectDownKey | SFYMenu::GetSelectDownKey


SFYMenu::SetSelectLeftKey
Set the LEFT key of this menu to the specified value.
[ public ]
Void SetSelectLeftKey(
    AVKType param   // key to set
);

Description

This function sets the LEFT key of this menu to the specified value.

The SFYMenu::HandleSelectLeftKey function will be called when this key is pressed.

Default: AVK_LEFT

Reference

SFYMenu::HandleSelectLeftKey | SFYMenu::GetSelectLeftKey


SFYMenu::SetSelectRightKey
Set the RIGHT key of this menu to the specified value.
[ public ]
Void SetSelectRightKey(
    AVKType param   // key to set
);

Description

This function sets the RIGHT key of this menu to the specified value.

The SFYMenu::HandleSelectRightKey function will be called when this key is pressed.

Default: AVK_RIGHT

Reference

SFYMenu::HandleSelectRightKey | SFYMenu::GetSelectRightKey


SFYMenu::SetSelectUpKey
Set the UP key of this menu to the specified value.
[ public ]
Void SetSelectUpKey(
    AVKType param   // key to set
);

Description

This function sets the UP key of this menu to the specified value.

The SFYMenu::HandleSelectUpKey function will be called when this key is pressed.

Default: AVK_UP

Reference

SFYMenu::HandleSelectUpKey | SFYMenu::GetSelectUpKey


SFYMenu::CodeEnum
Constant that represents the SFYMenu class.
enum CodeEnum {
    CODE_TYPE = four_char_code('.', 'm', 'n', 'u')
};
SFMTYPEDEFTYPE(CodeEnum)

Reference

SFYResponder::GetType | SFYResponder::SetType