PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFZSoftKeyControl
Responder which represents a SoftKey control.
#include <SFZSoftKeyControl.h.hpp>
class SFZSoftKeyControl : public SFYControl;
SFMTYPEDEFCLASS(SFZSoftKeyControl)

Inheritance diagram

 Inheritance diagram of SFZSoftKeyControlClass

Collaboration diagram

 Collaboration diagram of SFZSoftKeyControlClass

Description

How to use

SoftKey control(SFZSoftKeyControl) is a control to handle the key events from SoftKey, and there are 2 types of the SoftKey controls depending on the number of labels which constitute its SoftKey menu as follows:

  1. Standard style: Labels for 3 soft keys constitute its SoftKey menu.
  2. Extention style: Labels for 5 soft keys and 4 cursor keys constitute its SoftKey menu.

[Note] Note
Default is the standard style.

Figure 381. Standard style


Standard style

Standard style: Labels for 3 soft keys constitute its SoftKey menu.

Figure 382. Extention style


Extention style

Extention style: Labels for 5 soft keys and 4 cursor keys constitute its SoftKey menu.

The below is the layout of SoftKey control.

Standard style:

Extention style:

[Note] Background color of the SoftKey control

The default background color of the SoftKey control(SFZSoftKeyControl) is set to SFXRGBColor(0xCC, 0xCC, 0xCC, 0x00) [gray color].

This background color can be changed with the SFYWidget::SetBackgroundColor function.

Functions of the SoftKey control(SFZSoftKeyControl) are as follows:

  1. Bind or unbind a responder with or from the SoftKey control( and a SoftKey menu).
  2. When the foremost focused responder, called "active responder", bound with the SoftKey control is changed, switch to the corresponding SoftKey menu called "active menu" and it will be drawn.
  3. Set and draw the labels for SoftKey, SELECT, LEFT, RIGHT, UP, and DOWN keys.
  4. Manage the elements of text, image, and 3-Color for each label.
  5. Receive the key event[SFEVT_KEY] from SoftKey and send it as the SoftKey event[SFEVT_RESPONDER_SOFTKEY] to the "active responder", which is the foremost one among responders currently bound with the SoftKey control.
[Note] About the focused responder

For more details on the focused responder, refer to State.

[Note] About the elements of text, image, and 3-Color for each label

The elements of text, image, and 3-Color for each label can be shared with different labels and each is managed by this unique key at the registration.

The frame color, the foreground color, and the background color are grouped together into 3-Color using the same unique color key at the registration. Conversely, 3-Color represents the frame color, the foreground color, and the background color.

How to use the SFZSoftKeyControl class

In the following description, the application class called "application" which contains two windows called "window1" and "window2" is supposed.

  1. Create the instance of the SoftKey control.

    // only one instance of SoftKey control per applet is valid
    _softkey = SFZSoftKeyControl::NewInstance(&error);
    
  2. Set the SoftKey control's parent to "application" [root(SFZRoot class)]. The SoftKey control is automatically placed foremost among the root's child responders by internal processing.

    // parent of SoftKey control must be application class
    _softkey->SetParent(application);
    
  3. Set the SoftKey control's style to "Standard"[default] or "Extention".

    // set SoftKey control's style to "Extention"
    _softkey->SetStyle(SFZSoftKeyControl::EXTENSION);
    
  4. Set the SoftKey control's real region.

    // calculate the suitable size automatically and set SoftKey control's real region to it
    _softkey->SetRealBound(_softkey->GetSuitableBound());
    
    [Caution] CAUTION

    In the GetSuitableBound() function of the SoftKey control, the rectangular region will be ignored if specified in the argument. The suitable rectangular region will be calculated from the full screen of the mobile phone gotten by calling the SFXDevice::GetScreenSize function.

    The normal GetSuitableBound() function will return only the size of the suitable rectangular region as a result of calculation. However, in case of the GetSuitableBound() function of the SoftKey control, it will return not only the size but also the origin position of the suitable rectangular region. Therefore, there is no need to set the origin position of the real region after calling the SFYResponder::GetSuitableBound function.

  5. Set the SoftKey control's state to "visible + active + disable + unfocus".

    // set SoftKey control's state to "visible + active + disable + unfocus" together
    _softkey->SetState(true, true, false, false);
    
  6. Register the elements of text, image, or 3-Color together with their keys for displaying the SoftKey control's labels.

    // register elements of text, image, and 3-Color with keys for displaying SoftKey control's labels
    // * keys for 3-Color(frame color, foreground color, background color) are same: KEY_COLOR
    _softkey->RegisterText(KEY_TEXT, text);                 // text
    _softkey->RegisterImage(KEY_IMAGE, image);              // image
    _softkey->RegisterFrameColor(KEY_COLOR, colorFrame);    // frame color
    _softkey->RegisterForeColor(KEY_COLOR, colorFore);      // foreground color
    _softkey->RegisterBackColor(KEY_COLOR, colorBack);      // background color
    
  7. Make the SoftKey menu with the specified menu key.

    [Note] Note
    The SoftKey menu can be shared with different responders and each is managed by this unique key at the registration.
    // make SoftKey control
    _softkey->CreateMenu(KEY_MENU);
    
  8. Register the keys of text, image, or color into the SoftKey menu.

    // set the text, image, and color for SoftKey1's label
    _softkey->SetTextKey(KEY_MENU, SFZSoftKeyControl::SOFTKEY_1, KEY_TEXT);
    _softkey->SetImageKey(KEY_MENU, SFZSoftKeyControl::SOFTKEY_1, KEY_IMAGE);
    _softkey->SetColorKey(KEY_MENU, SFZSoftKeyControl::SOFTKEY_1, KEY_COLOR);
    
  9. In the constructor of "window1", processing below is described.

    [Note] In case of the standard responder of SophiaFramework UNIVERSE

    When the constructor cannot be edited since it is the standard responder of SophiaFramework UNIVERSE such as SFZWindow or SFZTextMenu, the processing below is done externally.

    1. Get the instance of the SoftKey control.

      // get instance of SoftKey control
      _softkey = USRApplication::GetSoftKey();
      
      [Note] Note
      USRApplication::GetSoftKey() is supposed to be the function to get the instance of the SoftKey control.
    2. Bind "window1" with the SoftKey menu of the SoftKey control.

      // bind "window1" with SoftKey menu of SoftKey control
      _softkey->Bind(GetThis(), MENU_KEY);
      
    3. Register the handler for SoftKey event into "window1".

      [Note] Note
      It is necessary to declare and implement the handler of "OnSoftkey" for the SoftKey event.
      // register handler for SoftKey event into "window1"
      RegisterHandler(
          SFXEventRange(SFEVT_RESPONDER_SOFTKEY, SFEVT_RESPONDER_SOFTKEY, AVK_SOFT1, AVK_SOFT4),
          XANDLER_INTERNAL(OnSoftkey)
      );
      // * it is necessary to declare and implement handler of "OnSoftkey" for SoftKey event
      
    4. Unbind "window1" from the SoftKey control if its SoftKey menu will not have to be displayed from now on.

      // unbind "window1" from SoftKey control
      // code below can be omitted since "window1" will be automatically unbound when its state become "invalid"
      _softkey->UnBind(GetThis());
      
  10. For "window2", it is same as window1.
[Note] Mechanism of the SoftKey control

In the SoftKey control, the SoftKey menu can be associated with more than one responder.

The SoftKey control is defined as "active" if any of the responders bound with the SoftKey control is in the "focus" state. And the foremost responder among them is defined as "active responder".

At this time, the SoftKey menu associated with "active responder" will be displayed on the device screen. This menu is defined as "active menu".

The SoftKey control will transfer the key event[SFEVT_KEY] from SoftKey as SoftKey event[SFEVT_RESPONDER_SOFTKEY] to "active responder".

If the SoftKey control is not "active", the SoftKey event[SFEVT_RESPONDER_SOFTKEY] will be sent to no responder. And, the SoftKey menu whose menu key is "0", called "default menu", will be displayed on the device screen.

[Note] Default menu

Default menu is the SoftKey menu which will be displayed on the screen when any responder bound with the SoftKey control is in the "unfocus" state, i.e., "active responder" does not exist.

The default menu is automatically created and registered with the menu key "0" into the SoftKey control when its instance is created.

The initial settings of the default menu (menu key "0") is as follows:

  1. Foreground color: SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00)[white color]
  2. Background color: SFXRGBColor(0x77, 0x77, 0x77, 0x00)[gray color]
  3. Frame color: SFXRGBColor(0xDD, 0xDD, 0xDD, 0xDD)[light gray color]
  4. Label text: SFXWideString::EmptyInstance()
  5. Label image: SFBImageSmp::EmptyInstance()

*1 These value can be changed by updating each value for the menu key "0" with the functions of SFZSoftKeyControl.

*2 Since the enable flag of each label in the SoftKey menu is set to "true" by default, the label region will be displayed as it is. To undisplay a label region, set its enable flag to "false" with the SFZSoftKeyControl::SetEnable function.

[Note] About the SoftKey event

When the SoftKey control is used, the dispatching rule below will be automatically registered into the tracer of the application class by the internal processing of the SoftKey control as follows:

// when set SoftKey control's parent responder to application class
// dispatching rule below will be registered into the tracer
application->RegisterTracer(
                   SFXEventRange(SFEVT_KEY, SFEVT_KEY, AVK_SOFT1, AVK_SOFT4),
                   SFYTracer::ORDER_FORWARD, 
                   SFYTracer::STATE_ALL, 
                   false
);

The meaning of this dispatching rule is as follows:

  1. Distribute the key event from SoftKey to all child responders regardless of their state from foreground to background.
  2. If the event is handled, event handling will stop there(the event will not be handled duplicately).

Since the SoftKey control is the child responder placed foremost of the application class[root (SFZRoot class)], the key event of SoftKey is always handled in the SoftKey control.

If the SoftKey control is "active", the key event of SoftKey will be transferred as the SoftKey event[SFEVT_RESPONDER_SOFTKEY] to the "active responder" defined above.

If the SoftKey control is not "active", the SoftKey event will not be sent to any responder.

Reference: Tracer | Handler | Root(Basic) | SFZRoot

Example 894. Make the SoftKey control in the application class

// define screensaver_sfy application class
SFMTYPEDEFCLASS(screensaver_sfy)
class screensaver_sfy: public SFYApplication {
    SFMSEALCOPY(screensaver_sfy)
private:
    SFZSoftKeyControlSmp _softkey;  // SoftKey control must be contained as global variable by application class
    MainWindowSmp _main;
public:
    static SFCInvokerPtr Factory(Void);
    static SFZSoftKeyControlSmp GetSoftKey(Void);
private:
    explicit screensaver_sfy(Void) static_throws;
    virtual ~screensaver_sfy(Void);
    XANDLER_DECLARE_VOIDRENDER(OnRenderRequest)
};

// constructor of screensaver_sfy application class
screensaver_sfy::screensaver_sfy(Void) static_throws
{
    SFCError error;

    if (static_try()) {

        // .................

        if (static_try()) {

           // make SoftKey control
           // application class can have only one SoftKey control
           _softkey = SFZSoftKeyControl::NewInstance(&error);

           if (_softkey != null) {

                // set parent responder to application class(root)
                // * SoftKey control must be root's child responder
                error = _softkey->SetParent(GetThis());

                // at this time, SoftKey control is automatically placed foremost among child responders of root by internal processing
                // key events of SoftKey are all handled in SoftKey control


                if (error == SFERR_NO_ERROR) {

                    // set menu style to "extention style"
                    _softkey->SetStyle(SFZSoftKeyControl::EXTENSION);

                    // set real region to region automatically calculated from device screen size and SoftKey control style
                    // (to be set at the bottom in the device screen)
                    // *** CAUTION on specification of GetSuitableBound() only for SFZSoftKeyControl: 
                    // *** 1. A rectangular region will be ignored if specified in the argument and 
                    // ***    the suitable size will be calculated from the full screen region of the mobile phone gotten by calling SFXDevice::GetScreenSize().
                    // ***    In general, the argument is not specified since it has no meaning.
                    // *** 2. This function will return not only the suitable rectangle size but also the suitable origin position.
                    // ***    Therefore, there is no need to set the position of the real region after calling this function.
                    _softkey->SetRealBound(_softkey->GetSuitableBound());

                    // set SoftKey control's state to "visible" + "active" + "disable" + "unfocus" together
                    _softkey->SetState(true, true, false, false);

                    // move SoftKey control foremost
                    // _softkey->ToFront();  // this can be omitted since SoftKey control is always moved foremost by internal processing

                    // register each element (i.e., text, image, 3 colors) for SoftKey label
                    // before they are used for SoftKey menu
                    // * since image and 3 colors are not registered here, default setting are used for these elements
                    _softkey->RegisterText(KEY_TEXT_EXIT,   SFXWideString("End"));
                    _softkey->RegisterText(KEY_TEXT_EDIT,   SFXWideString("Set"));
                    _softkey->RegisterText(KEY_TEXT_ADD,    SFXWideString("Add"));
                    _softkey->RegisterText(KEY_TEXT_CHANGE, SFXWideString("Update"));
                    _softkey->RegisterText(KEY_TEXT_REMOVE, SFXWideString("Delete"));

                    // * all elements can be registered together from the resource file
                    // _softkey->RegisterTextRange(
                    //   IDS_SK_EXIT, SFXPath(SCREENSAVER_SFY_RES_FILE), IDS_SK_EXIT, IDS_SK_REMOVE
                    // );
                }
            }
        }

        // make MainWindow
        if (error == SFERR_NO_ERROR) {
            _main = MainWindow::NewInstance(&error);

                .................

        }


        .................
    }
}


// implementation of function to get instance of SoftKey control
SFZSoftKeyControlSmp screensaver_sfy::GetSoftKey(Void)
{
    return static_cast<screensaver_sfyPtr>(GetInstance())->_softkey;
}

Example 895. Set the SoftKey control in the responder class

// define MainWindow
SFMTYPEDEFRESPONDER(MainWindow)
class MainWindow: public SFZWindow {
    SFMSEALRESPONDER(MainWindow)
    SFMRESPONDERINSTANTIATEFOUR(MainWindow, SFZWindow, SFYContainer, SFYWidget, SFYResponder)
public:

        ................

private:
    SFZSoftKeyControlSmp _softkey;// SoftKey control

        ................

private:
    XANDLER_DECLARE_VOIDEVENT(OnKey)     // key handler
    XANDLER_DECLARE_VOIDEVENT(OnSoftkey) // SoftKey handler

        ................

};

// constructor of MainWindow
MainWindow::MainWindow(Void) static_throws
{
    static SFXEventRange::AtomRecConst range[] = {
        { SFEVT_APP_SUSPEND,SFEVT_APP_SUSPEND,SFP16_BEGIN,   SFP16_END },
        { SFEVT_APP_RESUME, SFEVT_APP_RESUME, SFP16_BEGIN,   SFP16_END },

        // normal key event
        { SFEVT_KEY,        SFEVT_KEY,        SFP16_BEGIN,   SFP16_END },

        // SoftKey event[SFEVT_RESPONDER_SOFTKEY] which SoftKey control will transfer
        // key event of SoftKey will be converted into SoftKey event[SFEVT_RESPONDER_SOFTKEY]
        { SFEVT_RESPONDER_SOFTKEY, SFEVT_RESPONDER_SOFTKEY, AVK_SOFT1,     AVK_SOFT4 }
    };
    SFYHandler::RuleRec rule[lengthof(range)];

    if (static_try()) {
 SetType(CODE_TYPE);

        rule[0].spp = XANDLER_FUNCTION(OnSuspend);
        rule[0].reference = this;
        rule[1].spp = XANDLER_FUNCTION(OnResume);
        rule[1].reference = this;

        // key handler
        rule[2].spp = XANDLER_FUNCTION(OnKey);
        rule[2].reference = this;

        // SoftKey handler
        rule[3].spp = XANDLER_FUNCTION(OnSoftkey);
        rule[3].reference = this;

        // register handlers
        static_throw(RegisterHandler(atomic_cast(range), rule, lengthof(range)));

        // get instance of SoftKey control
        if ((_softkey = screensaver_sfy::GetSoftKey()) != null) {

            if (!_softkey->ContainsMenuKey(MENUID_MAIN)) {
                // if SoftKey menu which corresponds to unique menu key "MENUID_MAIN" is not created

                // create SoftKey menu
                _softkey->CreateMenu(MENUID_MAIN);

                // set each element key to SoftKey menu above
                // * elements have already been registered in constructor of application class
                // keys below correspond to labels for SELECT, SOFTKEY_1, SOFTKEY_2, SOFTKEY_3, SOFTKEY_4 from left respectively
                UInt32 keyText[] = {
                    IDS_SK_EDIT, IDS_SK_EXIT, IDS_SK_ADD, IDS_SK_CHANGE, IDS_SK_REMOVE
                };
                _softkey->SetTextKey(MENUID_MAIN, keyText, lengthof(keyText));
           }

           // bind MainWindow with SoftKey menu of SoftKey control
           _softkey->Bind(this, MENUID_MAIN); 
           // or "_softkey->Bind(GetThis(), MENUID_MAIN);" *The former yields better performance than the latter.
        }
    }
}

Example 896. Implement the handler for the SoftKey event

// implement handler for SoftKey event: handler for key events from SoftKey1 to SoftKey4
// this handler will be booted up only if MainWindow is "active responder"
XANDLER_IMPLEMENT_VOIDEVENT(MainWindow, OnSoftkey, invoker, event)
{

                .................


    switch (event.GetP16()) {
        case AVK_SOFT1:
            // make the dialog which confirms termination

                .................

            break;
        case AVK_SOFT2:
            // make menu

                .................

}

Execution result

Standard style:

Extention style:

Reference

SFYControl

Member

Constructor/Destructor
SFZSoftKeyControl( Void )
Constructor of the SFZSoftKeyControl class.
~SFZSoftKeyControl( Void )
Destructor of the SFZSoftKeyControl class.
Public Functions
SFCError Bind( SFYResponderPtr responder , UInt32 key )
Bind the specified responder with the specified menu.
SFCError Bind( SFYResponderSmpConstRef responder , UInt32 key )
Bind the specified responder with the specified menu.
Bool ContainsColorKey( UInt32 key )
Check whether or not the specified color key is registered into this SoftKey control.
Bool ContainsImageKey( UInt32 key )
Check whether or not the specified image key is registered into this SoftKey control.
Bool ContainsMenuKey( UInt32 key )
Check whether or not the specified menu key is registered into this SoftKey control.
Bool ContainsResponder( SFYResponderPtr responder )
Check whether or not the specified responder is bound with this SoftKey control.
Bool ContainsTextKey( UInt32 key )
Check whether or not the specified text key is registered into this SoftKey control.
SFCError CreateMenu( UInt32 key )
Create the specified SoftKey menu of this SoftKey control.
Void DestroyMenu( UInt32 key )
Destroy the specified SoftKey menu.
UInt32 GetActiveMenuKey( Void )
Get the menu key of the active menu of this SoftKey control.
SInt16 GetArrowBaseLength( Void )
Get the length of the base of the triangle label in the SoftKey menu with the "extention" style. [pixels]
SInt16 GetArrowHeight( Void )
Get the height of the triangle label in the SoftKey menu with the "extention" style. [pixels]
SFXRGBColorConstRef GetBackColor( UInt32 key )
Get the background color for label of this SoftKey control which corresponds to the specified color key.
SInt16 GetBaseSpace( Void )
Get the value of space between the label and the border of this SoftKey control. [pixels]
UInt32 GetColorKey( UInt32 menuKey , SoftkeyEnum index )
Get the color key of the specified label of the specified menu of this SoftKey control.
SFXRGBColorConstRef GetDefaultBackColor( Void )
Get the default background color for label of this SoftKey control.
SFXRGBColorConstRef GetDefaultForeColor( Void )
Get the default foreground color for label of this SoftKey control.
SFXRGBColorConstRef GetDefaultFrameColor( Void )
Get the default frame color for label of this SoftKey control.
Bool GetEnable( UInt32 menuKey , SoftkeyEnum index )
Get the value of enable flag of the specified label of the specified menu of this SoftKey control.
AEEFont GetFont( Void )
Get the font of the label text of this SoftKey control.
SFXRGBColorConstRef GetForeColor( UInt32 key )
Get the foreground color for label of this SoftKey control, which corresponds to the specified color key.
SFXRGBColorConstRef GetFrameColor( UInt32 key )
Get the frame color for label of this SoftKey control, which corresponds to the specified color key.
SFBImageSmpConstRef GetImage( UInt32 key )
Get the label image of this SoftKey control, which corresponds to the specified image key.
UInt32 GetImageKey( UInt32 menuKey , SoftkeyEnum index )
Get the image key of the specified label of the specified menu of this SoftKey control.
SFXRectangleConstRef GetLabelRectangle( SoftkeyEnumEnum index )
Get the rectangular region of the specified label of this SoftKey control.
UInt32 GetMenuKey( SFYResponderPtr responder )
Get the menu key of this SoftKey control, which is bound with the specified responder.
StyleEnum GetStyle( Void )
Get the menu style of this SoftKey control.
SFXWideStringConstRef GetText( UInt32 key )
Get the label text of this SoftKey control, which corresponds to the specified text key.
UInt32 GetTextKey( UInt32 menuKey , SoftkeyEnum index )
Get the text key of the specified label of the specified menu of this SoftKey control.
static
SFZSoftKeyControlSmp
NewInstance( SFCErrorPtr exception = null )
Create a new instance of this responder class.
SFCError RegisterBackColor( UInt32 key , SFXRGBColorConstRef param )
Register the specified color as background color for label into this SoftKey control, which is associated with the specified color key.
SFCError RegisterForeColor( UInt32 key , SFXRGBColorConstRef param )
Register the specified color as foreground color for label into this SoftKey control, which is associated with the specified color key.
SFCError RegisterFrameColor( UInt32 key , SFXRGBColorConstRef param )
Register the specified color as frame color for label into this SoftKey control, which is associated with the specified color key.
SFCError RegisterImage( UInt32 key , SFXPathConstRef path )
Register the specified image as label image into this SoftKey control, which is associated with the specified image key.
SFCError RegisterImage( UInt32 key , SFXPathConstRef path , UInt16 id )
Register the specified image as label image into this SoftKey control, which is associated with the specified image key.
SFCError RegisterImage( UInt32 key , SFBImageSmpConstRef param )
Register the specified image as label image into this SoftKey control, which is associated with the specified image key.
SFCError RegisterImageRange( UInt32 originKey , SFXPathConstRef path , UInt16 start , UInt16 end )
Register the images within the specified range as label images into this SoftKey control, which are associated with the image keys starting from the specified value.
SFCError RegisterText( UInt32 key , SFXPathConstRef path , UInt16 id )
Register the specified image as label text into this SoftKey control, which is associated with the specified text key.
SFCError RegisterText( UInt32 key , SFXWideStringConstRef param )
Register the specified image as label text into this SoftKey control, which is associated with the specified text key.
SFCError RegisterTextRange( UInt32 originKey , SFXPathConstRef path , UInt16 start , UInt16 end )
Register the texts within the specified range as label texts into this SoftKey control, which are associated with the text keys starting from the specified value.
Void SetArrowBaseLength( SInt16 param )
Set the length of the base of the triangle label in the SoftKey menu with the "extention" style to the specified value. [pixels]
Void SetArrowHeight( SInt16 param )
Set the height of the triangle label in the SoftKey menu with the "extention" style to the specified value. [pixels]
Void SetBaseSpace( SInt16 param )
Set the space between the label and the border of this SoftKey control to the specified value. [pixels]
SFCError SetColorKey( UInt32 menuKey , SoftkeyEnum index , UInt32 colorKey )
Set the specified label of the specified SoftKey menu of this SoftKey control to the specified color key.
SFCError SetColorKey( UInt32 menuKey , UInt32ConstPtr keys , UInt32 num )
Set the specified label of the specified SoftKey menu of this SoftKey control to the specified color key.
Void SetDefaultBackColor( SFXRGBColorConstRef param )
Set the default background color for label of this SoftKey control to the specified value.
Void SetDefaultForeColor( SFXRGBColorConstRef param )
Set the default foreground color for label of this SoftKey control to the specified value.
Void SetDefaultFrameColor( SFXRGBColorConstRef param )
Set the default frame color for label of this SoftKey control to the specified value.
SFCError SetEnable( UInt32 menuKey , SoftkeyEnum index , Bool enable )
Set the enable flag of the specified label of the specified menu of this SoftKey control to the specified value.
SFCError SetEnable( UInt32 menuKey , BoolConstPtr enables , UInt32 num )
Set the enable flag of the specified label of the specified menu of this SoftKey control to the specified value.
Void SetFont( AEEFont param )
Set the font of the label text of this SoftKey control to the specified value.
SFCError SetImageKey( UInt32 menuKey , SoftkeyEnum index , UInt32 imageKey )
Set the specified label of the specified SoftKey menu of this SoftKey control to the specified image key.
SFCError SetImageKey( UInt32 menuKey , UInt32ConstPtr keys , UInt32 num )
Set the specified label of the specified SoftKey menu of this SoftKey control to the specified image key.
Void SetStyle( StyleEnum param )
Set the menu style of this SoftKey control to the specified value.
SFCError SetTextKey( UInt32 menuKey , SoftkeyEnum index , UInt32 textKey )
Set the specified label of the specified SoftKey menu of this SoftKey control to the specified text key.
SFCError SetTextKey( UInt32 menuKey , UInt32ConstPtr keys , UInt32 num )
Set the specified label of the specified SoftKey menu of this SoftKey control to the specified text key.
Void UnBind( SFYResponderPtr responder )
Unbind the specified responder with the corresponding menu.
Void UnBind( SFYResponderSmpConstRef responder )
Unbind the specified responder with the corresponding menu.
Void UnregisterColor( UInt32 key )
Unregister the 3-Color associated with the specified color key from this SoftKey control.
Void UnregisterImage( UInt32 key )
Unregister the label image associated with the specified image key from this SoftKey control.
Void UnregisterText( UInt32 key )
Unregister the label text associated with the specified text key from this SoftKey control.
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.
SInt32 GetCurrentValue( Void ) (inherits from SFYControl)
Get the current value of this control.
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 GetMaximumValue( Void ) (inherits from SFYControl)
Get the maximum value of this control.
SInt32 GetMinimumValue( Void ) (inherits from SFYControl)
Get the minimum value of this control.
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 SetCurrentValue( SInt32 param ) (inherits from SFYControl)
Set the current value of this control 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.
Void SetMaximumValue( SInt32 param ) (inherits from SFYControl)
Set the maximum value of the control to the specified value.
Void SetMinimumValue( SInt32 param ) (inherits from SFYControl)
Set the minimum value of the control 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 DrawImage( SFXGraphicsPtr graphics , SFXRectangleConstRef rectangle , SFBImageSmpConstRef image )
Draw the specified label image at the specified rectangular region.
SFXRectangle DrawRectangularFrame( SFXGraphicsPtr graphics , SFXRectangleConstRef rectangle , SFXRGBColorConstRef back , SFXRGBColorConstRef frame )
Draw the frame in the specified frame color and the specified background color in the specified rectangular region.
SFXRGBColorConstRef GetCacheBackColor( SoftkeyEnum index )
Get the background color of the specified active label of this SoftKey control from the cashe.
SFXRGBColorConstRef GetCacheForeColor( SoftkeyEnum index )
Get the foreground color of the specified active label of this SoftKey control from the cashe.
SFXRGBColorConstRef GetCacheFrameColor( SoftkeyEnum index )
Get the frame color of the specified active label of this SoftKey control from the cashe.
SFBImageSmpConstRef GetCacheImage( SoftkeyEnum index )
Get the image of the specified active label of this SoftKey control from the cashe.
Bool GetCacheLabelEnable( SoftkeyEnum index )
Get the value of enable flag of the specified active label of this SoftKey control from the cashe.
Bool GetCachePress( SoftkeyEnum index )
Get the press state of the specified active label of this SoftKey control from the cashe.
SFXWideStringConstRef GetCacheText( SoftkeyEnum index )
Get the text of the specified active label of this SoftKey control from the cashe.
Void HandleBoundOptimize( SFXRectanglePtr rectangle )
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE) event is received. [Calculate the suitable rectangle size and origin position of this responder.]
Void HandleBoundReal( Void )
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event is received. [Perform the processing when the real region is changed.]
Void HandleBoundRequest( SFXRectanglePtr rectangle )
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event is received. [Calculate the suitable rectangle size and origin position of this responder.]
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 HandleRenderRequest( SFXGraphicsPtr graphics )
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received. [Draw this responder.]
SFCError HandleSoftMenuCreate( UInt32 key )
This function will be called immediately after the specified SoftKey menu is created.
Void HandleSoftMenuDestroy( UInt32 key )
This function will be called just before the specified SoftKey menu is destroyed.
Void HandleStyle( UInt16 style )
This function will be called when the style event is revceived.
Void InvalidateCache( Void )
Invalidate the cashe of this SoftKey control.
Bool IsCacheValid( Void )
Check whether or not the cashe of this SoftKey control is valid.
SFCError RebuildCache( Void )
Rebuild the cashe of this SoftKey control.
Void SetLabelRectangle( SoftkeyEnum index , SFXRectangleConstRef rectangle )
Set the rectangular region of the specified label of this SoftKey control to the specified value.
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 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 SFZSoftKeyControl class.
KeyEnum
Constants that represent special key values.
SoftkeyEnum
Constants that are related with SoftKey.
StyleEnum
Constants that represent styles of SFZSoftKeyControl.
HorizontalEnum (inherits from SFYResponder)
Constants that represent the horizontal alignment.
VerticalEnum (inherits from SFYResponder)
Constants that represent the vertical alignment.

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

Return value

This constructor performs the initializations as follows:

  1. Set the type of this responder to "cske".
  2. Set the font of the label text of this SoftKey control to AEE_FONT_NORMAL.
  3. Set the menu style of this SoftKey control to SFZSoftKeyControl::DEFAULT_STYLE.
  4. Set the space between the label and the border of this SoftKey control to 2 [pixels].
  5. Set the length of the base of the triangle label in the SoftKey menu with the "extention" style to 6 [pixels].
  6. Set the height of the triangle label in the SoftKey menu with the "extention" style to 3 [pixels].
  7. Set the background color of this SoftKey control to SFXRGBColor(0xCC, 0xCC, 0xCC, 0x00)[light gray clor].
  8. Set the frame color of the color key "0" of this SoftKey control to SFXRGBColor(0xDD, 0xDD, 0xDD, 0x00)[light gray color].
  9. Set the foreground color of the color key "0" of this SoftKey control to SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00)[white color].
  10. Set the background color of the color key "0" of this SoftKey control to SFXRGBColor(0x77, 0x77, 0x77, 0x00)[gray color].
  11. Set the image of the image key "0" of this SoftKey control to SFBImageSmp::EmptyInstance().
  12. Set the text of the text key "0" of this SoftKey control to SFXWideString::EmptyInstance().
  13. Set the default color key of this SoftKey menu to "0".
  14. Set the default image key of this SoftKey menu to "0".
  15. Set the default text key of this SoftKey menu to "0".
  16. Set the default value of the enable flag of a label of this SoftKey control to "true".
  17. Create the default menu of the menu key "0".
    [Note] Note
    For more details on the default menu of the menu key "0", see the description of SFZSoftKeyControl.
  18. Initialize the internal cashe.
  19. Register the event handlers in the table below into this responder.

Table 239. Event handler

Event Content of the handler
SFEVT_KEY events from AVK_SOFT1 to AVK_SOFT4 Send the SoftKey event[SFEVT_RESPONDER_SOFTKEY] to the "active responder". (* For "active responder", see the below.)
Parent Child Event[SFEVT_RESPONDER_OWNER] which will occur when the parent responder is set to this responder Register the dispatching rule that the SFEVT_KEY events from AVK_SOFT1 to AVK_SOFT4 will be distributed to responders in the order from foreground to background regardless of their states into the tracer of the parent responder.
Parent Child Event[SFEVT_RESPONDER_OWNER] which will occur when the null responder is set to this SoftKey control Unregister the dispatching rule of the SFEVT_KEY events from AVK_SOFT1 to AVK_SOFT4 from the tracer of the parent responder.
Parent Child Event[SFEVT_RESPONDER_OWNER] which will occur when a sibling responder is set Move this SoftKey control to the most foreground among sibling responders.
Style event[SFEVT_RESPONDER_STYLE] which will occur when the design of this SoftKey control is changed Call the SFZSoftKeyControl::HandleStyle function.
[Note] Note
In a responder inheriting from SFZSoftKeyControl, the corresponding handler will be called when one of the above events occurs.

Reference

SFYResponder::SetType | SFZSoftKeyControl::CodeEnum | SFZSoftKeyControl::SetFont | SFZSoftKeyControl::SetStyle | SFZSoftKeyControl::StyleEnum | SFZSoftKeyControl::SetBaseSpace | SFZSoftKeyControl::SetArrowBaseLength | SFZSoftKeyControl::SetArrowHeight | SFYWidget::SetBackgroundColor | SFZSoftKeyControl::SetDefaultFrameColor | SFZSoftKeyControl::SetDefaultForeColor | SFZSoftKeyControl::SetDefaultBackColor | SFZSoftKeyControl::HandleStyle | SFZSoftKeyControl::RegisterFrameColor | SFZSoftKeyControl::RegisterForeColor | SFZSoftKeyControl::RegisterBackColor | SFZSoftKeyControl::RegisterImage | SFZSoftKeyControl::RegisterText | SFZSoftKeyControl::SetColorKey | SFZSoftKeyControl::SetImageKey | SFZSoftKeyControl::SetTextKey | SFZSoftKeyControl::SetEnable | SFZSoftKeyControl::CreateMenu | SFXEvent | SFXRGBColor | Type | Tracer | Event | Key Event[SFEVT_KEY] | SoftKey Event[SFEVT_RESPONDER_SOFTKEY] | Parent Child Event[SFEVT_RESPONDER_OWNER] | Style Event[SFEVT_RESPONDER_STYLE]


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

Description

This destructor performs the finalization on this SoftKey control as follows:

  1. Unbind all responders from this SoftKey control.
  2. Delete all registered SoftKey menus from this SoftKey control.
  3. Delete all registered images from this SoftKey control.
  4. Delete all registered 3-Colors(frame color, foreground color, and background color) from this SoftKey control.
  5. Delete all registered texts from this SoftKey control.

Reference

SFZSoftKeyControl::UnBind | SFZSoftKeyControl::CreateMenu | SFZSoftKeyControl::DestroyMenu | SFZSoftKeyControl::RegisterImage | SFZSoftKeyControl::RegisterImageRange | SFZSoftKeyControl::UnregisterImage | SFZSoftKeyControl::RegisterBackColor | SFZSoftKeyControl::RegisterBackColor | SFZSoftKeyControl::RegisterFrameColor | SFZSoftKeyControl::UnregisterColor | SFZSoftKeyControl::RegisterText | SFZSoftKeyControl::RegisterTextRange | SFZSoftKeyControl::UnregisterText


SFZSoftKeyControl::Bind
Bind the specified responder with the specified menu.
[ public ]
SFCError Bind(
    SFYResponderPtr responder   // responder
    UInt32 key                  // menu key
);
[ public ]
SFCError Bind(
    SFYResponderSmpConstRef responder   // responder
    UInt32 key                          // menu key
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the value of argument is invalid: SFERR_INVALID_PARAM (when the value of "responder" argument is invalid or the menu key is not registered)
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_INVALID_STATE

Description

This function binds the specified responder with the specified SoftKey menu.

If this responder becomes "active", the corresponding SoftKey menu will be displayed.

[Note] About "active"

The foremost responder among the focused responder bound with the SoftKey control is defined as "active".

[Note] Mechanism of the SoftKey control

In the SoftKey control, the SoftKey menu can be associated with more than one responder.

The SoftKey control is defined as "active" if some responders bound with the SoftKey control are in the "focus" state. And the foremost responder among them is defined as "active responder".

At this time, the SoftKey menu associated with "active responder" will be displayed on the screen. This menu is defined as "active menu".

The SoftKey control will receive the key event[SFEVT_KEY] from SoftKey and send it as the SoftKey event[SFEVT_RESPONDER_SOFTKEY] to "active responder".

If the SoftKey control is not "active", the SoftKey event[SFEVT_RESPONDER_SOFTKEY] will be sent to no responder. And, the SoftKey menu whose menu key is "0", called "default menu", will be displayed on the screen.

Reference

SFZSoftKeyControl::UnBind


SFZSoftKeyControl::ContainsColorKey
Check whether or not the specified color key is registered into this SoftKey control.
[ public, const ]
Bool ContainsColorKey(
    UInt32 key   // color key (unique id)
);

Return value

  • If registered: true
  • Otherwise: false

Description

This function checks whether or not the specified color key is registered into this SoftKey control.

Reference

SFZSoftKeyControl::GetColorKey SFZSoftKeyControl::SetColorKey


SFZSoftKeyControl::ContainsImageKey
Check whether or not the specified image key is registered into this SoftKey control.
[ public, const ]
Bool ContainsImageKey(
    UInt32 key   // image key (unique id)
);

Return value

  • If registered: true
  • Otherwise: false

Description

This function checks whether or not the specified image key is registered into this SoftKey control.

Reference

SFZSoftKeyControl::GetImageKey SFZSoftKeyControl::SetImageKey


SFZSoftKeyControl::ContainsMenuKey
Check whether or not the specified menu key is registered into this SoftKey control.
[ public, const ]
Bool ContainsMenuKey(
    UInt32 key   // menu key (unique id)
);

Return value

  • If created: true
  • Otherwise: false

Description

This function checks whether or not the specified menu key is registered into this SoftKey control.

Reference

SFZSoftKeyControl::GetMenuKey


SFZSoftKeyControl::ContainsResponder
Check whether or not the specified responder is bound with this SoftKey control.
[ public, const ]
Bool ContainsResponder(
    SFYResponderPtr responder   // responder
);

Return value

  • If bound: true
  • Otherwise: false

Description

This function checks whether or not the specified responder is bound with this SoftKey control.

Reference

SFZSoftKeyControl::Bind SFZSoftKeyControl::UnBind


SFZSoftKeyControl::ContainsTextKey
Check whether or not the specified text key is registered into this SoftKey control.
[ public, const ]
Bool ContainsTextKey(
    UInt32 key   // text key (unique id)
);

Return value

  • If registered: true
  • Otherwise: false

Description

This function checks whether or not the specified text key is registered into this SoftKey control.

Reference

SFZSoftKeyControl::GetTextKey SFZSoftKeyControl::SetTextKey


SFZSoftKeyControl::CreateMenu
Create the specified SoftKey menu of this SoftKey control.
[ public ]
SFCError CreateMenu(
    UInt32 key   // menu key (unique id)
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If the value of argument is invalid: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_INVALID_STATE

Description

This function creates the SoftKey menu of this SoftKey control for the specified menu key.

If this function succeeds, the handler of SFZSoftKeyControl::HandleSoftMenuCreate will be booted up immediately.

The SoftKey menu whose menu key value is INVALID_KEY (= UINT32_MAXIMUM) cannot be created.

If the SoftKey menu of the specified menu key value has already existed, it will be destroyed and the newly created SoftKey menu will replace it.

In this case, the handler of SFZSoftKeyControl::HandleSoftMenuDestroy will be booted up just before the existing SoftKey menu is destroyed.

Immediately after creation of the SoftKey menu, each of its label is valid [i.e., its enable flag is set to "true", therefore it will be displayed on the screen] and each element key of text, image, and 3-Color is set to "0".

[Note] SoftKey menu of the menu key "0"

The SoftKey menu of the menu key "0" is automatically created when the instance of the SoftKey control is created.

The SoftKey menu of the menu key "0" is used as the default menu.

[Note] Default menu

Default menu is the SoftKey menu which is displayed when any responder bound with the SoftKey control is in the "unfocus" state, i.e., there is no "active responder".

The default menu is automatically created and registered with the menu key "0" into the SoftKey control when its instance is created.

The initial settings of the default menu of the menu key "0" is as follows:

  1. Foreground color : SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00)[white color]
  2. Background color: SFXRGBColor(0x77, 0x77, 0x77, 0x00)[gray color]
  3. Frame color : SFXRGBColor(0xDD, 0xDD, 0xDD, 0xDD)[light gray color]
  4. Label text : SFXWideString::EmptyInstance()
  5. Label image : SFBImageSmp::EmptyInstance()

*1 These value can be changed by updating each value for the menu key "0" with the functions of SFZSoftKeyControl.

*2 Since the enable flag of each label in the SoftKey menu is set to "true" by default, the label region will be displayed as it is. To undisplay a label region, set its enable flag to "false" using the SFZSoftKeyControl::SetEnable function.

Reference

SFZSoftKeyControl::HandleSoftMenuCreate | SFZSoftKeyControl::HandleSoftMenuDestroy | SFZSoftKeyControl::DestroyMenu | SFXWideString::EmptyInstance | SFXBrewPointer::EmptyInstance | SFXWideString | SFBImage


SFZSoftKeyControl::DestroyMenu
Destroy the specified SoftKey menu.
[ public ]
Void DestroyMenu(
    UInt32 key   // menu key (unique id)
);

Description

This function destroys the SoftKey menu for the specified menu key.

The handler of SFZSoftKeyControl::HandleSoftMenuDestroy will be booted up just before the SoftKey menu is destroyed.

If the specified SoftKey menu does not exist, nothing will happen.

Reference

SFZSoftKeyControl::HandleSoftMenuDestroy | SFZSoftKeyControl::CreateMenu


SFZSoftKeyControl::DrawImage
Draw the specified label image at the specified rectangular region.
[ protected, const ]
Void DrawImage(
    SFXGraphicsPtr graphics          // graphics object
    SFXRectangleConstRef rectangle   // rectangular region to draw
    SFBImageSmpConstRef image        // image to draw
);

Description

This function draws the specified label image at the specified rectangular region.

At this time, the center of the rectangular region equalizes with that of the label image.

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

[Tip] Tip
This function is called in the SFZSoftKeyControl::HandleBoundRequest function

Internal Implementation

Internal implementation of the SFZSoftKeyControl::DrawImage function is as follows:

/*protected */Void SFZSoftKeyControl::DrawImage(SFXGraphicsPtr graphics, SFXRectangleConstRef rectangle, SFBImageSmpConstRef image) const
{
    SFXRectangle                        rcImage(rectangle);
    AEEImageInfo                        info;
    SInt16                              dx;
    SInt16                              dy;

    if (image != null) {
        image->GetInfo(&info);
        if (info.cx > 0 && info.cy > 0) {
            dx = (rcImage.GetWidth() - info.cx) / 2;
            dy = (rcImage.GetHeight() - info.cy) / 2;
            rcImage.SetSize(info.cx, info.cy);
            graphics->DrawImage(image, rcImage.GetOrigin() + SFXGrid(dx, dy));
        }
    }
    return;
}// SFZSoftKeyControl::DrawImage //

Reference

SFZSoftKeyControl::DrawRectangularFrame | SFZSoftKeyControl::HandleBoundRequest


SFZSoftKeyControl::DrawRectangularFrame
Draw the frame in the specified frame color and the specified background color in the specified rectangular region.
[ protected, const ]
SFXRectangle DrawRectangularFrame(
    SFXGraphicsPtr graphics          // graphics object
    SFXRectangleConstRef rectangle   // region to draw
    SFXRGBColorConstRef back         // background color of region
    SFXRGBColorConstRef frame        // frame color
);

Return value

Content region surrounded by the frame.

Description

This function draws the frame in the specified frame color and the specified background color in the specified rectangular region. Then the content region surrounded by the frame will be returned.

In general, a text or an image is drawn within this content region, which is filled in the background color.

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

[Tip] Tip
This function is called in the SFZSoftKeyControl::DrawRectangularFrame function

Internal Implementation

Internal implementation of the SFYWidget::HandleRenderRequest function is as follows:

enum {
    ARROW_BASE_LENGTH   = 6,
    ARROW_HEIGHT        = 3,
    BASE_SPACE          = 2,
    RING_MARGIN         = 3,
    RING_SIZE           = 1
};

/*protected */SFXRectangle SFZSoftKeyControl::DrawRectangularFrame(SFXGraphicsPtr graphics, SFXRectangleConstRef rectangle, SFXRGBColorConstRef back, SFXRGBColorConstRef frame) const
{
    SFXRectangle                        result(rectangle);

    graphics->DrawRoundRectangle(result, SFXSize(9, 9), back);
    result.Deflate(RING_SIZE, RING_SIZE);
    graphics->FillRoundRectangle(result, SFXSize(7, 7), back);
    graphics->DrawRoundRectangle(result, SFXSize(7, 7), frame);
    result.Deflate(RING_MARGIN - RING_SIZE, RING_MARGIN - RING_SIZE);
    return result;
}// SFZSoftKeyControl::DrawRectangularFrAme //

Reference

SFZSoftKeyControl::DrawImage | SFZSoftKeyControl::HandleBoundRequest


SFZSoftKeyControl::GetActiveMenuKey
Get the menu key of the active menu of this SoftKey control.
[ public, const ]
UInt32 GetActiveMenuKey(Void);

Description

This function gets the menu key of the active menu of this SoftKey control.

[Note] What is an active menu?

The SoftKey menu which is currently displayed is called "active menu".

Reference

SFZSoftKeyControl::GetMenuKey


SFZSoftKeyControl::GetArrowBaseLength
Get the length of the base of the triangle label in the SoftKey menu with the "extention" style. [pixels]
[ public, const ]
SInt16 GetArrowBaseLength(Void);

Return value

Length of the base of the triangle label in the SoftKey menu with the "extention" style. [pixels]

Description

This function gets the length of the base of the triangle label in the SoftKey menu with the "extention" style. [pixels]

Reference

SFZSoftKeyControl::SetArrowBaseLength


SFZSoftKeyControl::GetArrowHeight
Get the height of the triangle label in the SoftKey menu with the "extention" style. [pixels]
[ public, const ]
SInt16 GetArrowHeight(Void);

Return value

Height of the triangle in this SoftKey control. [pixels]

Description

This function gets the height of the triangle label in the SoftKey menu with the "extention" style. [pixels]

Reference

SFZSoftKeyControl::SetArrowHeight


SFZSoftKeyControl::GetBackColor
Get the background color for label of this SoftKey control which corresponds to the specified color key.
[ public, const ]
SFXRGBColorConstRef GetBackColor(
    UInt32 key   // color key (unique id)
);

Return value

  • If succeeds: The background color for label which corresponds to the specified color key
  • If the color key is not registered: The default background color

Description

This function gets the background color of a label which corresponds to the specified color key.

If the color key is not registered, the default background color set with the SFZSoftKeyControl::SetDefaultBackColor function will be returned.

Reference

SFZSoftKeyControl::RegisterBackColor | SFZSoftKeyControl::UnregisterColor | SFZSoftKeyControl::SetDefaultBackColor | SFZSoftKeyControl::GetFrameColor | SFZSoftKeyControl::GetForeColor | SFZSoftKeyControl::GetText | SFZSoftKeyControl::GetImage


SFZSoftKeyControl::GetBaseSpace
Get the value of space between the label and the border of this SoftKey control. [pixels]
[ public, const ]
SInt16 GetBaseSpace(Void);

Return value

Value(Base space) of the space between the label and the border of this SoftKey control. [pixels]

Description

This function gets the value of space between the label and the border of this SoftKey control. [pixels]

[Note] Note
The value of the space between the labels is same with this return value.

Reference

SFZSoftKeyControl::SetBaseSpace


SFZSoftKeyControl::GetCacheBackColor
Get the background color of the specified active label of this SoftKey control from the cashe.
[ protected, const ]
SFXRGBColorConstRef GetCacheBackColor(
    SoftkeyEnum index   // index of label
);

Return value

Background color of the specified active label of this SoftKey control.

Description

This function gets the background color of the specified active label of this SoftKey control from the cashe.

[Note] What is an active label?

The label on the active menu is called "active label".

[Note] What is an active menu?

The SoftKey menu which is currently displayed is called "active menu".

[Note] Cashe of the SoftKey control

In the SoftKey control, the content of the active menu is saved in the cashe.

Reference

SFZSoftKeyControl::SoftkeyEnum | SFZSoftKeyControl::GetCacheFrameColor | SFZSoftKeyControl::GetCacheForeColor


SFZSoftKeyControl::GetCacheForeColor
Get the foreground color of the specified active label of this SoftKey control from the cashe.
[ protected, const ]
SFXRGBColorConstRef GetCacheForeColor(
    SoftkeyEnum index   // index of label
);

Return value

Foreground color of the specified active label of this SoftKey control.

Description

This function gets the foreground color of the specified active label of this SoftKey control from the cashe.

[Note] What is an active label?

The label on the active menu is called "active label".

[Note] What is an active menu?

The SoftKey menu which is currently displayed is called "active menu".

[Note] Cashe of the SoftKey control

In the SoftKey control, the content of the active menu is saved in the cashe.

Reference

SFZSoftKeyControl::SoftkeyEnum | SFZSoftKeyControl::GetCacheFrameColor | SFZSoftKeyControl::GetCacheBackColor


SFZSoftKeyControl::GetCacheFrameColor
Get the frame color of the specified active label of this SoftKey control from the cashe.
[ protected, const ]
SFXRGBColorConstRef GetCacheFrameColor(
    SoftkeyEnum index   // index of label
);

Return value

Frame color of the specified active label of this SoftKey control.

Description

This function gets the frame color of the specified active label of this SoftKey control from the cashe.

[Note] What is an active label?

The label on the active menu is called "active label".

[Note] What is an active menu?

The SoftKey menu which is currently displayed is called "active menu".

[Note] Cashe of the SoftKey control

In the SoftKey control, the content of the active menu is saved in the cashe.

Reference

SFZSoftKeyControl::SoftkeyEnum | SFZSoftKeyControl::GetCacheForeColor | SFZSoftKeyControl::GetCacheBackColor


SFZSoftKeyControl::GetCacheImage
Get the image of the specified active label of this SoftKey control from the cashe.
[ protected, const ]
SFBImageSmpConstRef GetCacheImage(
    SoftkeyEnum index   // index of label(cursor labels are not included)
);

Argument

index

One of SELECT, SOFTKEY_1, SOFTKEY_2, SOFTKEY_3, or SOFTKEY_4 can be specified.

Return value

Image of the specified active label of this SoftKey control

Description

This function gets the image of the specified active label of this SoftKey control from the cashe.

If a cursor label is specified, "null" will be returned.

[Note] What is an active label?

The label on the active menu is called "active label".

[Note] What is an active menu?

The SoftKey menu which is currently displayed is called "active menu".

[Note] Cashe of the SoftKey control

In the SoftKey control, the content of the active menu is saved in the cashe.

Reference

SFZSoftKeyControl::SoftkeyEnum | SFZSoftKeyControl::GetCacheText


SFZSoftKeyControl::GetCacheLabelEnable
Get the value of enable flag of the specified active label of this SoftKey control from the cashe.
[ protected, const ]
Bool GetCacheLabelEnable(
    SoftkeyEnum index   // index of label(cursor labels are not included)
);

Return value

Value of the enable flag of the specified active label of this SoftKey control.

Description

This function gets the value of enable flag of the specified active label of this SoftKey control from the cashe.

If the enable flag is set to "false", the corresponding label will not be drawn.

[Note] What is an active label?

The label on the active menu is called "active label".

[Note] What is an active menu?

The SoftKey menu which is currently displayed is called "active menu".

[Note] Cashe of the SoftKey control

In the SoftKey control, the content of the active menu is saved in the cashe.

Reference

SFZSoftKeyControl::SoftkeyEnum | SFZSoftKeyControl::GetEnable


SFZSoftKeyControl::GetCachePress
Get the press state of the specified active label of this SoftKey control from the cashe.
[ protected, const ]
Bool GetCachePress(
    SoftkeyEnum index   // index of label(only for cursor label)
);

Argument

index

One of UP, DOWN, LEFT, or RIGHT can be specified.

Return value

Press state of the specified active label of this SoftKey control

Description

This function gets the press state of the specified active label of this SoftKey control from the cashe.

If the index of the label othe than cursor label is specified, "false" will be returned.

If the enable flag is set to "false", the corresponding label will not be drawn.

[Note] What is an active label?

The label on the active menu is called "active label".

[Note] What is an active menu?

The SoftKey menu which is currently displayed is called "active menu".

[Note] Cashe of the SoftKey control

In the SoftKey control, the content of the active menu is saved in the cashe.

Reference

SFZSoftKeyControl::SoftkeyEnum


SFZSoftKeyControl::GetCacheText
Get the text of the specified active label of this SoftKey control from the cashe.
[ protected, const ]
SFXWideStringConstRef GetCacheText(
    SoftkeyEnum index   // index of label(cursor labels are not included)
);

Argument

index

One of SELECT, SOFTKEY_1, SOFTKEY_2, SOFTKEY_3, or SOFTKEY_4 can be specified.

Return value

Text of the specified active label of this SoftKey control

Description

This function gets the text of the specified active label of this SoftKey control from the cashe.

If a cursor label is specified, "null" will be returned.

[Note] What is an active label?

The label on the active menu is called "active label".

[Note] What is an active menu?

The SoftKey menu which is currently displayed is called "active menu".

[Note] Cashe of the SoftKey control

In the SoftKey control, the content of the active menu is saved in the cashe.

Reference

SFZSoftKeyControl::SoftkeyEnum | SFZSoftKeyControl::GetCacheImage


SFZSoftKeyControl::GetColorKey
Get the color key of the specified label of the specified menu of this SoftKey control.
[ public, const ]
UInt32 GetColorKey(
    UInt32 menuKey      // menu key (unique id)
    SoftkeyEnum index   // index of label
);

Return value

  • If succeeds: color key
  • If argument is invalid: INVALID_KEY

Description

This function gets the color key of the specified label of the specified menu of this SoftKey control.

If the invalid menu key or label index is specified, "INVALID_KEY(= UINT32_MAXIMUM)" will be returned.

Reference

SFZSoftKeyControl::SetColorKey


SFZSoftKeyControl::GetDefaultBackColor
Get the default background color for label of this SoftKey control.
[ public, const ]
SFXRGBColorConstRef GetDefaultBackColor(Void);

Description

This function gets the default background color for label of this SoftKey control, which will be used when the invalid color key is specified.

The background of label or the triangle when the cursor key is not pressed is filled in this color.

Reference

SFZSoftKeyControl::SetDefaultBackColor


SFZSoftKeyControl::GetDefaultForeColor
Get the default foreground color for label of this SoftKey control.
[ public, const ]
SFXRGBColorConstRef GetDefaultForeColor(Void);

Description

This function gets the default foreground color for label of this SoftKey control, which will be used when the invalid color key is specified.

The label text or the triangle when the cursor key is pressed is drawn in this color.

Reference

SFZSoftKeyControl::SetDefaultForeColor


SFZSoftKeyControl::GetDefaultFrameColor
Get the default frame color for label of this SoftKey control.
[ public, const ]
SFXRGBColorConstRef GetDefaultFrameColor(Void);

Description

This function gets the default frame color for label of this SoftKey control, which will be used when the invalid color key is specified.

Reference

SFZSoftKeyControl::SetDefaultFrameColor


SFZSoftKeyControl::GetEnable
Get the value of enable flag of the specified label of the specified menu of this SoftKey control.
[ public, const ]
Bool GetEnable(
    UInt32 menuKey      // menu key (unique id)
    SoftkeyEnum index   // index of label
);

Return value

  • If the specified label is enable: true
  • Otherwise: false

Description

This function gets the value of enable flag of the specified label of the specified menu of this SoftKey control.

If the specified menu key or label number is invalid, "false" will be returned.

[Note] Note
If the value of enable flag is "false", the corresponding label will not be drawn.

Reference

SFZSoftKeyControl::SetEnable


SFZSoftKeyControl::GetFont
Get the font of the label text of this SoftKey control.
[ public, const ]
AEEFont GetFont(Void);

Description

This function gets the font to draw the label text of this SoftKey control.

Reference

SFZSoftKeyControl::SetFont


SFZSoftKeyControl::GetForeColor
Get the foreground color for label of this SoftKey control, which corresponds to the specified color key.
[ public, const ]
SFXRGBColorConstRef GetForeColor(
    UInt32 key   // color key (unique id)
);

Return value

  • If succeeds: The foreground color for label which corresponds to the specified color key
  • If the color key is not registered: The default foreground color

Description

This function gets the foreground color(text color) for label of this SoftKey control, which corresponds to the specified color key.

If the key is not registered, the default foreground color set with the SFZSoftKeyControl::SetDefaultForeColor function will be returned.

Reference

SFZSoftKeyControl::RegisterForeColor | SFZSoftKeyControl::UnregisterColor | SFZSoftKeyControl::SetDefaultForeColor | SFZSoftKeyControl::GetFrameColor | SFZSoftKeyControl::GetBackColor | SFZSoftKeyControl::GetText | SFZSoftKeyControl::GetImage


SFZSoftKeyControl::GetFrameColor
Get the frame color for label of this SoftKey control, which corresponds to the specified color key.
[ public, const ]
SFXRGBColorConstRef GetFrameColor(
    UInt32 key   // color key (unique id)
);

Return value

  • If succeeds: The frame color for label which corresponds to the specified color key
  • If the color key is not registered: The default frame color

Description

This function gets the frame color for label of this SoftKey control, which corresponds to the specified color key.

If the key is not registered, the default frame color set with the SFZSoftKeyControl::SetDefaultFrameColor function will be returned.

Reference

SFZSoftKeyControl::RegisterFrameColor | SFZSoftKeyControl::UnregisterColor | SFZSoftKeyControl::SetDefaultFrameColor | SFZSoftKeyControl::GetForeColor | SFZSoftKeyControl::GetBackColor | SFZSoftKeyControl::GetText | SFZSoftKeyControl::GetImage


SFZSoftKeyControl::GetImage
Get the label image of this SoftKey control, which corresponds to the specified image key.
[ public, const ]
SFBImageSmpConstRef GetImage(
    UInt32 key   // image key (unique id)
);

Return value

  • If succeeds: image of SFBImageSmpConstRef type
  • If argument is invalid: SFBImageSmp::EmptyInstance()

Description

This function gets the label image of this SoftKey control, which corresponds to the specified image key.

If the key is not registered, SFBImageSmp::EmptyInstance() will be returned.

Reference

SFZSoftKeyControl::RegisterImage | SFZSoftKeyControl::UnregisterImage | SFZSoftKeyControl::GetText | SFZSoftKeyControl::GetBackColor | SFZSoftKeyControl::GetForeColor | SFZSoftKeyControl::GetFrameColor | SFXBrewPointer::EmptyInstance | SFBImage


SFZSoftKeyControl::GetImageKey
Get the image key of the specified label of the specified menu of this SoftKey control.
[ public, const ]
UInt32 GetImageKey(
    UInt32 menuKey      // menu key (unique id)
    SoftkeyEnum index   // index of label
);

Return value

  • If succeeds: image key
  • If argument is invalid: INVALID_KEY

Description

This function gets the image key of the specified label of the specified menu of this SoftKey control.

If the invalid menu key or label index is specified, "INVALID_KEY(= UINT32_MAXIMUM)" will be returned.

Reference

SFZSoftKeyControl::SetImageKey


SFZSoftKeyControl::GetLabelRectangle
Get the rectangular region of the specified label of this SoftKey control.
[ public, const ]
SFXRectangleConstRef GetLabelRectangle(
    SoftkeyEnumEnum index   // index of label
);

Description

This function gets the rectangular region of the specified label of this SoftKey control.

[Note] Note
This function is called to get the rectangular region of the label in such a case that the developer's own drawing of this control is performed.

Reference

SFZSoftKeyControl::SoftkeyEnum | SFZSoftKeyControl::SetLabelRectangle | SFZSoftKeyControl::DrawRectangularFrame


SFZSoftKeyControl::GetMenuKey
Get the menu key of this SoftKey control, which is bound with the specified responder.
[ public, const ]
UInt32 GetMenuKey(
    SFYResponderPtr responder   // responder
);

Return value

  • If succeeds: menu key
  • If responder does not exist: INVALID_KEY

Reference

SFZSoftKeyControl::CreateMenu SFZSoftKeyControl::DestroyMenu


SFZSoftKeyControl::GetStyle
Get the menu style of this SoftKey control.
[ public, const ]
StyleEnum GetStyle(Void);

Description

This function gets the menu style of this SoftKey control.

Default: SFZSoftKeyControl::DEFAULT_STYLE (standard style)

Reference

SFZSoftKeyControl::SetStyle | SFZSoftKeyControl::StyleEnum


SFZSoftKeyControl::GetText
Get the label text of this SoftKey control, which corresponds to the specified text key.
[ public, const ]
SFXWideStringConstRef GetText(
    UInt32 key   // text key (unique id)
);

Return value

  • If succeeds: text of SFXWideStringSmpConstRef type
  • If argument is invalid: SFXWideString::EmptyInstance()

Description

This function gets the label text of this SoftKey control, which corresponds to the specified text key.

If the key is not registered, SFXWideString::EmptyInstance() will be returned.

Reference

SFZSoftKeyControl::RegisterText | SFZSoftKeyControl::UnregisterText | SFZSoftKeyControl::GetImage | SFZSoftKeyControl::GetBackColor | SFZSoftKeyControl::GetForeColor | SFZSoftKeyControl::GetFrameColor | SFXWideString::EmptyInstance | SFXWideString


SFZSoftKeyControl::GetTextKey
Get the text key of the specified label of the specified menu of this SoftKey control.
[ public, const ]
UInt32 GetTextKey(
    UInt32 menuKey      // menu key (unique id)
    SoftkeyEnum index   // index of label
);

Return value

  • If succeeds: text key
  • If argument is invalid: INVALID_KEY

Description

This function gets the text key of the specified label of the specified menu of this SoftKey control.

If the invalid menu key or label index is specified, "INVALID_KEY(= UINT32_MAXIMUM)" will be returned.

Reference

SFZSoftKeyControl::SetTextKey


SFZSoftKeyControl::HandleBoundOptimize
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE) event is received. [Calculate the suitable rectangle size and origin position of this responder.]
[ protected, virtual, const ]
Void HandleBoundOptimize(
    SFXRectanglePtr rectangle   // hint region and calculated region(to be ignored)
);

Description

This function will be called when the region event [SFXEvent(SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE, rectangle)] is received.

This function calculates the suitable rectangle size and origin position of this responder.

In the default implementation, the suitable rectangle size in the device screen is stored into the size element of the rectangle argument as a result of calculation depending on its style. Value passed via the "rectangle" argument will be ignored.

The suitable rectangle size is stored into the size element of the rectangle argument as a result of calculation. It is recommended not to change the origin of the rectangle argument in this function.

[Caution] CAUTION

Implementation of this function is the same with that of the SFZSoftKeyControl::HandleBoundRequest function. The rectangular region will be ignored if specified in the "rectangle" argument and the suitable size will be calculated from the full screen region of the mobile phone.

In general, the HandleBoundOptimize() function will return only the suitable rectangle size, but the SFZSoftKeyControl::HandleBoundOptimize function will return not only the size but also the origin position of the suitable rectangular region via the "rectangle" argument which will be passed as the P32 parameter of the region event. Therefore, you don't have to set the origin position after calling the SFYResponder::GetSuitableBound function regarding to the SFZSoftKeyControl class.

[Note] Region event[(SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE) event]

If the rectangle argument of the hint region is specified, the SFYResponder::GetSuitableBound function will send the region event [SFXEvent(SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE, rectangle)] to this responder.

Then, the SFYWidget::HandleBoundOptimize virtual function will be called.

The rectangle element (P32 parameter) of the region event is set to the hint region as an initial value.

Internal Implementation

Internal implementation of the SFZSoftKeyControl::HandleBoundOptimize function is as follows:

enum {
     ARROW_BASE_LENGTH   = 6,
     ARROW_HEIGHT        = 3,
     BASE_SPACE          = 2,
     RING_MARGIN         = 3,
     RING_SIZE           = 1
};

enum StyleEnum {
     STANDARD                            = 0,
     EXTENSION,
     DEFAULT_STYLE                       = STANDARD
};

/*protected virtual */Void SFZSoftKeyControl::HandleBoundOptimize(SFXRectanglePtr rectangle) const
{
    BoundImpl(rectangle);
    return;
}// SFZSoftKeyControl::HandleBoundOptimize //

/*private */Void SFZSoftKeyControl::BoundImpl(SFXRectanglePtr rectangle) const
{
    SFXDevice                           device;
    SInt16                              h;
    SInt16                              H;

    rectangle->Set(SFXGrid::ZeroInstance(), device.GetScreenSize());
    h = SFXGraphics::GetFontHeight(_font);
    h += RING_MARGIN * 2;
    if (_style == STANDARD) {
        H = h + (_size.baseSpace * 2);
    }
    else {
        H = h * 2 + (_size.baseSpace * 3);
    }
    rectangle->SetTop(rectangle->GetBottom() - H);
    return;
}// SFZSoftKeyControl::BoundImpl //

Reference

SFZSoftKeyControl::HandleBoundRequest | SFYResponder::GetSuitableBound | SFXEvent | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND]


SFZSoftKeyControl::HandleBoundReal
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event is received. [Perform the processing 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 SFZSoftKeyControl::HandleBoundReal function is as follows:

enum SoftkeyEnum {
    SELECT,
    SOFTKEY_1,
    SOFTKEY_2,
    STANDARD_LIMIT,
    SOFTKEY_3 = STANDARD_LIMIT,
    SOFTKEY_4,
    EXTENSION_LIMIT,
    UP = EXTENSION_LIMIT,
    DOWN,
    LEFT,
    RIGHT,
    SOFTKEY_LIMIT
};

enum StyleEnum {
    STANDARD                            = 0,
    EXTENSION,
    DEFAULT_STYLE                       = STANDARD
};

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

/*private */Void SFZSoftKeyControl::BoundImpl(SFXRectanglePtr rectangle) const
{
    SFXDevice                           device;
    SInt16                              h;
    SInt16                              H;

    rectangle->Set(SFXGrid::ZeroInstance(), device.GetScreenSize());
    h = SFXGraphics::GetFontHeight(_font);
    h += RING_MARGIN * 2;
    if (_style == STANDARD) {
        H = h + (_size.baseSpace * 2);
    }
    else {
        H = h * 2 + (_size.baseSpace * 3);
    }
    rectangle->SetTop(rectangle->GetBottom() - H);
    return;
}// SFZSoftKeyControl::BoundImpl //

Reference

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


SFZSoftKeyControl::HandleBoundRequest
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event is received. [Calculate the suitable rectangle size and origin position of this responder.]
[ protected, virtual, const ]
Void HandleBoundRequest(
    SFXRectanglePtr rectangle   // calculated region
);

Description

This function will be called when the region event [SFXEvent(SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST, rectangle)] is received.

This function calculates the suitable rectangle size and origin position of this responder.

In the default implementation, the suitable rectangle size in the device screen is stored into the size element of the rectangle argument as a result of calculation depending on its style.

[Caution] CAUTION

Implementation of this function is the same with that of the SFZSoftKeyControl::HandleBoundOptimize function. The rectangular region will be ignored if specified in the "rectangle" argument and the suitable size will be calculated from the full screen region of the mobile phone.

In general, the HandleBoundRequest() function will return only the suitable rectangle size, but the SFZSoftKeyControl::HandleBoundRequest function will return not only the size but also the origin position of the suitable rectangular region via the "rectangle" argument which will be passed as the P32 parameter of the region event. Therefore, you don't have to set the origin position after calling the SFYResponder::GetSuitableBound function regarding to the SFZSoftKeyControl class.

[Note] Region event[(SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event]

If the rectangle argument of the hint region is not specified, the SFYResponder::GetSuitableBound function will send the region event [SFXEvent(SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST, rectangle)] to this responder.

Then, the SFYWidget::HandleBoundRequest virtual function will be called.

The rectangle element (P32 parameter) of the region event is set to the real region as an initial value.

[Tip] Tip
Default value of the real region: SFXRectangle(0, 0, 0, 0)

Internal Implementation

Internal implementation of the SFZSoftKeyControl::HandleBoundRequest function is as follows:

enum {
     ARROW_BASE_LENGTH   = 6,
     ARROW_HEIGHT        = 3,
     BASE_SPACE          = 2,
     RING_MARGIN         = 3,
     RING_SIZE           = 1
};

enum StyleEnum {
     STANDARD                            = 0,
     EXTENSION,
     DEFAULT_STYLE                       = STANDARD
};

/*protected virtual */Void SFZSoftKeyControl::HandleBoundRequest(SFXRectanglePtr rectangle) const
{
    BoundImpl(rectangle);
    return;
}// SFZSoftKeyControl::HandleBoundRequest //

/*private */Void SFZSoftKeyControl::BoundImpl(SFXRectanglePtr rectangle) const
{
    SFXDevice                           device;
    SInt16                              h;
    SInt16                              H;

    rectangle->Set(SFXGrid::ZeroInstance(), device.GetScreenSize());
    h = SFXGraphics::GetFontHeight(_font);
    h += RING_MARGIN * 2;
    if (_style == STANDARD) {
        H = h + (_size.baseSpace * 2);
    }
    else {
        H = h * 2 + (_size.baseSpace * 3);
    }
    rectangle->SetTop(rectangle->GetBottom() - H);
    return;
}// SFZSoftKeyControl::BoundImpl //

Reference

SFZSoftKeyControl::HandleBoundOptimize | SFYResponder::GetSuitableBound | SFXEvent | Real Region Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND]


SFZSoftKeyControl::HandleBoundVirtual
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.]
[ protected, virtual ]
Void HandleBoundVirtual(Void);

Description

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.

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

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

Internal implementation of the SFZSoftKeyControl::HandleBoundVirtual function is as follows:

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

Reference

SFYResponder::SetRealBound | SFYResponder::SetVirtualBound | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND] | Virtual Region | Real Region | Local Region


SFZSoftKeyControl::HandleRenderRequest
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received. [Draw this responder.]
[ protected, virtual, const ]
Void HandleRenderRequest(
    SFXGraphicsPtr graphics   // graphics object
);

Description

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 responder.

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

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

  1. At the end of the event loop
  2. At the applet start / resume or the end of a highest priority event handler
  3. In the callback, which is outside the event loop.

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

Internal implementation of the SFZSoftKeyControl::HandleRenderRequest function is as follows:

enum SoftkeyEnum {
    SELECT,
    SOFTKEY_1,
    SOFTKEY_2,
    STANDARD_LIMIT,
    SOFTKEY_3 = STANDARD_LIMIT,
    SOFTKEY_4,
    EXTENSION_LIMIT,
    UP = EXTENSION_LIMIT,
    DOWN,
    LEFT,
    RIGHT,
    SOFTKEY_LIMIT
};

enum StyleEnum {
    STANDARD                            = 0,
    EXTENSION,
    DEFAULT_STYLE                       = STANDARD
};


/*protected virtual */Void SFZSoftKeyControl::HandleRenderRequest(SFXGraphicsPtr graphics) const
{
    UInt32                              i;
    SFCError                            error(SFERR_NO_ERROR);

    if (!IsCacheValid()) {
        error = RebuildCache();
    }
    if (error == SFERR_NO_ERROR) {
        if (GetStyle() == STANDARD) {
            for (i = 0; i < STANDARD_LIMIT; ++i) {
         SoftkeyEnumConst            si(static_cast<SoftkeyEnum>(i));

                if (GetCacheLabelEnable(si)) {
             SFXRectangle temp = DrawRectangularFrame(graphics, GetLabelRectangle(si), GetCacheBackColor(si), GetCacheFrameColor(si));
                    DrawImage(graphics, temp, GetCacheImage(si));
                    DrawText(graphics, temp, GetCacheText(si), GetCacheForeColor(si));
                }
            }
        }
        else {
            for (i = 0; i < EXTENSION_LIMIT; ++i) {
         SoftkeyEnumConst            si(static_cast<SoftkeyEnum>(i));

                if (GetCacheLabelEnable(si)) {
             SFXRectangle temp = DrawRectangularFrame(graphics, GetLabelRectangle(si), GetCacheBackColor(si), GetCacheFrameColor(si));
                    DrawImage(graphics, temp, GetCacheImage(si));
                    DrawText(graphics, temp, GetCacheText(si), GetCacheForeColor(si));
                }
            }
            for (; i < SOFTKEY_LIMIT; ++i) {
         SoftkeyEnumConst            si(static_cast<SoftkeyEnum>(i));

                if (GetCacheLabelEnable(si)) {
                    graphics->FillTriangle(
                        InscribedTriangle(GetLabelRectangle(si), si),
                        GetCachePress(si) ? GetCacheForeColor(si) : GetCacheBackColor(si)
                    );
                }
            }
        }
    }
    return;
}// SFZSoftKeyControl::HandleRenderRequest //

/*private */Void SFZSoftKeyControl::DrawText(SFXGraphicsPtr graphics, SFXRectangleConstRef rectangle, SFXWideStringConstRef text, SFXRGBColorConstRef fore) const
{
    SFXRectangle                        rcText(rectangle);

    graphics->SetFont(_font);
    rcText.AddY(graphics->GetFontDescent() / 2);
    graphics->DrawSingleText(text, rcText, fore);
    return;
}// SFZSoftKeyControl::DrawText //

Reference

SFZSoftKeyControl::DrawImage | SFZSoftKeyControl::DrawRectangularFrame | SFYResponder::Invalidate | SFYResponder::Render | SFYResponder::InvokeBackward | Drawing Event[SFEVT_RESPONDER_RENDER] | Handler for the Drawing Event[XANDLER_DECLARE_VOIDRENDER] | Rendering | Event Loop | Responder Tree


SFZSoftKeyControl::HandleSoftMenuCreate
This function will be called immediately after the specified SoftKey menu is created.
[ protected, virtual ]
SFCError HandleSoftMenuCreate(
    UInt32 key   // menu key of created menu
);

Description

This function will be called immediately after the specified SoftKey menu is created.

In case you want to perform your own processing immediately after a SoftKey menu is created, override this virtual function.

The default implementation is to return "SFERR_NO_ERROR".

Internal Implementation

Internal implementation of the SFZSoftKeyControl::HandleSoftMenuCreate function is as follows:

/*protected virtual */SFCError SFZSoftKeyControl::HandleSoftMenuCreate(UInt32 key)
{
    unused(key);
    return SFERR_NO_ERROR;
}// SFZSoftKeyControl::HandleSoftMenuCreate //

Reference

SFZSoftKeyControl::CreateMenu | SFZSoftKeyControl::HandleSoftMenuDestroy


SFZSoftKeyControl::HandleSoftMenuDestroy
This function will be called just before the specified SoftKey menu is destroyed.
[ protected, virtual ]
Void HandleSoftMenuDestroy(
    UInt32 key   // menu key of destroyed menu
);

Description

This function will be called just before the specified SoftKey menu is destroyed.

In case you want to perform your own processing just before a SoftKey menu is destroyed, override this virtual function.

The default implementation is to do nothing.

Internal Implementation

Internal implementation of the SFZSoftKeyControl::HandleSoftMenuDestroy function is as follows:

/*protected virtual */Void SFZSoftKeyControl::HandleSoftMenuDestroy(UInt32 key)
{
    unused(key);
    return;
}// SFZSoftKeyControl::HandleSoftMenuDestroy //

Reference

SFZSoftKeyControl::DestroyMenu | SFZSoftKeyControl::HandleSoftMenuCreate


SFZSoftKeyControl::HandleStyle
This function will be called when the style event is revceived.
[ protected, virtual ]
Void HandleStyle(
    UInt16 style   // P16 parameter of style event
);

Description

This function will be called when the style event is revceived.

The style event will occur if one of the following items is changed:

  • Menu style("standrad style" or "extention style")
  • Font
  • Base space
  • Length of the base of the triangle label
  • Height of the triangle label

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

The default implementation is to calculate the position and the size of the label and the real region of this SoftKey control.

Internal Implementation

Internal implementation of the SFZSoftKeyControl::HandleStyle function is as follows:

enum {
     ARROW_BASE_LENGTH   = 6,
     ARROW_HEIGHT        = 3,
     BASE_SPACE          = 2,
     RING_MARGIN         = 3,
     RING_SIZE           = 1
};

enum StyleEnum {
     STANDARD                            = 0,
     EXTENSION,
     DEFAULT_STYLE                       = STANDARD
};

/*protected virtual */Void SFZSoftKeyControl::HandleStyle(UInt16 style)
{
    SFXRectangle                            rectangle;

    unused(style);
    BoundImpl(&rectangle);
    SetRealBound(rectangle);
    return;
}// SFZSoftKeyControl::HandleStyle //

/*private */Void SFZSoftKeyControl::BoundImpl(SFXRectanglePtr rectangle) const
{
    SFXDevice                           device;
    SInt16                              h;
    SInt16                              H;

    rectangle->Set(SFXGrid::ZeroInstance(), device.GetScreenSize());
    h = SFXGraphics::GetFontHeight(_font);
    h += RING_MARGIN * 2;
    if (_style == STANDARD) {
        H = h + (_size.baseSpace * 2);
    }
    else {
        H = h * 2 + (_size.baseSpace * 3);
    }
    rectangle->SetTop(rectangle->GetBottom() - H);
    return;
}// SFZSoftKeyControl::BoundImpl //

Reference

SFZSoftKeyControl::SetStyle | SFZSoftKeyControl::SetArrowBaseLength | SFZSoftKeyControl::SetArrowHeight | SFZSoftKeyControl::SetBaseSpace | SFZSoftKeyControl::SetFont | SFXEvent | Style Event[SFEVT_RESPONDER_STYLE]


SFZSoftKeyControl::InvalidateCache
Invalidate the cashe of this SoftKey control.
[ protected, const ]
Void InvalidateCache(Void);

Description

In the SoftKey control, the content of the active menu is saved in the cashe of this SoftKey control.

This function invalidates this cashe.

In overriding the drawing function, never forget to check whether or not the cashe is valid by calling the SFZSoftKeyControl::IsCacheValid function.

In this case, you have to rebuild the cashe by calling the SFZSoftKeyControl::RebuildCache function if the cashe is invalid.

Reference

SFZSoftKeyControl::IsCacheValid | SFZSoftKeyControl::RebuildCache


SFZSoftKeyControl::IsCacheValid
Check whether or not the cashe of this SoftKey control is valid.
[ protected, const ]
Bool IsCacheValid(Void);

Return value

  • If cashe is valid: false
  • Otherwise: true

Description

In the SoftKey control, the content of the active menu is saved in the cashe of this SoftKey control.

This function checks whether or not the cashe is valid.

In overriding the drawing function, you have to rebuild the cashe by calling the SFZSoftKeyControl::RebuildCache function if the cashe is invalid.

Example

Void CustomSoftKeyControl::HandleRenderRequest(SFXGraphicsPtr graphics) const
{
    SFCError error(SFERR_NO_ERROR);

    // if cashe is invalid
    if (!IsCacheValid()) {

        // rebuild cashe
        error = RebuildCache();
    }
    if (error == SFERR_NO_ERROR) {
        // drawing processing of your own
        // ...
    }
}

Reference

SFZSoftKeyControl::InvalidateCache | SFZSoftKeyControl::RebuildCache


SFZSoftKeyControl::NewInstance
Create a new instance of this responder class.
[ public, static ]
SFZSoftKeyControlSmp NewInstance(
    SFCErrorPtr exception = null   // error value
);

Argument

exception

Return the error value generated inside the function.

Return value

  • If succeeds: not null pointer
  • Otherwise: null pointer

Description

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.

Example

The code to create a new instance of this responder class is as follows:

SFZSoftKeyControlSmp _softkey;
SFCError error;

if ((_softkey = SFZSoftKeyControl::NewInstance(&error)) != null) {

    ...
}

SFZSoftKeyControl::RebuildCache
Rebuild the cashe of this SoftKey control.
[ protected, const ]
SFCError RebuildCache(Void);

Description

In the SoftKey control, the content of the active menu is saved in the cashe of this SoftKey control.

This function rebuilds this cashe.

In overriding the drawing function, never forget to check whether or not the cashe is valid by calling the SFZSoftKeyControl::IsCacheValid function.

In this case, you have to rebuild the cashe by calling this function if the cashe is invalid.

Example

Void CustomSoftKeyControl::HandleRenderRequest(SFXGraphicsPtr graphics) const
{
    SFCError error(SFERR_NO_ERROR);

    // if cashe is invalid
    if (!IsCacheValid()) {

        // rebuild cashe
        error = RebuildCache();
    }
    if (error == SFERR_NO_ERROR) {
        // drawing processing of your own
        // ...
    }
}

Reference

SFZSoftKeyControl::InvalidateCache | SFZSoftKeyControl::IsCacheValid


SFZSoftKeyControl::RegisterBackColor
Register the specified color as background color for label into this SoftKey control, which is associated with the specified color key.
[ public ]
SFCError RegisterBackColor(
    UInt32 key                  // color key (unique id)
    SFXRGBColorConstRef param   // background color of label
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If argument is invalid: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_INVALID_STATE

Description

This function registers the specified color as background color for label into this SoftKey control, which is associated with the specified color key.

The background of label or the triangle when the cursor key is not pressed is filled in this color.

The color whose key value is "INVALID_KEY(= UINT32_MAXIMUM)" cannot be made.

Once the background color is registered, it will remain in the heap until the SFZSoftKeyControl::UnregisterColor function or the destructor is called.

If the specified key already exists, only the specified background color will be overridden.

[Note] Background color for the color key "0"

By default, the background color of SFXRGBColor(0x77, 0x77, 0x77, 0x00)[gray color] has been registered for the color key "0".

If no background color is set to the SoftKey menu with the SFZSoftKeyControl::SetColorKey function, this background color will be referred to.

* This background color is referred to by the default menu of the menu key "0".

[Note] Default menu

For more details on the default menu of the menu key "0", see the description of SFZSoftKeyControl.

[Note] 3-Color

The frame color, the foreground color, and the background color are grouped together into 3-Color using the same unique color key at the registration.

Conversely, the color key groups the frame color, the foreground color, and the background color into 3-Color.

Reference

SFZSoftKeyControl::UnregisterColor | SFZSoftKeyControl::RegisterFrameColor | SFZSoftKeyControl::RegisterForeColor | SFZSoftKeyControl::RegisterText | SFZSoftKeyControl::RegisterImage | SFZSoftKeyControl::SetColorKey


SFZSoftKeyControl::RegisterForeColor
Register the specified color as foreground color for label into this SoftKey control, which is associated with the specified color key.
[ public ]
SFCError RegisterForeColor(
    UInt32 key                  // color key (unique id)
    SFXRGBColorConstRef param   // foreground color of label
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If argument is invalid: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_INVALID_STATE

Description

This function registers the specified color as foreground color for label into this SoftKey control, which is associated with the specified color key.

The label text or the triangle when the cursor key is pressed is drawn in this color.

The color whose key value is "INVALID_KEY(= UINT32_MAXIMUM)" cannot be made.

Once the foreground color is registered, it will remain in the heap until the SFZSoftKeyControl::UnregisterColor function or the destructor is called.

If the specified key already exists, only the specified foreground color will be overridden.

[Note] Foreground color for the color key "0"

By default, the foreground color of SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00)[white color] has been registered for the color key "0".

If no foreground color is set to the SoftKey menu with the SFZSoftKeyControl::SetColorKey function, this foreground color will be referred to.

* This foreground color is referred to by the default menu of the menu key "0".

[Note] Default menu

For more details on the default menu of the menu key "0", see the description of SFZSoftKeyControl.

[Note] 3-Color

The frame color, the foreground color, and the background color are grouped together into 3-Color using the same unique color key at the registration.

Conversely, the color key groups the frame color, the foreground color, and the background color into 3-Color.

Reference

SFZSoftKeyControl::UnregisterColor | SFZSoftKeyControl::RegisterFrameColor | SFZSoftKeyControl::RegisterBackColor | SFZSoftKeyControl::RegisterText | SFZSoftKeyControl::RegisterImage | SFZSoftKeyControl::SetColorKey


SFZSoftKeyControl::RegisterFrameColor
Register the specified color as frame color for label into this SoftKey control, which is associated with the specified color key.
[ public ]
SFCError RegisterFrameColor(
    UInt32 key                  // color key (unique id)
    SFXRGBColorConstRef param   // frame color of label
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If argument is invalid: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_INVALID_STATE

Description

This function registers the specified color as frame color for label into this SoftKey control, which is associated with the specified color key.

The color whose key value is "INVALID_KEY(= UINT32_MAXIMUM)" cannot be made.

Once the frame color is registered, it will remain in the heap until the SFZSoftKeyControl::UnregisterColor function or the destructor is called.

If the specified key already exists, only the specified frame color will be overridden.

[Note] Frame color for the color key "0"

By default, the frame color of SFXRGBColor(0xDD, 0xDD, 0xDD, 0xDD)[light gray color] has been registered for the color key "0".

If no frame color is set to the SoftKey menu with the SFZSoftKeyControl::SetColorKey function, this frame color will be referred to.

* This frame color is referred to by the default menu of the menu key "0".

[Note] Default menu

For more details on the default menu of the menu key "0", see the description of SFZSoftKeyControl.

[Note] 3-Color

The frame color, the foreground color, and the background color are grouped together into 3-Color using the same unique color key at the registration.

Conversely, the color key groups the frame color, the foreground color, and the background color into 3-Color.

Reference

SFZSoftKeyControl::UnregisterColor | SFZSoftKeyControl::RegisterForeColor | SFZSoftKeyControl::RegisterBackColor | SFZSoftKeyControl::RegisterText | SFZSoftKeyControl::RegisterImage | SFZSoftKeyControl::SetColorKey


SFZSoftKeyControl::RegisterImage
Register the specified image as label image into this SoftKey control, which is associated with the specified image key.
[ public ]
SFCError RegisterImage(
    UInt32 key             // image key (unique id)
    SFXPathConstRef path   // path of resource file
);
[ public ]
SFCError RegisterImage(
    UInt32 key             // image key (unique id)
    SFXPathConstRef path   // path of resource file
    UInt16 id              // resource ID
);
[ public ]
SFCError RegisterImage(
    UInt32 key                  // image key (unique id)
    SFBImageSmpConstRef param   // image
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If argument is invalid: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_INVALID_STATE

Description

This function registers the specified image as label image into this SoftKey control, which is associated with the specified image key.

The image whose key value is "INVALID_KEY(= UINT32_MAXIMUM)" cannot be made.

The image is set directly in the argument, or read from the resource file.

Once the image is registered, it will remain in the heap until the SFZSoftKeyControl::UnregisterImage function or the destructor is called.

If the specified key already exists, the existing image referred to by the key will be released and replaced by the specified image.

[Note] Image for the image key "0"

By default, the image of SFBImageSmp::EmptyInstance() has been registered for the image key "0".

If no image key is set to the SoftKey menu with the SFZSoftKeyControl::SetImageKey function, this text will be referred to.

* This image is referred to by the default menu of the menu key "0".

[Note] Default menu

For more details on the default menu of the menu key "0", see the description of SFZSoftKeyControl.

Reference

SFZSoftKeyControl::GetImage | SFZSoftKeyControl::RegisterImageRange | SFZSoftKeyControl::UnregisterImage | SFZSoftKeyControl::RegisterText | SFZSoftKeyControl::RegisterFrameColor | SFZSoftKeyControl::RegisterForeColor | SFZSoftKeyControl::RegisterBackColor | SFZSoftKeyControl::SetImageKey | SFXBrewPointer::EmptyInstance | SFBImage


SFZSoftKeyControl::RegisterImageRange
Register the images within the specified range as label images into this SoftKey control, which are associated with the image keys starting from the specified value.
[ public ]
SFCError RegisterImageRange(
    UInt32 originKey       // starting image key
    SFXPathConstRef path   // path of resource file
    UInt16 start           // starting resource id
    UInt16 end             // ending resource id
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If argument is invalid(when path of resource file or range of resource id is invalid): SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_INVALID_STATE

Description

This function registers the images within the specified range as label images into this SoftKey control, which are associated with the image keys starting from the specified value.

The rage of the image key [key , key + (end - start)] corresponds to that of resource id [start, end].

It may be easy to equalize the value of key with that of start in the above statement.

Once the image is registered, it will remain in the heap until the SFZSoftKeyControl::UnregisterImage function or the destructor is called.

If the specified key already exists, the existing image referred to by the key will be released and replaced by the specified image.

Example

The below is the code to register the images in the range of resource id [IDI_START, IDI_END] of the resource file ("resource.bar"), which are associated with the image keys starting from KEY_IMAGE_ORIGIN.

// suppose the SoftKey control instance has already been created
SFZSoftKeyControlSmp softkey = USRApplication::GetSoftKey();
softkey->RegisterImageRange(KEY_IMAGE_ORIGIN, SFXPath("resource.bar"), IDI_START, IDI_END);

Reference

SFZSoftKeyControl::RegisterImage | SFZSoftKeyControl::UnregisterImage | SFZSoftKeyControl::RegisterTextRange | SFZSoftKeyControl::SetImageKey


SFZSoftKeyControl::RegisterText
Register the specified image as label text into this SoftKey control, which is associated with the specified text key.
[ public ]
SFCError RegisterText(
    UInt32 key             // text key (unique id)
    SFXPathConstRef path   // path of resource file
    UInt16 id              // resource ID
);
[ public ]
SFCError RegisterText(
    UInt32 key                    // text key (unique id)
    SFXWideStringConstRef param   // text
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If argument is invalid(when path of resource file is invalid): SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_INVALID_STATE

Description

This function registers the specified image as label text into this SoftKey control, which is associated with the specified text key.

The text whose key value is "INVALID_KEY(= UINT32_MAXIMUM)" cannot be made.

The text is set directly in the argument, or read from the resource file.

Once the text is registered, it will remain in the heap until the SFZSoftKeyControl::UnregisterText function or the destructor is called.

If the specified key already exists, the existing text referred to by the key will be released and replaced by the specified text.

[Note] Text for the text key "0"

By default, the text of SFXWideString::EmptyInstance() has been registered for the text key "0".

If no text key is set to the SoftKey menu with the SFZSoftKeyControl::SetTextKey function, this text will be referred to.

* This text is referred to by the default menu of the menu key "0".

[Note] Default menu

For more details on the default menu of the menu key "0", see the description of SFZSoftKeyControl.

Reference

SFZSoftKeyControl::GetText | SFZSoftKeyControl::RegisterTextRange | SFZSoftKeyControl::UnregisterText | SFZSoftKeyControl::RegisterImage | SFZSoftKeyControl::RegisterFrameColor | SFZSoftKeyControl::RegisterForeColor | SFZSoftKeyControl::RegisterBackColor | SFZSoftKeyControl::SetTextKey | SFXWideString::EmptyInstance | SFXWideString


SFZSoftKeyControl::RegisterTextRange
Register the texts within the specified range as label texts into this SoftKey control, which are associated with the text keys starting from the specified value.
[ public ]
SFCError RegisterTextRange(
    UInt32 originKey       // starting text key
    SFXPathConstRef path   // path of resource file
    UInt16 start           // starting resource id
    UInt16 end             // ending resource id
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If argument is invalid(when path of resource file or range of resource id is invalid): SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_INVALID_STATE

Description

This function registers the texts within the specified range as label texts of a a SoftKey menu into this SoftKey control, which are associated with the text keys starting from the specified value.

The rage of the text key [key , key + (end - start)] corresponds to that of resource id [start, end].

It may be easy to equalize the value of key with that of start in the above statement.

Once the text is registered, it will remain in the heap until the SFZSoftKeyControl::UnregisterText function or the destructor is called.

If the specified key already exists, the existing text referred to by the key will be released and replaced by the specified text.

Example

The below is the code to register the texts in the range of resource id [IDI_START, IDI_END] of the resource file ("resource.bar"), which are associated with the text keys starting from KEY_IMAGE_ORIGIN.

// suppose the SoftKey control instance has already been created
SFZSoftKeyControlSmp softkey = USRApplication::GetSoftKey();
softkey->RegisterTextRange(KEY_TEXT_ORIGIN, SFXPath("resource.bar"), IDS_START, IDS_END);

Reference

SFZSoftKeyControl::RegisterText | SFZSoftKeyControl::UnregisterText | SFZSoftKeyControl::RegisterImageRange | SFZSoftKeyControl::SetTextKey


SFZSoftKeyControl::SetArrowBaseLength
Set the length of the base of the triangle label in the SoftKey menu with the "extention" style to the specified value. [pixels]
[ public ]
Void SetArrowBaseLength(
    SInt16 param   // value to set
);

Description

This function sets the length of the base of the triangle label in the SoftKey menu with the "extention" style to the specified value. [pixels]

If the length of the base of the triangle is changed, the style event of SFXEvent(SFEVT_RESPONDER_STYLE, SFP16_STYLE_ALIGN, 0) will occur.

Default: 6 pixels.

[Note] Length of the base of the triangle label in the SoftKey menu

It represents the width regarding to the up or down triangle, and the height regarding to the left or right triangle.

These values are same in the SoftKey menu.

Reference

SFZSoftKeyControl::GetArrowBaseLength | SFZSoftKeyControl::SetArrowHeight | SFZSoftKeyControl::SetStyle | SFXEvent | Style Event[SFEVT_RESPONDER_STYLE]


SFZSoftKeyControl::SetArrowHeight
Set the height of the triangle label in the SoftKey menu with the "extention" style to the specified value. [pixels]
[ public ]
Void SetArrowHeight(
    SInt16 param   // value to set
);

Description

This function sets the height of the triangle label in the SoftKey menu with the "extention" style to the specified value. [pixels]

If the height of the base of the triangle is changed, the style event of SFXEvent(SFEVT_RESPONDER_STYLE, SFP16_STYLE_ALIGN, 0) will occur.

Default: 3 pixels.

[Note] Height of the triangle label in the SoftKey menu with the "extention" style

It represents the height regarding to the up or down triangle, and the width regarding to the left or right triangle.

These values are same in the SoftKey menu.

Reference

SFZSoftKeyControl::GetArrowHeight | SFZSoftKeyControl::SetArrowBaseLength | SFZSoftKeyControl::SetStyle | SFXEvent | Style Event[SFEVT_RESPONDER_STYLE]


SFZSoftKeyControl::SetBaseSpace
Set the space between the label and the border of this SoftKey control to the specified value. [pixels]
[ public ]
Void SetBaseSpace(
    SInt16 param   // value to set
);

Description

This function sets the space between the label and the border of this SoftKey control to the specified value. [pixels]

If the height of the base space is changed, the style event of SFXEvent(SFEVT_RESPONDER_STYLE, SFP16_STYLE_ALIGN, 0) will occur.

Default: 2 pixels

[Note] Note
The value of the space between the labels is same with this return value.

Reference

SFZSoftKeyControl::GetBaseSpace | SFXEvent | Style Event[SFEVT_RESPONDER_STYLE]


SFZSoftKeyControl::SetColorKey
Set the specified label of the specified SoftKey menu of this SoftKey control to the specified color key.
[ public ]
SFCError SetColorKey(
    UInt32 menuKey      // menu key (unique id)
    SoftkeyEnum index   // index of label
    UInt32 colorKey     // color key (unique id)
);
[ public ]
SFCError SetColorKey(
    UInt32 menuKey        // menu key (unique id)
    UInt32ConstPtr keys   // pointer to array of color keys
    UInt32 num            // number of labels
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If argument is invalid: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_INVALID_STATE

Description

This function sets a specified label of the specified SoftKey menu of this SoftKey control to the specified color key.

[Tip] Tip
The color keys can be set at a time using an array.
[Note] Default color key

If the color key of a SoftKey menu of this SoftKey control is not set with the SFZSoftKeyControl::SetColorKey function, the color key "0" will be referred to as the default color key.

The frame, foreground, and background colors of the color key "0" are initialized as follows:

  1. Frame color: SFXRGBColor(0xDD, 0xDD, 0xDD, 0x00)[light gray color]
  2. Foreground color: SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00)[white color]
  3. Background color: SFXRGBColor(0x77, 0x77, 0x77, 0x00)[gray color]

* In the default menu of the menu key "0", the color key "0" will be referred to by default.

[Note] Default menu

For more details on the default menu of the menu key "0", see the description of SFZSoftKeyControl.

Reference

SFZSoftKeyControl::GetColorKey SFZSoftKeyControl::RegisterForeColor | SFZSoftKeyControl::RegisterBackColor | SFZSoftKeyControl::RegisterFrameColor


SFZSoftKeyControl::SetDefaultBackColor
Set the default background color for label of this SoftKey control to the specified value.
[ public ]
Void SetDefaultBackColor(
    SFXRGBColorConstRef param   // value to set
);

Description

This function sets the default background color for label of this SoftKey control to the specified value, which will be used when the invalid color key is specified.

The background of label or the triangle when the cursor key is not pressed is filled in this color by default.

Default: SFXRGBColor(0x77, 0x77, 0x77, 0x00)[gray color]

[Note] Note
The background color of the color key "0", which is referred to by the default menu of the menu key "0", is initialized with SFXRGBColor(0x77, 0x77, 0x77, 0x00)[gray color].

Reference

SFZSoftKeyControl::GetDefaultBackColor


SFZSoftKeyControl::SetDefaultForeColor
Set the default foreground color for label of this SoftKey control to the specified value.
[ public ]
Void SetDefaultForeColor(
    SFXRGBColorConstRef param   // value to set
);

Description

This function sets the default foreground color for label of this SoftKey control to the specified value, which will be used when the invalid color key is specified.

The label text or the triangle when the cursor key is pressed is drawn in this color by default.

Default: SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00)[white color]

[Note] Note
The foreground color of the color key "0", which is referred to by the default menu of the menu key "0", is initialized with SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00)[white color].

Reference

SFZSoftKeyControl::GetDefaultForeColor


SFZSoftKeyControl::SetDefaultFrameColor
Set the default frame color for label of this SoftKey control to the specified value.
[ public ]
Void SetDefaultFrameColor(
    SFXRGBColorConstRef param   // value to set
);

Description

This function sets the default frame color for label of this SoftKey control to the specified value, which will be used when the invalid color key is specified.

Default: SFXRGBColor(0xDD, 0xDD, 0xDD, 0xDD)[light gray color]

[Note] Note
The frame color of the color key "0", which is referred to by the default menu of the menu key "0", is initialized with SFXRGBColor(0xDD, 0xDD, 0xDD, 0xDD)[light gray color].

Reference

SFZSoftKeyControl::GetDefaultFrameColor


SFZSoftKeyControl::SetEnable
Set the enable flag of the specified label of the specified menu of this SoftKey control to the specified value.
[ public ]
SFCError SetEnable(
    UInt32 menuKey      // menu key (unique id)
    SoftkeyEnum index   // index of label
    Bool enable         // enable state
);
[ public ]
SFCError SetEnable(
    UInt32 menuKey         // menu key (unique id)
    BoolConstPtr enables   // pointer to array of enable states
    UInt32 num             // number of labels
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If argument is invalid: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_INVALID_STATE

Description

This function sets the enable flag of the specified label of the specified menu of this SoftKey control to the specified value.

When the enable flag of the label for a cursor key is set to "true", if the key-press event of the cursor key occurs, the color of corresponding triangle will change from the background color to the foreground color.

Default: All ebable flags will be set to "true"(enable) immediately when the SoftKey menu is created with the SFZSoftKeyControl::CreateMenu function.

[Note] Undisplaying a label region

The enable flag of each label in the SoftKey menu is set to "true" by default. Therefore the label region will be displayed as it is.

To undisplay a label region, set its enable flag to "false" using the SFZSoftKeyControl::SetEnable function.

[Note] Note
The enable flags of the labels can be set at a time using an array.

Reference

SFZSoftKeyControl::GetEnable | SFZSoftKeyControl::CreateMenu


SFZSoftKeyControl::SetFont
Set the font of the label text of this SoftKey control to the specified value.
[ public ]
Void SetFont(
    AEEFont param   // value to set
);

Description

This function sets the font of the label text of this SoftKey control to the specified value.

If the font is changed, the style event of SFXEvent(SFEVT_RESPONDER_STYLE, SFP16_STYLE_FONT, 0) will occur.

Default: AEE_FONT_NORMAL

Reference

SFZSoftKeyControl::GetFont | SFXEvent | Style Event[SFEVT_RESPONDER_STYLE]


SFZSoftKeyControl::SetImageKey
Set the specified label of the specified SoftKey menu of this SoftKey control to the specified image key.
[ public ]
SFCError SetImageKey(
    UInt32 menuKey      // menu key (unique id)
    SoftkeyEnum index   // index of label
    UInt32 imageKey     // image key to set (unique id)
);
[ public ]
SFCError SetImageKey(
    UInt32 menuKey        // menu key (unique id)
    UInt32ConstPtr keys   // pointer to array of image keys
    UInt32 num            // number of labels
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If argument is invalid: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_INVALID_STATE

Description

This function sets the specified label of the specified SoftKey menu of this SoftKey control to the specified image key.

[Tip] Tip
The image keys can be set at a time using an array.
[Note] Default image key

If the image key of a SoftKey menu of this SoftKey control is not set with the SFZSoftKeyControl::SetImageKey function, the image key "0" will be referred to as the default image key.

The image of the image key "0" is initialized with SFBImageSmp::EmptyInstance().

* In the default menu of the menu key "0", the image key "0" will be referred to by default.

[Note] Default menu

For more details on the default menu of the menu key "0", see the description of SFZSoftKeyControl.

Reference

SFZSoftKeyControl::GetImageKey


SFZSoftKeyControl::SetLabelRectangle
Set the rectangular region of the specified label of this SoftKey control to the specified value.
[ protected ]
Void SetLabelRectangle(
    SoftkeyEnum index                // index of label
    SFXRectangleConstRef rectangle   // value to set
);

Description

This function sets the rectangular region of the specified label of this SoftKey control to the specified value.

[Note] Note
This function is called to recalculate the rectangular region of the label in such a case that the region of this control is changed.

Example

// handler called when the real region is changed
Void CustomSoftKeyControl::HandleBoundReal(Void)
{
    SFXRectangle local(GetLocalBound());
    SFXRectangle temp;
    SInt16 W(local.GetWidth());
    SInt16 H(local.GetHeight());
    SInt16 w, h;

    // in case of standard style
    if (GetStyle() == STANDARD) {
        w = (W - GetBaseSpace() * 4) / 3;
        h = (H - GetBaseSpace() * 2);
        temp = SFXRectangle(GetBaseSpace(), GetBaseSpace(), w, h);
        SetLabelRectangle(SOFTKEY_1, temp);
        SetLabelRectangle(SELECT, temp.Offset(w + GetBaseSpace(), 0));
        SetLabelRectangle(SOFTKEY_2, temp.Offset(w + GetBaseSpace(), 0));
    }
    // in case of extension style
    else {
        // ...
    }
    return;
}

Reference

SFZSoftKeyControl::SoftkeyEnum | SFZSoftKeyControl::GetLabelRectangle


SFZSoftKeyControl::SetStyle
Set the menu style of this SoftKey control to the specified value.
[ public ]
Void SetStyle(
    StyleEnum param   // value to set
);

Description

This function sets the menu style of this SoftKey control to the specified value.

The SoftKey menu with 3 labels called "standard style" or the one with 9 labels called "extension style" is available.

If the menu style is changed, the style event of SFXEvent(SFEVT_RESPONDER_STYLE, SFP16_STYLE_ALIGN, 0) will occur.

Default: SFZSoftKeyControl::DEFAULT_STYLE (standard style)

The style can be dynamically changed during the runtime of an applet.

Standard style:

Extension style:

Reference

SFZSoftKeyControl::GetStyle | SFZSoftKeyControl::StyleEnum | SFXEvent | Style Event[SFEVT_RESPONDER_STYLE]


SFZSoftKeyControl::SetTextKey
Set the specified label of the specified SoftKey menu of this SoftKey control to the specified text key.
[ public ]
SFCError SetTextKey(
    UInt32 menuKey      // menu key (unique id)
    SoftkeyEnum index   // index of label
    UInt32 textKey      // text key to set(unique id)
);
[ public ]
SFCError SetTextKey(
    UInt32 menuKey        // menu key (unique id)
    UInt32ConstPtr keys   // pointer to array of text keys
    UInt32 num            // number of labels
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If argument is invalid: SFERR_INVALID_PARAM
  • If insufficient memory: SFERR_NO_MEMORY
  • If failed: SFERR_INVALID_STATE

Description

This function sets the specified label of the specified SoftKey menu of this SoftKey control to the specified text key.

[Tip] Tip
The text keys can be set at a time using an array.
[Note] Default text key

If the text key of a SoftKey menu of this SoftKey control is not set with the SFZSoftKeyControl::SetTextKey function, the text key "0" will be referred to as the default text key.

The text of the text key "0" is initialized with SFXWideString::EmptyInstance().

* In the default menu of the menu key "0", the text key "0" will be referred to by default.

[Note] Default menu

For more details on the default menu of the menu key "0", see the description of SFZSoftKeyControl.

Reference

SFZSoftKeyControl::GetTextKey | SFZSoftKeyControl::RegisterText | SFZSoftKeyControl::RegisterTextRange


SFZSoftKeyControl::UnBind
Unbind the specified responder with the corresponding menu.
[ public ]
Void UnBind(
    SFYResponderPtr responder   // responder
);
[ public ]
Void UnBind(
    SFYResponderSmpConstRef responder   // responder
);

Description

This function unbinds the specified responder with the corresponding SoftKey menu.

[Note] Note
This function will be automatically called when the state of the responder bound using the SFZSoftKeyControl::Bind function becomes "invalid" or its destructor(SFZSoftKeyControl::~SFZSoftKeyControl) is called.

Reference

SFZSoftKeyControl::Bind | SFZSoftKeyControl::~SFZSoftKeyControl | State


SFZSoftKeyControl::UnregisterColor
Unregister the 3-Color associated with the specified color key from this SoftKey control.
[ public ]
Void UnregisterColor(
    UInt32 key   // color key (unique id)
);

Description

This function unregisters the 3-Color(frame color, foreground color, and background color) associated with the specified color key from this SoftKey control.

At this time, the 3-Color(frame color, foreground color, and background color) will be also released.

If the not existing color key is specified, nothing will happen.

If a SoftKey menu refers to the unregistered color key, the corresponding label will be drawn in the default color set with SFZSoftKeyControl::SetDefaultBackColor / SFZSoftKeyControl::SetDefaultForeColor / SFZSoftKeyControl::SetDefaultFrameColor functions.

Reference

SFZSoftKeyControl::RegisterFrameColor | SFZSoftKeyControl::RegisterForeColor | SFZSoftKeyControl::RegisterBackColor | SFZSoftKeyControl::SetDefaultBackColor | SFZSoftKeyControl::SetDefaultForeColor | SFZSoftKeyControl::SetDefaultFrameColor


SFZSoftKeyControl::UnregisterImage
Unregister the label image associated with the specified image key from this SoftKey control.
[ public ]
Void UnregisterImage(
    UInt32 key   // image key (unique id)
);

Description

This function unregisters the label image associated with the specified image key from this SoftKey control.

At this time, the label image will be also released.

If the not existing image key is specified, nothing will happen.

If a SoftKey menu refers to the unregistered image key, the corresponding label image will not be drawn.

Reference

SFZSoftKeyControl::RegisterImage


SFZSoftKeyControl::UnregisterText
Unregister the label text associated with the specified text key from this SoftKey control.
[ public ]
Void UnregisterText(
    UInt32 key   // text key (unique id)
);

Description

This function unregisters the label text associated with the specified text key from this SoftKey control.

At this time, the label text will be also released.

If the not existing text key is specified, nothing will happen.

If a SoftKey menu refers to the unregistered text key, the corresponding label text will not be drawn.

Reference

SFZSoftKeyControl::RegisterText


SFZSoftKeyControl::CodeEnum
Constant that represents the SFZSoftKeyControl class.
enum CodeEnum {
    CODE_TYPE = four_char_code('c', 's', 'k', 'e'),
};
SFMTYPEDEFTYPE(CodeEnum)

Reference

SFYResponder::GetType | SFYResponder::SetType |


SFZSoftKeyControl::KeyEnum
Constants that represent special key values.
enum KeyEnum {
    DEFAULT_KEY = 0,
    INVALID_KEY = UINT32_MAXIMUM
};
SFMTYPEDEFTYPE(KeyEnum)

Description

The menu whose key value is DEFAULT_KEY (= 0) is called "default menu".

After creating the SoftKey menu, all the element keys(text, image, 3 colors) is set to DEFAULT_KEY.

INVALID_KEY cannot be registered as a menu key nor an element key.

Reference

SFZSoftKeyControl::CreateMenu


SFZSoftKeyControl::SoftkeyEnum
Constants that are related with SoftKey.
enum SoftkeyEnum {
    SELECT = 0,                 // SELECT key
    SOFTKEY_1 = 1,              // SoftKey 1
    SOFTKEY_2 = 2,              // SoftKey 2
    SOFTKEY_3 = 3,              // SoftKey 3
    SOFTKEY_4 = 4,              // SoftKey 4
    UP = 5,                     // UP key
    DOWN = 6,                   // DOWN key
    LEFT = 7,                   // LEFT key
    RIGHT = 8,                  // RIGHT key
    SOFTKEY_LIMIT = 9           // upper limit of SoftKey(number of SoftKeys)
    STANDARD_LIMIT = 3,         // upper limit of SoftKey of standard style
    EXTENSION_LIMIT = 5         // upper limit of SoftKey of extension style
};
SFMTYPEDEFTYPE(SoftkeyEnum)

Description

These constants are used as label number.


SFZSoftKeyControl::StyleEnum
Constants that represent styles of SFZSoftKeyControl.
enum StyleEnum {
    STANDARD       = 0,        // standard style (3 labels)
    EXTENSION,                 // extension style (5 labels and 4 cursor labels)
    DEFAULT_STYLE  = STANDARD  // default
};
SFMTYPEDEFTYPE(StyleEnum)