PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFZGridMenu
Responder which represents a grid menu.
#include <SFZGridMenu.h.hpp>
class SFZGridMenu : public SFYMenu;
SFMTYPEDEFRESPONDER(SFZGridMenu)

Inheritance diagram

 Inheritance diagram of SFZGridMenuClass

Collaboration diagram

 Collaboration diagram of SFZGridMenuClass

Description

SFZGridMenu is a responder to create, control, update, and destroy a menu(grid menu) in matrix format.

Each cell of a grid menu has the same size, which is automatically set based on the size of real region and the number of rows and colums.

The design of a grid menu can be customized using its various APIs.

A text or an image can be set to grid menu's item.

To append an item, call the SFZGridMenu::AppendItem function. To delete an item, call the SFZGridMenu::RemoveItem function. When the SFZGridMenu::Clear function is called, all items will be removed.

The selection key is set with the SFYMenu::SetSelectUpKey / SFYMenu::SetSelectDownKey / SFYMenu::SetSelectRightKey / SFYMenu::SetSelectLeftKey functions. By default, selection keys are set to the UP key, the DOWN key, the RIGHT key, the LEFT key respectively.

In the default implementation, the grid menu[SFZGridMenu] will receive the following result events[SFEVT_RESPONDER_RESULT].

The developer can register handlers for these events.

If no handler is registered, the default handler will be booted up when one of the above result events is received. The default handler only closes the menu.

The operation key of the menu is set with the SFYMenu::SetOperateKey function. By default, the operation key is set to the SELECT key.

The access key is set with the SFZGridMenu::SetItemAccessKey function.

The ESCAPE key is set with the SFYMenu::SetEscapeKey function. By default, the ESCAPE key is set to the CLEAR key.

[Note] Note
The timer processing callback scheduled with the SFYMenu::ScheduleTimer function will be canceled automatically when the operation key of the menu or the ESCAPE key is pressed.

Reference: Result Event[SFEVT_RESPONDER_RESULT] | SFZGridMenu::HandleOperateKey | SFZGridMenu::HandleSelectUpKey | SFZGridMenu::HandleSelectDownKey | SFZGridMenu::HandleSelectRightKey | SFZGridMenu::HandleSelectLeftKey

The code to use a grid menu is as follows:

[Note] Note
To simplify the code, error handling is omitted here.
Void USRApplication::Main(Void)
{
     SFCError error;

     // create the window
     _window = SFZWindow::NewInstance();
     _window->SetParent(GetThis());
     _window->SetRealBound(GetLocalBound());
     _window->SetVirtualBound(SFXRectangle(_window->GetVirtualBound()).SetHeight(640));
     _window->SetState(true, true, true, true);
     _window->SetBackgroundColor(SFXRGBColor(0xDD, 0xFF, 0xDD, 0x00));

     // create grid menu
     SFZGridMenuSmp _gridmenu = SFZGridMenu::NewInstance(&error);

     // register the result handler which means that item is selected	
     _gridmenu->RegisterHandler(SFXEventRange(SFEVT_RESPONDER_RESULT, SFEVT_RESPONDER_RESULT, SFP16_BEGIN, SFP16_END), 
                               XANDLER_INTERNAL(OnGridMenu));

     _gridmenu->SetRealBound(GetLocalBound());
     _gridmenu->SetState(true, true, true, true);
     _gridmenu->SetParent(_window);
     _gridmenu->SetRowCol(4, 3);
     _gridmenu->SetTitle("Grid Menu");
     _gridmenu->SetTitleForeColor(SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00));
     _gridmenu->SetTitleBackColor(SFXRGBColor(0x00, 0xBF, 0xF3, 0x00));
     _gridmenu->SetBackgroundColor(SFXRGBColor(0x00, 0x00, 0x00, 0x00));
	 
     SFBShellSmp  shell;
     SFBImageSmp  image;
     SFBImageSmp  image1;

     shell = SFBShell::GetInstance();
     SInt16 i;

     for (i = 0; i < 12; ++i) {
          image = shell->LoadResImage(NEWWORLD_RES_FILE, IDI_OBJECT_5001 + i);
          image1 = shell->LoadResImage(MENU_RES_FILE, IDI_OBJECT_5001 + i);
          _gridmenu->AppendItem(SFXWideString::Format("%d", i), image, image1);
     }

     _gridmenu->ShowItemName(true);
		 
     return;
}

XANDLER_IMPLEMENT_VOIDRESULT(USRApplication, OnGridMenu, invoker, reason, result)
{
    // grid menu will be passed via invoker
    // P16 value of result event will be passed via reason

    switch (reason) {

        case SFP16_RESULT_OK:  // when the operation key is pressed

            // the index of the selected item will be passed via the result argument

            if (result == 0) {       // when 1st item is selected

                 ...

            }
            else if (result == 1) {  // when 2nd item is selected

                 ...

            }
            else if (result == 2) {  // when 3rd item is selected

                 ...

            }

            ...

            break;

        case SFP16_RESULT_ESCAPE:  // when the ESCAPE key is pressed or the time scheduled with ScheduleTimer() elapses

            // 0 will be passed via the result argument

            // close grid menu
            invoker->Terminate();  
            // or "_gridmenu->Terminate();"

            break;
    }

    return;
}

Execution result:

Reference

Grid Menu [SFZGridMenu] | SFYMenu | SFZTextMenu | SFZFlexListMenu

Members

Constructor/Destructor
SFZGridMenu( Void )
Constructor of the SFZGridMenu class.
~SFZGridMenu( Void )
Distructor of SFZGridMenu class.
Public Functions
SFCError AppendItem( SFXPathConstRef path , UInt16 textId )
[DEPRECATED]Append an item to this grid menu. Use the InsertLast() function.
SFCError AppendItem( SFXPathConstRef path , UInt16 textId , AVKType key )
[DEPRECATED]Append an item to this grid menu. Use the InsertLast() function.
SFCError AppendItem( SFXPathConstRef path , UInt16 textId , UInt16 imageId , UInt16 selImageId )
[DEPRECATED]Append an item to this grid menu. Use the InsertLast() function.
SFCError AppendItem( SFXPathConstRef path , UInt16 textId , UInt16 imageId , UInt16 selImageId , AVKType key )
[DEPRECATED]Append an item to this grid menu. Use the InsertLast() function.
SFCError AppendItem( SFXWideStringConstRef text )
[DEPRECATED]Append an item to this grid menu. Use the InsertLast() function.
SFCError AppendItem( SFXWideStringConstRef text , AVKType key )
[DEPRECATED]Append an item to this grid menu. Use the InsertLast() function.
SFCError AppendItem( SFXWideStringConstRef text , SFBImageSmpConstRef image , SFBImageSmpConstRef selectedImage )
[DEPRECATED]Append an item to this grid menu. Use the InsertLast() function.
SFCError AppendItem( SFXWideStringConstRef text , SFBImageSmpConstRef image , SFBImageSmpConstRef selectedImage , AVKType key )
[DEPRECATED]Append an item to this grid menu. Use the InsertLast() function.
Void Clear( Void )
Delete all items from this grid menu.
SInt16 GetColNumber( Void )
Get the number of columns of this grid menu.
SFXRGBColorConstRef GetDefaultItemBackColor( Void )
Get the default background color of unselected item of this grid menu.
SFXRGBColorConstRef GetDefaultItemForeColor( Void )
Get the default foreground color of unselected item of this grid menu.
AEEFont GetFont( Void )
Get the font of this grid menu.
AVKType GetItemAccessKey( SInt16 index )
Get the access key of the specified item of this grid menu.
SFXRGBColorConstRef GetItemBackColor( SInt16 index )
Get the background color of the specified unselected item of this grid menu.
SInt16 GetItemCount( Void )
Get the number of items of this grid menu.
SFXRGBColorConstRef GetItemForeColor( SInt16 index )
Get the foreground color of unselected item of this grid menu.
SFBImageSmpConstRef GetItemImage( SInt16 index )
Get the grid item image.
SFBImageSmpConstRef GetItemSelImage( SInt16 index )
Get the grid item selected image.
SFXWideStringConstRef GetItemText( SInt16 index )
Get the grid item text.
SInt16 GetPadding( Void )
Get the padding size of this grid menu.
SInt16 GetRowNumber( Void )
Get the number of rows of this grid menu.
SFXRGBColorConstRef GetSelBackColor( Void )
Get the background color of selected item of this grid menu.
SFXRGBColorConstRef GetSelBorderColor( Void )
Get the border color of currently selected item of this grid menu.
SFXRGBColorConstRef GetSelForeColor( Void )
Get the foreground color of selected item of this grid menu.
SInt16 GetSelect( Void )
Get the index of currently selected item of this grid menu.
SFXWideStringConstRef GetTitle( Void )
Get the menu title of this grid menu.
SFXRGBColorConstRef GetTitleBackColor( Void )
Get the background color of menu title of this grid menu.
SFXRGBColorConstRef GetTitleForeColor( Void )
Get the foreground color of menu title of this grid menu.
SInt16 GetTitleHeight( Void )
Get the height of menu title of this grid menu.
SFCError Insert( SInt32 index , SFXPathConstRef path , UInt16 textId )
Insert the specified item before the specified index.
SFCError Insert( SInt32 index , SFXPathConstRef path , UInt16 textId , AVKType key )
Insert the specified item before the specified index.
SFCError Insert( SInt32 index , SFXPathConstRef path , UInt16 textId , UInt16 imageId , UInt16 selImageId )
Insert the specified item before the specified index.
SFCError Insert( SInt32 index , SFXPathConstRef path , UInt16 textId , UInt16 imageId , UInt16 selImageId , AVKType key )
Insert the specified item before the specified index.
SFCError Insert( SInt32 index , SFXWideStringConstRef text )
Insert the specified item before the specified index.
SFCError Insert( SInt32 index , SFXWideStringConstRef text , AVKType key )
Insert the specified item before the specified index.
SFCError Insert( SInt32 index , SFXWideStringConstRef text , SFBImageSmpConstRef image , SFBImageSmpConstRef selectedImage )
Insert the specified item before the specified index.
SFCError Insert( SInt32 index , SFXWideStringConstRef text , SFBImageSmpConstRef image , SFBImageSmpConstRef selectedImage , AVKType key )
Insert the specified item before the specified index.
SFCError InsertFirst( SFXPathConstRef path , UInt16 textId )
Insert the specified item at the head.
SFCError InsertFirst( SFXPathConstRef path , UInt16 textId , AVKType key )
Insert the specified item at the head.
SFCError InsertFirst( SFXPathConstRef path , UInt16 textId , UInt16 imageId , UInt16 selImageId )
Insert the specified item at the head.
SFCError InsertFirst( SFXPathConstRef path , UInt16 textId , UInt16 imageId , UInt16 selImageId , AVKType key )
Insert the specified item at the head.
SFCError InsertFirst( SFXWideStringConstRef text )
Insert the specified item at the head.
SFCError InsertFirst( SFXWideStringConstRef text , AVKType key )
Insert the specified item at the head.
SFCError InsertFirst( SFXWideStringConstRef text , SFBImageSmpConstRef image , SFBImageSmpConstRef selectedImage )
Insert the specified item at the head.
SFCError InsertFirst( SFXWideStringConstRef text , SFBImageSmpConstRef image , SFBImageSmpConstRef selectedImage , AVKType key )
Insert the specified item at the head.
SFCError InsertLast( SFXPathConstRef path , UInt16 textId )
Insert the specified item at the tail.
SFCError InsertLast( SFXPathConstRef path , UInt16 textId , AVKType key )
Insert the specified item at the tail.
SFCError InsertLast( SFXPathConstRef path , UInt16 textId , UInt16 imageId , UInt16 selImageId )
Insert the specified item at the tail.
SFCError InsertLast( SFXPathConstRef path , UInt16 textId , UInt16 imageId , UInt16 selImageId , AVKType key )
Insert the specified item at the tail.
SFCError InsertLast( SFXWideStringConstRef text )
Insert the specified item at the tail.
SFCError InsertLast( SFXWideStringConstRef text , AVKType key )
Insert the specified item at the tail.
SFCError InsertLast( SFXWideStringConstRef text , SFBImageSmpConstRef image , SFBImageSmpConstRef selectedImage )
Insert the specified item at the tail.
SFCError InsertLast( SFXWideStringConstRef text , SFBImageSmpConstRef image , SFBImageSmpConstRef selectedImage , AVKType key )
Insert the specified item at the tail.
static
SFZGridMenuSmp
NewInstance( SFCErrorPtr exception = null )
Create a new instance of this responder class.
Void Remove( SInt32 index )
Remove specified items from this grid menu.
Void Remove( SInt32 begin , SInt32 end )
Remove specified items from this grid menu.
Void RemoveFirst( Void )
Remove the first item from this grid menu.
Void RemoveItem( SInt16 index )
[DEPRECATED]Remove the specified item from this grid menu. Use the Remove() function.
Void RemoveLast( Void )
Remove the last item from this grid menu.
Void SetDefaultItemBackColor( SFXRGBColorConstRef param )
Set the default background color of unselected item of this grid menu to the specified value.
Void SetDefaultItemForeColor( SFXRGBColorConstRef param )
Set the default foreground color of unselected item of this grid menu to the specified value.
Void SetDrawItemText( Bool param )
Set the "draw-item" flag indicating whether or not to draw the text of item of this grid menu to the specified value.
Void SetDrawSelBorder( Bool param )
Set the "draw-border" flag indicating whether or not to draw the border of selected item of this grid menu to the specified value.
Void SetFont( AEEFont param )
Set the font of this grid menu to the specified value.
SFCError SetItemAccessKey( SInt16 index , AVKType key )
Set the access key of the specified item of this grid menu to the specified value.
SFCError SetItemBackColor( SInt16 index , SFXRGBColorConstRef param )
Set the background color of the specified unselected item of this grid menu to the specified value.
SFCError SetItemForeColor( SInt16 index , SFXRGBColorConstRef param )
Set the foreground color of the specified unselected item of this grid menu to the specified value.
SFCError SetItemImage( SInt16 index , SFXPathConstRef path )
Set the image of the specified grid item to the specified value.
SFCError SetItemImage( SInt16 index , SFXPathConstRef path , UInt16 id )
Set the image of the specified grid item to the specified value.
SFCError SetItemImage( SInt16 index , SFBImageSmpConstRef param )
Set the image of the specified grid item to the specified value.
SFCError SetItemSelImage( SInt16 index , SFXPathConstRef path )
Set the image of the specified selected grid item to the specified value.
SFCError SetItemSelImage( SInt16 index , SFXPathConstRef path , UInt16 id )
Set the image of the specified selected grid item to the specified value.
SFCError SetItemSelImage( SInt16 index , SFBImageSmpConstRef param )
Set the image of the specified selected grid item to the specified value.
SFCError SetItemText( SInt16 index , SFXPathConstRef path , UInt16 id )
Set the text of the specified grid item to the specified value.
SFCError SetItemText( SInt16 index , SFXWideStringConstRef param )
Set the text of the specified grid item to the specified value.
Void SetPadding( SInt16 param )
Set the padding size of this grid menu to the specified value. [pixels]
Void SetRowCol( SInt16 row , SInt16 col )
Set the numbers of rows and columns of this grid menu to specified values.
Void SetSelBackColor( SFXRGBColorConstRef param )
Set the background color of selected item of this grid menu to the specified value.
Void SetSelBorderColor( SFXRGBColorConstRef param )
Set the border color of currently selected item of this grid menu to the specified value.
Void SetSelForeColor( SFXRGBColorConstRef param )
Set the foreground color of selected item of this grid menu to the specified value.
Void SetSelect( SInt16 param )
Set the index of currently selected item of this grid menu to the specified value.
SFCError SetTitle( SFXPathConstRef path , UInt16 id )
Set the menu title of this grid menu to the specified value.
SFCError SetTitle( SFXWideStringConstRef param )
Set the menu title of this grid menu to the specified value.
Void SetTitleBackColor( SFXRGBColorConstRef param )
Set the background color of menu title of this grid menu to the specified value.
Void SetTitleForeColor( SFXRGBColorConstRef param )
Set the foreground color of menu title of this grid menu to the specified value.
Void SetTitleHeight( SInt16 param )
Set the height of menu title of this grid menu to the specified value. [pixels]
Void CancelTimer( Void ) (inherits from SFYMenu)
Cancel the timer of this menu.
Void ClearHandler( Void ) (inherits from SFYResponder)
Unregister all handlers from this responder.
Void ClearTracer( Void ) (inherits from SFYResponder)
Unregister all dispatching rules from the tracer of this responder.
SFCError Distribute( SFXEventConstRef event , BoolPtr result = null ) (inherits from SFYResponder)
Distribute the specified event.
SFXRGBColorConstRef GetBackgroundColor( Void ) (inherits from SFYWidget)
Get the background color.
SFYResponderSmp GetChildBack( Void ) (inherits from SFYResponder)
Get the backmost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildBack( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the backmost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildBack( UInt32 id ) (inherits from SFYResponder)
Get the backmost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the backmost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side, which matches the specified search condition.
SFYResponderSmp GetChildBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side, which matches the specified search condition.
SInt32 GetChildCount( Void ) (inherits from SFYResponder)
Get the number of child responders of this responder, which match the specified search condition.
SInt32 GetChildCount( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the number of child responders of this responder, which match the specified search condition.
SInt32 GetChildCount( UInt32 id ) (inherits from SFYResponder)
Get the number of child responders of this responder, which match the specified search condition.
SInt32 GetChildCount( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the number of child responders of this responder, which match the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side, which matches the specified search condition.
SFYResponderSmp GetChildFront( Void ) (inherits from SFYResponder)
Get the foremost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildFront( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the foremost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildFront( UInt32 id ) (inherits from SFYResponder)
Get the foremost child responder of this responder, which matches the specified search condition.
SFYResponderSmp GetChildFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the foremost child responder of this responder, which matches the specified search condition.
SFYDistributerPtr GetDistributer( Void ) (inherits from SFYResponder)
Get the distributer bound with this responder.
AVKType GetEscapeKey( Void ) (inherits from SFYMenu)
Get the ESCAPE key of this menu.
SFYResponderSmp GetFrame( Void ) (inherits from SFYResponder)
Get the frame which has been attached to this responder.
SFXRectangle GetGlobalBound( Void ) (inherits from SFYResponder)
Get the globle region of this responder.
UInt32 GetID( Void ) (inherits from SFYResponder)
Get the ID of this responder instance.
SFXRectangle GetLocalBound( Void ) (inherits from SFYResponder)
Get the local region of this responder.
SInt32 GetNthBackward( Void ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthBackward( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthBackward( UInt32 id ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthBackward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( Void ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( UInt32 id ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
AVKType GetOperateKey( Void ) (inherits from SFYMenu)
Get the operation key of this menu.
SFYResponderSmp GetParent( Void ) (inherits from SFYResponder)
Get the parent responder of this responder.
Bool GetPropertyTransparent( Void ) (inherits from SFYResponder)
Get the transparency attribute of this responder.
SFXRectangleConstRef GetRealBound( Void ) (inherits from SFYResponder)
Get the real region of this responder.
VoidPtr GetReference( Void ) (inherits from SFYResponder)
Get the reference of this responder.
SFYRendererPtr GetRenderer( Void ) (inherits from SFYResponder)
Get the renderer bound with this responder.
SFYResponderSmp GetRoot( Void ) (inherits from SFYResponder)
Get the root responder.
AVKType GetSelectDownKey( Void ) (inherits from SFYMenu)
Get the DOWN key of this menu.
AVKType GetSelectLeftKey( Void ) (inherits from SFYMenu)
Get the LEFT key of this menu.
AVKType GetSelectRightKey( Void ) (inherits from SFYMenu)
Get the RIGHT key of this menu.
AVKType GetSelectUpKey( Void ) (inherits from SFYMenu)
Get the UP key of this menu.
Bool GetStateActive( Bool inherit = false ) (inherits from SFYResponder)
Get the active state of this responder.
Bool GetStateEnable( Bool inherit = false ) (inherits from SFYResponder)
Get the enable state of this responder.
Bool GetStateFocus( Bool inherit = false ) (inherits from SFYResponder)
Get the focus state of this responder.
Bool GetStateValid( Bool inherit = false ) (inherits from SFYResponder)
Get the valid state of this responder.
Bool GetStateVisible( Bool inherit = false ) (inherits from SFYResponder)
Get the visible state of this responder.
SFXRectangle GetSuitableBound( Void ) (inherits from SFYResponder)
Get the suitable region of this responder.
SFXRectangle GetSuitableBound( SFXRectangleConstRef rectangle ) (inherits from SFYResponder)
Get the suitable region of this responder.
SFXRectangle GetSuitableBound( SFXRectangleConstRef param , HorizontalEnum horizontal , VerticalEnum vertical ) (inherits from SFYResponder)
Get the suitable region of this responder.
SFXMargin GetSuitableMargin( Void ) (inherits from SFYResponder)
Get the suitable frame margin region of this responder.
SFCType GetType( Void ) (inherits from SFYResponder)
Get the type of this responder class.
SFXRectangleConstRef GetVirtualBound( Void ) (inherits from SFYResponder)
Get the virtual region of this responder.
Bool HasFrame( Void ) (inherits from SFYResponder)
Check whether or not this responder is a content-responder.
Void Initialize( Void ) (inherits from SFYResponder)
Initialize this responder.
Bool IsBack( Void ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsBack( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsBack( UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsFrame( Void ) (inherits from SFYResponder)
Check whether or not this responder is an attachment-frame.
Bool IsFront( Void ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsFront( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsFront( UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsRoot( Void ) (inherits from SFYResponder)
Check whether or not this responder is the root responder.
SFCError Recover( Void ) (inherits from SFYResponder)
Recover the intersection region between this responder and the responder space by using the saved bitmap to restore the device bitmap.
SFCError RegisterHandler( SFXEventRangeConstRef range , SFYHandler::RuleRecConstRef rule ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterTracer( SFXEventRangeConstRef range , SFYTracer::RuleRecConstRef rule ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError RegisterTracer( SFXEventRangeConstRef range , SFYTracer::OrderEnum order , SFYTracer::StateEnum state , Bool overload ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::RuleRecConstPtr rule , SInt32 length ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::OrderEnumConstPtr order , SFYTracer::StateEnumConstPtr state , BoolConstPtr overload , SInt32 length ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError Render( Bool force = false ) (inherits from SFYResponder)
Boot up the renderer for redrawing this responder and its descendant responders.
Void RewindTimer( Void ) (inherits from SFYMenu)
Reset the time until this menu is automatically closed.
Void ScheduleTimer( UInt32 param ) (inherits from SFYMenu)
Schedule the timer that HandleEscapeKey() will be called after the specified time elapses. [milliseconds]
Void SetBackgroundColor( SFXRGBColorConstRef param ) (inherits from SFYWidget)
Set the background color to the specified value.
Void SetDistributer( SFYDistributerPtr param ) (inherits from SFYResponder)
Bind this responder with the specified distributer.
Void SetEscapeKey( AVKType param ) (inherits from SFYMenu)
Set the ESCAPE key of this menu to the specified value.
SFCError SetFrame( SFYResponderSmpConstRef param ) (inherits from SFYResponder)
Attach the specified frame to this frame.
Void SetID( UInt32 param ) (inherits from SFYResponder)
Set the ID value of this responder to the specified value.
Void SetOperateKey( AVKType param ) (inherits from SFYMenu)
Set the operation key of this menu to the specified value.
SFCError SetParent( SFYResponderSmpConstRef param ) (inherits from SFYResponder)
Set the parent responder of this responder to the specified responder.
Void SetProperty( Bool transparent ) (inherits from SFYResponder)
Set the property of this responder to the specified value.
Void SetPropertyTransparent( Bool param ) (inherits from SFYResponder)
Set the transparency attribute of this responder to the specified value.
Void SetRealBound( SFXRectangleConstRef param ) (inherits from SFYResponder)
Set the real region of this responder to the specified region.
Void SetReference( VoidPtr param ) (inherits from SFYResponder)
Set the reference value of this responder to the specified value.
Void SetRenderer( SFYRendererPtr param ) (inherits from SFYResponder)
Bind this responder with the specified renderer.
Void SetSelectDownKey( AVKType param ) (inherits from SFYMenu)
Set the DOWN key of this menu to the specified value.
Void SetSelectLeftKey( AVKType param ) (inherits from SFYMenu)
Set the LEFT key of this menu to the specified value.
Void SetSelectRightKey( AVKType param ) (inherits from SFYMenu)
Set the RIGHT key of this menu to the specified value.
Void SetSelectUpKey( AVKType param ) (inherits from SFYMenu)
Set the UP key of this menu to the specified value.
Void SetState( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Set all states of this responder to specified values together.
Void SetStateActive( Bool param ) (inherits from SFYResponder)
Set the active state of this responder to the specified value.
Void SetStateEnable( Bool param ) (inherits from SFYResponder)
Set the enable state of this responder to the specified value.
Void SetStateFocus( Bool param ) (inherits from SFYResponder)
Set the focus state of this responder to the specified value.
Void SetStateVisible( Bool param ) (inherits from SFYResponder)
Set the visible state of this responder to the specified value.
Void SetVirtualBound( SFXRectangleConstRef param ) (inherits from SFYResponder)
Set the virtual region of this responder to the specified value.
SFCError Snapshot( SFBBitmapSmpConstRef bitmap ) (inherits from SFYResponder)
Get a snapshot image of the intersection region between this responder and the responder space by using the saved bitmap.
Void Terminate( Void ) (inherits from SFYResponder)
Terminate this responder.
Void ToBack( Void ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToBack( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToBack( UInt32 id ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToFront( Void ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToFront( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToFront( UInt32 id ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void UnregisterHandler( SFXEventRangeConstRef range , SFYHandler::RuleRecConstRef rule ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterTracer( SFXEventRangeConstRef range ) (inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
Void UnregisterTracer( SFXEventRangeConstPtr range , SInt32 length ) (inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
T const & static_catch( Void ) (inherits from static_exception)
Get the current exception.
Protected Functions
Void 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 HandleOperateKey( Void )
This function will be called when the SFEVT_KEY event of the operation key is received.
Void HandleRenderRequest( SFXGraphicsPtr graphics )
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received. [Draw this grid menu.]
Void HandleSelectDownKey( Void )
This function will be called when the DOWN key is pressed.
Void HandleSelectLeftKey( Void )
This function will be called when the LEFT key is pressed.
Void HandleSelectRightKey( Void )
This function will be called when the RIGHT key is pressed.
Void HandleSelectUpKey( Void )
This function will be called when the UP key is pressed.
static
SFYResponderSmp
Factory( SFYResponderPtr responder , SFCErrorPtr exception = null ) (inherits from SFYResponder)
This function is used to implement the NewInstance function.
SFYResponderSmp GetThis( Void ) (inherits from SFYResponder)
Get the smart pointer of this responder.
Void HandleBoundGlobal( SFXRectangleConstRef rectangle ) (inherits from SFYWidget)
This function will be called when the global region is changed.
Void HandleBoundOptimize( SFXRectanglePtr rectangle ) (inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE) event is received. [Calculate the suitable rectangle size of this responder within the specified hint rectangle.]
Void HandleBoundReal( Void ) (inherits from SFYMenu)
This function will be called when the real region is changed.
Void HandleBoundRequest( SFXRectanglePtr rectangle ) (inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event is received. [Calculate the suitable rectangle size of this responder.]
Void HandleEscapeKey( Void ) (inherits from SFYMenu)
This function will be called when the SFEVT_KEY event of the ESCAPE key is received or the time scheduled by ScheduleTimer() elapses.
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 SFZGridMenu class.
HorizontalEnum (inherits from SFYResponder)
Constants that represent the horizontal alignment.
VerticalEnum (inherits from SFYResponder)
Constants that represent the vertical alignment.

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

Description

This constructor performs the initializations as follows:

  1. Set the type of this responder to "mgmn".
  2. Set the font to AEE_FONT_NORMAL.
  3. Set the background color of the title to SFXRGBColor(0xDD, 0xDD, 0xDD, 0x00)[gray color].
  4. Set the foreground color of the title to SFXRGBColor(0x00, 0x00, 0x00, 0x00)[black color].
  5. Set the default background color of unselected item to SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00)[white color].
  6. Set the default foreground color of unselected item to SFXRGBColor(0x00, 0x00, 0x00, 0x00)[black color].
  7. Set the background color of selected item to SFXRGBColor(0x11, 0x22, 0xBB, 0x00)[blue color].
  8. Set the foreground color of selected item to SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00)[white color].
  9. Set the border color of currently selected item to SFXRGBColor(0x11, 0x22, 0xBB, 0x00)[blue color].
  10. Set the title to ""[null string].
  11. Set the height of the title to "font height + 4".
  12. Set the numbers of rows and columns to 4 and 3 respectively.
  13. Set the padding size of this grid menu to 0.
  14. Set the item of the index 0 to be selected.
  15. Set the item text to be drawn.
  16. Set the border of currently selected item to be drawn.
  17. Register the event handler in the table below into this responder.

Table 231. Event handler

Event Content of the handler
SFEVT_KEY event of the access key set with SFZGridMenu::SetItemAccessKey Call the SFYMenu::HandleOperateKey function.
[Note] Note
In a responder inheriting from SFZGridMenu the corresponding handler will be called when the above event occurs.

Reference

SFYResponder::SetType | SFZGridMenu::CodeEnum | SFZGridMenu::SetFont | SFZGridMenu::SetTitleBackColor | SFZGridMenu::SetTitleForeColor | SFZGridMenu::SetDefaultItemBackColor | SFZGridMenu::SetDefaultItemForeColor | SFZGridMenu::SetSelBackColor | SFZGridMenu::SetSelForeColor | SFZGridMenu::SetSelBorderColor | SFZGridMenu::SetTitle | SFZGridMenu::SetTitleHeight | SFZGridMenu::SetSelect | SFZGridMenu::SetRowCol | SFZGridMenu::SetPadding | SFZGridMenu::SetDrawItemText | SFZGridMenu::SetDrawSelBorder | SFZGridMenu::SetItemAccessKey | SFYMenu::HandleOperateKey | SFXRGBColor | Type | Event | Key Event[SFEVT_KEY]


SFZGridMenu::~SFZGridMenu
Distructor of SFZGridMenu class.
[ protected, virtual ]
virtual ~SFZGridMenu(Void);

Description

Delete all items from this grid menu.

Reference

SFZGridMenu::Clear


SFZGridMenu::AppendItem
[DEPRECATED]Append an item to this grid menu. Use the InsertLast() function.
[ public ]
SFCError AppendItem(
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
);
[ public ]
SFCError AppendItem(
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
    AVKType key            // access key
);
[ public ]
SFCError AppendItem(
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
    UInt16 imageId         // text object id
    UInt16 selImageId      // image object id when selected
);
[ public ]
SFCError AppendItem(
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
    UInt16 imageId         // text object id
    UInt16 selImageId      // image object id when selected
    AVKType key            // access key
);
[ public ]
SFCError AppendItem(
    SFXWideStringConstRef text   // text
);
[ public ]
SFCError AppendItem(
    SFXWideStringConstRef text   // text
    AVKType key                  // access key
);
[ public ]
SFCError AppendItem(
    SFXWideStringConstRef text          // text
    SFBImageSmpConstRef image           // image
    SFBImageSmpConstRef selectedImage   // image when selected
);
[ public ]
SFCError AppendItem(
    SFXWideStringConstRef text          // text
    SFBImageSmpConstRef image           // image
    SFBImageSmpConstRef selectedImage   // image when selected
    AVKType key                         // access key
);

Description

This function appends an item to this grid menu. The appended item becomes the last item of this grid menu.

[Caution] Caution
Since this function is deprecated, use the SFZGridMenu::InsertLast function instead.

Reference

SFZGridMenu::InsertLast | SFZGridMenu::RemoveItem SFZGridMenu::Clear


SFZGridMenu::Clear
Delete all items from this grid menu.
[ public ]
Void Clear(Void);

Description

This function deletes all items from this grid menu.

Reference

SFZGridMenu::AppendItem | SFZGridMenu::RemoveItem


SFZGridMenu::GetColNumber
Get the number of columns of this grid menu.
[ public, const ]
SInt16 GetColNumber(Void);

Return value

Number of columns.

Reference

SFZGridMenu::SetRowCol | SFZGridMenu::GetRowNumber


SFZGridMenu::GetDefaultItemBackColor
Get the default background color of unselected item of this grid menu.
[ public, const ]
SFXRGBColorConstRef GetDefaultItemBackColor(Void);

Description

This function gets the default background color(SFXRGBColor) of unselected item of this grid menu.

Reference

SFZGridMenu::SetDefaultItemBackColor


SFZGridMenu::GetDefaultItemForeColor
Get the default foreground color of unselected item of this grid menu.
[ public, const ]
SFXRGBColorConstRef GetDefaultItemForeColor(Void);

Description

This function gets the default foreground color(SFXRGBColor) to draw the text of unselected item of this grid menu.

Reference

SFZGridMenu::SetDefaultItemForeColor


SFZGridMenu::GetFont
Get the font of this grid menu.
[ public, const ]
AEEFont GetFont(Void);

Description

This function gets the font to draw the item and the title of this grid menu.

Reference

SFZGridMenu::SetFont


SFZGridMenu::GetItemAccessKey
Get the access key of the specified item of this grid menu.
[ public, const ]
AVKType GetItemAccessKey(
    SInt16 index   // 
);

Description

This function gets the access key of the specified item of this grid menu. AVK_UNDEFINED will be returned if the access key is not set. *** Description ***

Reference

SFZGridMenu::SetItemAccessKey


SFZGridMenu::GetItemBackColor
Get the background color of the specified unselected item of this grid menu.
[ public, const ]
SFXRGBColorConstRef GetItemBackColor(
    SInt16 index   // index of item
);

Description

This function gets the background color(SFXRGBColor) of unselected item of this grid menu.

Reference

SFZGridMenu::SetItemBackColor | SFXRGBColor


SFZGridMenu::GetItemCount
Get the number of items of this grid menu.
[ public, const ]
SInt16 GetItemCount(Void);

Description

This function gets the number of items of this grid menu.

Reference

SFZGridMenu::AppendItem | SFZGridMenu::RemoveItem


SFZGridMenu::GetItemForeColor
Get the foreground color of unselected item of this grid menu.
[ public, const ]
SFXRGBColorConstRef GetItemForeColor(
    SInt16 index   // index of item
);

Description

This function gets the foreground color(SFXRGBColor) to draw the text of unselected item of this grid menu.

Reference

SFZGridMenu::SetItemForeColor | SFXRGBColor


SFZGridMenu::GetItemImage
Get the grid item image.
[ public, const ]
SFBImageSmpConstRef GetItemImage(
    SInt16 index   // index of item
);

Return value

Pointer to the image (SFBImageSmp) of the grid item. This image is displayed when the item is not selected.

Reference

SFZGridMenu::SetItemImage


SFZGridMenu::GetItemSelImage
Get the grid item selected image.
[ public, const ]
SFBImageSmpConstRef GetItemSelImage(
    SInt16 index   // index of item
);

Return value

Pointer to the image (SFBImageSmp) which is displayed when the item is selected of the grid item.

Reference

SFZGridMenu::SetItemSelImage


SFZGridMenu::GetItemText
Get the grid item text.
[ public, const ]
SFXWideStringConstRef GetItemText(
    SInt16 index   // index of item
);

Return value

Text (SFXWideString) of the grid item.

Reference

SFZGridMenu::SetTitleBackColor


SFZGridMenu::GetPadding
Get the padding size of this grid menu.
[ public, const ]
SInt16 GetPadding(Void);

Return value

Amount of space (padding) between two neighbouring items of this grid menu.

Description

This function gets the padding size of this grid menu.

This padding region is filled in the background color of this grid menu set with the SFYWidget::SetBackgroundColor function.

Reference

SFZGridMenu::SetPadding | SFYWidget::SetBackgroundColor


SFZGridMenu::GetRowNumber
Get the number of rows of this grid menu.
[ public, const ]
SInt16 GetRowNumber(Void);

Return value

Number of rows.

Reference

SFZGridMenu::SetRowCol SFZGridMenu::GetColNumber


SFZGridMenu::GetSelBackColor
Get the background color of selected item of this grid menu.
[ public, const ]
SFXRGBColorConstRef GetSelBackColor(Void);

Return value

Background color(SFXRGBColor) of selected item of this grid menu.

Description

This function gets the background color(SFXRGBColor) of selected item of this grid menu.

Reference

SFZGridMenu::SetSelBackColor


SFZGridMenu::GetSelBorderColor
Get the border color of currently selected item of this grid menu.
[ public, const ]
SFXRGBColorConstRef GetSelBorderColor(Void);

Return value

Color (SFXRGBColor) to draw the border of currently selected grid item.

Description

This function gets the border color of currently selected item of this grid menu.

Reference

SFZGridMenu::SetSelBorderColor


SFZGridMenu::GetSelForeColor
Get the foreground color of selected item of this grid menu.
[ public, const ]
SFXRGBColorConstRef GetSelForeColor(Void);

Description

This function gets the background color(SFXRGBColor) of selected item of this grid menu.

Reference

SFZGridMenu::SetTitleBackColor


SFZGridMenu::GetSelect
Get the index of currently selected item of this grid menu.
[ public, const ]
SInt16 GetSelect(Void);

Return value

Index of selected item.

Description

This function gets the index of currently selected item of this grid menu.

Reference

SFZGridMenu::SetSelect


SFZGridMenu::GetTitle
Get the menu title of this grid menu.
[ public, const ]
SFXWideStringConstRef GetTitle(Void);

Description

This function gets the menu title of this grid menu.

Reference

SFZGridMenu::SetTitle


SFZGridMenu::GetTitleBackColor
Get the background color of menu title of this grid menu.
[ public, const ]
SFXRGBColorConstRef GetTitleBackColor(Void);

Return value

Background color (SFXRGBColor) to fill the rectangle containing the menu title.

Description

This function gets the background color(SFXRGBColor) of menu title of this grid menu, in which the rectangle containing the menu title is filled.

Reference

SFZGridMenu::SetTitleBackColor | SFXRGBColor


SFZGridMenu::GetTitleForeColor
Get the foreground color of menu title of this grid menu.
[ public, const ]
SFXRGBColorConstRef GetTitleForeColor(Void);

Return value

Foreground color (SFXRGBColor) to draw the menu title.

Description

This function gets the foreground color(SFXRGBColor) of menu title of this grid menu, in which the menu title is drawn.

Reference

SFZGridMenu::SetTitleForeColor | SFXRGBColor


SFZGridMenu::GetTitleHeight
Get the height of menu title of this grid menu.
[ public, const ]
SInt16 GetTitleHeight(Void);

Return value

Height of the menu title.

Description

This function gets the height of menu title of this grid menu.

Reference

SFZGridMenu::SetTitleHeight


SFZGridMenu::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 SFZGridMenu::HandleBoundVirtual function is as follows:

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

Reference

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


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

Description

This function will be called when the SFEVT_KEY event(key event[SFEVT_KEY]) of the operaion key set with the SFYMenu::SetOperateKey function is received.

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

The default implementation is to send the result event of SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_OK, index of item).

Internal Implementation

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

/*protected virtual */Void SFZGridMenu::HandleOperateKey(Void)
{
    InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_OK, GetSelect()), false);
    return;
}// SFZGridMenu::HandleOperateKey //

Reference

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


SFZGridMenu::HandleRenderRequest
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received. [Draw this grid menu.]
[ protected, virtual, const ]
Void HandleRenderRequest(
    SFXGraphicsPtr graphics   // graphic 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 grid menu.

[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 SFZGridMenu::HandleRenderRequest function is as follows:

/*protected virtual */Void SFZGridMenu::HandleRenderRequest(SFXGraphicsPtr graphics) const
{
    DrawMenu(graphics);
    return;
}// SFZGridMenu::HandleRenderRequest //

/*private */Void SFZGridMenu::DrawMenu(SFXGraphicsPtr graphics) const
{
    MenuItemPtr                                 item;
    SFXRectangle                                menuRect;
    SFXRectangle                                titleRect;
    SFXRectangle                                itemRect;
    SFXGrid                                     firstItemOffset;
    SInt32                                      row;
    SInt32                                      col;

    menuRect = GetLocalBound();
    titleRect = menuRect;
    titleRect.SetHeight(_titleHeight);
    menuRect.AddTop(_titleHeight);
    itemRect = menuRect;
    graphics->FillRectangle(titleRect, _color.titleBack);
    graphics->SetFont(_font);
    graphics->DrawSingleText(_title, titleRect.GetOrigin() + SFXGrid(2, 2), titleRect, _color.titleFore);
    if (_rownum == 0 || _colnum == 0) {
        return;
    }
    itemRect.SetSize(
        static_cast<SInt16>((menuRect.GetWidth() - (_colnum + 1) * _padding) / _colnum),
        static_cast<SInt16>((menuRect.GetHeight() - (_rownum + 1) * _padding) / _rownum)
    );
    firstItemOffset.Set(_padding + menuRect.GetX(), _padding + menuRect.GetY());
    itemRect.SetOrigin(firstItemOffset);
    for (row = 0; row < _rownum; ++row) {
        for (col = 0; col < _colnum; ++col) {
            if ((item = GetMenuItem(ToIndex(row, col))) == null) {
                break;
            }
            DrawItem(graphics, itemRect, item);
            itemRect.AddX(itemRect.GetWidth() + _padding);
        }
        itemRect.SnapLeft(firstItemOffset.GetX());
        itemRect.AddY(itemRect.GetHeight() + _padding);
    }
    return;
}// SFZGridMenu::DrawMenu //

/*private */Void SFZGridMenu::DrawItem(SFXGraphicsPtr graphics, SFXRectangleConstRef rect, MenuItemPtr item) const
{
    SFBImageSmp                                 image(item->image);
    SFXRectangle                                imageRect(rect);
    SFXRectangle                                textRect;
    SInt16                                      textHeight;
    SFXRGBColor                                 backColor(item->backColor);
    SFXRGBColor                                 foreColor(item->foreColor);

    if (item == GetMenuItem(_selectedItem)) {
        backColor.Set(_color.selBack);
        foreColor.Set(_color.selFore);
        image = item->selectedImage;
        if (_selBorder) {
            graphics->DrawRectangle(imageRect, _color.selBorder);
            imageRect.Deflate(1, 1);
            graphics->DrawRectangle(imageRect, _color.selBorder);
            imageRect.Deflate(1, 1);
        }
    }
    graphics->FillRectangle(imageRect, backColor);
    textRect = imageRect;
    if ((_drawText) && (item->text !="")) {
        textHeight = SFXGraphics::GetFontHeight(_font);
    }
    else {
        textHeight = 0;
    }
    if (image != null) {
        imageRect.SetHeight(imageRect.GetHeight() - textHeight);
        textRect.AddTop(imageRect.GetHeight());
    }
    if (image != null) {
        AEEImageInfo  info;
 SInt16 dx;
 SInt16 dy;
        image->GetInfo(&info);
        if (info.cx > 0 && info.cy > 0) {
            dx = (imageRect.GetWidth() - info.cx) / 2;
            dy = (imageRect.GetHeight() - info.cy) / 2;
            imageRect.SetSize(info.cx, info.cy);
            graphics->DrawImage(image, imageRect.GetOrigin() + SFXGrid(dx, dy));
        }
    }
    graphics->SetFont(_font);
    graphics->DrawSingleText(item->text, textRect.AddOrigin(1, 1), foreColor, IDF_ALIGN_CENTER);
    return;
}// SFZGridMenu::DrawItem //

Reference

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


SFZGridMenu::HandleSelectDownKey
This function will be called when the DOWN key is pressed.
[ protected, virtual ]
Void HandleSelectDownKey(Void);

Description

This function will be called when the SFEVT_KEY event(key event[SFEVT_KEY]) of the DOWN key set with the SFYMenu::SetSelectDownKey function is received.

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

The default implementation is as follows:

  1. If currently selected item is the last item, the first item will be set to the selected item.
  2. If currently selected item is not at the last row, the item of the next row and of the same column will be a candidate. If the candidate is the same row of the last item and at its right side, the first item will be set to the selected item. Otherwise the candidate will be set to the selected item.
  3. If currently selected item is at the last row, the item of the first row and of the next column will be set to the selected item.

Internal Implementation

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

/*protected virtual */Void SFZGridMenu::HandleSelectDownKey(Void)
{
    SInt32                                      row;
    SInt32                                      maxrow;
    SInt32                                      col;

    row = ToRow(_selectedItem);
    col = ToCol(_selectedItem, row);
    maxrow = ToRow(GetItemCount() - 1);
    ++row;
    if ((ToIndex(row, col) > GetItemCount() - 1) && (row >= maxrow)) {
        row = 0;
        ++col;
        if (col > _colnum - 1) {
            col = 0;
        }
    }
    else if ((ToIndex(row, col) > GetItemCount() - 1) && (col == _colnum)) {
        row = 0;
        col = 0;
    }
    SetSelect(ToIndex(row, col));
    return;
}// SFZGridMenu::HandleSelectDownKey //

/*public */inline SInt32 SFZGridMenu::ToIndex(SInt32 row, SInt32 col) const
{
    return row * _colnum + col;
}// SFZGridMenu::ToIndex //

/*public */inline SInt32 SFZGridMenu::ToRow(SInt32 index) const
{
    return index / _colnum;
}// SFZGridMenu::ToRow //

/*public */inline SInt32 SFZGridMenu::ToCol(SInt32 index) const
{
    return index - ToRow(index) * _colnum;
}// SFZGridMenu::ToCol //

/*public */inline SInt32 SFZGridMenu::ToCol(SInt32 index, SInt32 row) const
{
    return index - row * _colnum;
}// SFZGridMenu::ToCol //

Reference

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


SFZGridMenu::HandleSelectLeftKey
This function will be called when the LEFT key is pressed.
[ protected, virtual ]
Void HandleSelectLeftKey(Void);

Description

This function will be called when the SFEVT_KEY event(key event[SFEVT_KEY]) of the LEFT key set with the SFYMenu::SetSelectLeftKey function is received.

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

The default implementation is as follows:

  1. If currently selected item is the first item, the last item will be set to the selected item.
  2. If currently selected item is not at the first column, the item of the same row and of the previous column will be set to the selected item.
  3. If currently selected item is at the first column, the item of the previous row and of the last column will be set to the selected item.

Internal Implementation

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

/*protected virtual */Void SFZGridMenu::HandleSelectLeftKey(Void)
{
    if (_selectedItem > 0) {
        --_selectedItem;
    }
    else if (_selectedItem == 0) {
        _selectedItem = GetItemCount() - 1;
    }
    Invalidate();
    return;
}// SFZGridMenu::HandleSelectLeftKey //

Reference

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


SFZGridMenu::HandleSelectRightKey
This function will be called when the RIGHT key is pressed.
[ protected, virtual ]
Void HandleSelectRightKey(Void);

Description

This function will be called when the SFEVT_KEY event(key event[SFEVT_KEY]) of the RIGHT key set with the SFYMenu::SetSelectRightKey function is received.

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

The default implementation is as follows:

  1. If currently selected item is the last item, the first item will be set to the selected item.
  2. If currently selected item is not at the last column, the item of the same row and of the next column will be set to the selected item.
  3. If currently selected item is at the last column, the item of the next row and of the first column will be set to the selected item.

Internal Implementation

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

/*protected virtual */Void SFZGridMenu::HandleSelectRightKey(Void)
{
    if (_selectedItem < GetItemCount() - 1) {
        ++_selectedItem;
    }
    else if (_selectedItem == GetItemCount() - 1) {
        _selectedItem = 0;
    }
    Invalidate();
    return;
}// SFZGridMenu::HandleSelectRightKey //

Reference

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


SFZGridMenu::HandleSelectUpKey
This function will be called when the UP key is pressed.
[ protected, virtual ]
Void HandleSelectUpKey(Void);

Description

This function will be called when the SFEVT_KEY event(key event[SFEVT_KEY]) of the UP key set with the SFYMenu::SetSelectUpKey function is received.

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

The default implementation is as follows:

  1. If currently selected item is the first item, the last item will be set to the selected item.
  2. If currently selected item is not at the first row, the item of the previous row and of the same column will be set to the selected item.
  3. If currently selected item is at the first row, the item of the last row and of the previous column will be set to the selected item.

Internal Implementation

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

/*protected virtual */Void SFZGridMenu::HandleSelectUpKey(Void)
{
    SInt32                                      row;
    SInt32                                      maxrow;
    SInt32                                      col;

    row = ToRow(_selectedItem);
    col = ToCol(_selectedItem, row);
    maxrow = ToRow(GetItemCount() - 1);
    --row;
    if (row < 0) {
        row = maxrow;
        col = col - 1;
        if (col < 0) {
            col = _colnum - 1;
        }
        if (ToIndex(row, col) > GetItemCount() - 1) {
            row = (row - 1);
        }
    }
    SetSelect(ToIndex(row, col));
    return;
}// SFZGridMenu::HandleSelectUpKey //

/*public */inline SInt32 SFZGridMenu::ToIndex(SInt32 row, SInt32 col) const
{
    return row * _colnum + col;
}// SFZGridMenu::ToIndex //

/*public */inline SInt32 SFZGridMenu::ToRow(SInt32 index) const
{
    return index / _colnum;
}// SFZGridMenu::ToRow //

/*public */inline SInt32 SFZGridMenu::ToCol(SInt32 index) const
{
    return index - ToRow(index) * _colnum;
}// SFZGridMenu::ToCol //

/*public */inline SInt32 SFZGridMenu::ToCol(SInt32 index, SInt32 row) const
{
    return index - row * _colnum;
}// SFZGridMenu::ToCol //

Reference

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


SFZGridMenu::Insert
Insert the specified item before the specified index.
[ public ]
SFCError Insert(
    SInt32 index           // index of item
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
);
[ public ]
SFCError Insert(
    SInt32 index           // index of item
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
    AVKType key            // access key
);
[ public ]
SFCError Insert(
    SInt32 index           // index of item
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
    UInt16 imageId         // image object id
    UInt16 selImageId      // image object id when selected
);
[ public ]
SFCError Insert(
    SInt32 index           // index of item
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
    UInt16 imageId         // image object id
    UInt16 selImageId      // image object id when selected
    AVKType key            // access key
);
[ public ]
SFCError Insert(
    SInt32 index                 // index of item
    SFXWideStringConstRef text   // text
);
[ public ]
SFCError Insert(
    SInt32 index                 // index of item
    SFXWideStringConstRef text   // text
    AVKType key                  // access key
);
[ public ]
SFCError Insert(
    SInt32 index                        // index of item
    SFXWideStringConstRef text          // text
    SFBImageSmpConstRef image           // image
    SFBImageSmpConstRef selectedImage   // image when selected
);
[ public ]
SFCError Insert(
    SInt32 index                        // index of item
    SFXWideStringConstRef text          // text
    SFBImageSmpConstRef image           // image
    SFBImageSmpConstRef selectedImage   // image when selected
    AVKType key                         // access key
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY
  • If failed: SFERR_FAILED

Description

This function inserts the specified item before the specified index.

If the value of the specified index is less than or equals 0, the item will be inserted at the head.

If the value of the specified index is greater than or equals the number of items, the item will be inserted at the tail.

Reference

SFZGridMenu::InsertFirst | SFZGridMenu::InsertLast | SFZGridMenu::Remove


SFZGridMenu::InsertFirst
Insert the specified item at the head.
[ public ]
SFCError InsertFirst(
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
);
[ public ]
SFCError InsertFirst(
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
    AVKType key            // access key
);
[ public ]
SFCError InsertFirst(
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
    UInt16 imageId         // image object id
    UInt16 selImageId      // image object id when selected
);
[ public ]
SFCError InsertFirst(
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
    UInt16 imageId         // image object id
    UInt16 selImageId      // image object id when selected
    AVKType key            // access key
);
[ public ]
SFCError InsertFirst(
    SFXWideStringConstRef text   // text
);
[ public ]
SFCError InsertFirst(
    SFXWideStringConstRef text   // text
    AVKType key                  // access key
);
[ public ]
SFCError InsertFirst(
    SFXWideStringConstRef text          // text
    SFBImageSmpConstRef image           // image
    SFBImageSmpConstRef selectedImage   // image when selected
);
[ public ]
SFCError InsertFirst(
    SFXWideStringConstRef text          // text
    SFBImageSmpConstRef image           // image
    SFBImageSmpConstRef selectedImage   // image when selected
    AVKType key                         // access key
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY
  • If failed: SFERR_FAILED

Description

This function inserts the specified item at the head.

Reference

SFZGridMenu::Insert | SFZGridMenu::InsertLast | SFZGridMenu::RemoveFirst


SFZGridMenu::InsertLast
Insert the specified item at the tail.
[ public ]
SFCError InsertLast(
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
);
[ public ]
SFCError InsertLast(
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
    AVKType key            // access key
);
[ public ]
SFCError InsertLast(
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
    UInt16 imageId         // image object id
    UInt16 selImageId      // image object id when selected
);
[ public ]
SFCError InsertLast(
    SFXPathConstRef path   // path to resource file
    UInt16 textId          // text object id
    UInt16 imageId         // image object id
    UInt16 selImageId      // image object id when selected
    AVKType key            // access key
);
[ public ]
SFCError InsertLast(
    SFXWideStringConstRef text   // text
);
[ public ]
SFCError InsertLast(
    SFXWideStringConstRef text   // text
    AVKType key                  // access key
);
[ public ]
SFCError InsertLast(
    SFXWideStringConstRef text          // text
    SFBImageSmpConstRef image           // image
    SFBImageSmpConstRef selectedImage   // image when selected
);
[ public ]
SFCError InsertLast(
    SFXWideStringConstRef text          // text
    SFBImageSmpConstRef image           // image
    SFBImageSmpConstRef selectedImage   // image when selected
    AVKType key                         // access key
);

Return value

  • If succeeds: SFERR_NO_ERROR
  • If insufficient memory: SFERR_NO_MEMOERY
  • If failed: SFERR_FAILED

Description

This function inserts the specified item at the tail.

Reference

SFZGridMenu::Insert | SFZGridMenu::InsertFirst | SFZGridMenu::RemoveLast


SFZGridMenu::NewInstance
Create a new instance of this responder class.
[ public, static ]
SFZGridMenuSmp 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:

SFZGridMenuSmp _gridmenu;
SFCError error;

if ((_gridmenu = SFZGridMenu::NewInstance(&error)) != null) {

    ...
}

SFZGridMenu::Remove
Remove specified items from this grid menu.
[ public ]
Void Remove(
    SInt32 index   // index of item to delete
);
[ public ]
Void Remove(
    SInt32 begin   // beginning index to remove(this index is included)
    SInt32 end     // ending index to remove(this index is not included)
);
-->

Description

This function removes the item at the specified index or the items in the specified index range from this grid menu.

If the specified index is less than 0 or greater than or equals the number of items, no item will be removed

If the beginning index to remove is greater than or equals the number of items or the ending index to remove is less than or equals 0, no item will be removed

If the beginning index to remove is less than or equals 0, it will be reset to 0.

If the ending index to remove is greater than the number of items, it will be reset to the number of items.

Reference

SFZGridMenu::Clear | SFZGridMenu::Remove | SFZGridMenu::RemoveLast | SFZGridMenu::Insert


SFZGridMenu::RemoveFirst
Remove the first item from this grid menu.
[ public ]
Void RemoveFirst(Void);

Description

This function removes the first item from this grid menu.

Reference

SFZGridMenu::Clear | SFZGridMenu::Remove | SFZGridMenu::RemoveLast | SFZGridMenu::InsertFirst


SFZGridMenu::RemoveItem
[DEPRECATED]Remove the specified item from this grid menu. Use the Remove() function.
[ public ]
Void RemoveItem(
    SInt16 index   // index of item
);

Description

This function removes the item at the specified index from this grid menu.

If the specified index is less than 0 or greater than or equals the number of items, no item will be removed

[Caution] Caution
Since this function is deprecated, use the SFZGridMenu::Remove function instead.

Reference

SFZGridMenu::Remove | SFZGridMenu::AppendItem


SFZGridMenu::RemoveLast
Remove the last item from this grid menu.
[ public ]
Void RemoveLast(Void);

Description

This function removes the last item from this grid menu.

Reference

SFZGridMenu::Clear | SFZGridMenu::Remove | SFZGridMenu::RemoveFirst | SFZGridMenu::InsertLast


SFZGridMenu::SetDefaultItemBackColor
Set the default background color of unselected item of this grid menu to the specified value.
[ public ]
Void SetDefaultItemBackColor(
    SFXRGBColorConstRef param   // default background color to set
);

Description

This function sets the default background color(SFXRGBColor) of unselected item of this grid menu to the specified value.

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

[Note] Default background color of unselected item

The default background color of unselected item can be changed using the SFZGridMenu::SetItemBackColor function.

If you want to make the background color of unselected items be the same one, the background color needs to be set using this function. The SFZGridMenu::SetItemBackColor function to set it individually is not recommended.

However, the background color of selected item is always the one set with the SFZGridMenu::SetSelBackColor function.

Reference

SFZGridMenu::GetDefaultItemBackColor | SFZGridMenu::SetDefaultItemForeColor | SFZGridMenu::SetItemBackColor | SFZGridMenu::SetSelBackColor | SFXRGBColor


SFZGridMenu::SetDefaultItemForeColor
Set the default foreground color of unselected item of this grid menu to the specified value.
[ public ]
Void SetDefaultItemForeColor(
    SFXRGBColorConstRef param   // default foreground color to set
);

Description

This function sets the default foreground color(SFXRGBColor) to draw the text of unselected item of this grid menu to the specified value.

Default: SFXRGBColor(0x00, 0x00, 0x00, 0x00)[black color]

[Note] Default foreground color of unselected item

The default foreground color of unselected item can be changed using the SFZGridMenu::SetItemForeColor function.

If you want to make the foreground color of all unselected items be the same one, the foreground color needs to be set using this function. The SFZGridMenu::SetItemForeColor function to set it individually is not recommended.

However, the foreground color of selected item is always the one set with the SFZGridMenu::SetSelForeColor function.

Reference

SFZGridMenu::GetDefaultItemForeColor | SFZGridMenu::SetDefaultItemBackColor | SFZGridMenu::SetItemForeColor | SFZGridMenu::SetSelForeColor | SFXRGBColor


SFZGridMenu::SetDrawItemText
Set the "draw-item" flag indicating whether or not to draw the text of item of this grid menu to the specified value.
[ public ]
Void SetDrawItemText(
    Bool param   // value to set
);

Description

This function sets the "draw-item" flag indicating whether or not to draw the text of item of this grid menu to the specified value. If you want to draw the text of item of this grid menu, set "true" to the "draw-item" flag. Otherwise, set "false".

Default: "true"(The text of the item is drawn.)


SFZGridMenu::SetDrawSelBorder
Set the "draw-border" flag indicating whether or not to draw the border of selected item of this grid menu to the specified value.
[ public ]
Void SetDrawSelBorder(
    Bool param   // value to set
);

Description

This function sets the "draw-border" flag indicating whether or not to draw the border of selected item of this grid menu to the specified value. If you want to draw the text of item of this grid menu, set "true" to the "draw-item" flag. Otherwise, set "false".

Default: "true"(The border of selected item is drawn.)


SFZGridMenu::SetFont
Set the font of this grid menu to the specified value.
[ public ]
Void SetFont(
    AEEFont param   // font to set
);

Description

This function sets the font of this grid menu to the specified value, which is used to draw the item and the title of this grid menu.

Default: AEE_FONT_NORMAL.

Reference

SFZGridMenu::GetFont


SFZGridMenu::SetItemAccessKey
Set the access key of the specified item of this grid menu to the specified value.
[ public ]
SFCError SetItemAccessKey(
    SInt16 index   // index of item
    AVKType key    // access key
);

Description

This function sets the access key of the specified item of this grid menu to the specified value.

Reference

SFZGridMenu::GetItemAccessKey


SFZGridMenu::SetItemBackColor
Set the background color of the specified unselected item of this grid menu to the specified value.
[ public ]
SFCError SetItemBackColor(
    SInt16 index                // index of item
    SFXRGBColorConstRef param   // background color to set
);

Description

This function sets the background color(SFXRGBColor) of the specified unselected item of this grid menu to the specified value.

Default: The default background color set with the SFZGridMenu::SetDefaultItemBackColor function. SFXRGBColor(0xFF, 0xFF, 0xFF, 0x00)[white color] if the default background color is not set.

[Note] Foreground color of unselected item

For the foreground color of unselected item, refer to SFZGridMenu::SetItemForeColor.

[Note] Foreground color of selected item

For the foreground color of selected item, refer to SFZGridMenu::SetSelForeColor.

[Note] Background color of selected item

For the background color of selected item, refer to SFZGridMenu::SetSelBackColor.

Reference

SFZGridMenu::SetDefaultItemBackColor | SFZGridMenu::GetItemBackColor | SFZGridMenu::SetItemForeColor | SFZGridMenu::SetSelForeColor | SFZGridMenu::SetSelBackColor | SFXRGBColor


SFZGridMenu::SetItemForeColor
Set the foreground color of the specified unselected item of this grid menu to the specified value.
[ public ]
SFCError SetItemForeColor(
    SInt16 index                // index of item
    SFXRGBColorConstRef param   // foreground color to set
);

Description

This function sets the foreground color(SFXRGBColor) to draw the text of the specified unselected item of this grid menu to the specified value.

Default: The default foreground color set with the SFZGridMenu::SetDefaultItemForeColor function. SFXRGBColor(0x00, 0x00, 0x00, 0x00)[black color] if the default background color is not set.

[Note] Background color of unselected item

For the background color of unselected item, refer to SFZGridMenu::SetItemBackColor.

[Note] Foreground color of selected item

For the foreground color of selected item, refer to SFZGridMenu::SetSelForeColor.

[Note] Background color of selected item

For the background color of selected item, refer to SFZGridMenu::SetSelBackColor.

Reference

SFZGridMenu::SetDefaultItemForeColor | SFZGridMenu::GetItemForeColor | SFZGridMenu::SetItemBackColor | SFZGridMenu::SetSelForeColor | SFZGridMenu::SetSelBackColor | SFXRGBColor


SFZGridMenu::SetItemImage
Set the image of the specified grid item to the specified value.
[ public ]
SFCError SetItemImage(
    SInt16 index           // index of item
    SFXPathConstRef path   // path to resource file
);
[ public ]
SFCError SetItemImage(
    SInt16 index           // index of item
    SFXPathConstRef path   // path to resource file
    UInt16 id              // image text object id
);
[ public ]
SFCError SetItemImage(
    SInt16 index                // index of item
    SFBImageSmpConstRef param   // image
);

Description

This function sets the image of the specified grid item to the specified value. This image is displayed when the item is not selected.

Reference

SFZGridMenu::GetItemImage


SFZGridMenu::SetItemSelImage
Set the image of the specified selected grid item to the specified value.
[ public ]
SFCError SetItemSelImage(
    SInt16 index           // index of item
    SFXPathConstRef path   // path to resource file
);
[ public ]
SFCError SetItemSelImage(
    SInt16 index           // index of item
    SFXPathConstRef path   // path to resource file
    UInt16 id              // 
);
[ public ]
SFCError SetItemSelImage(
    SInt16 index                // image text object id
    SFBImageSmpConstRef param   // image
);

Description

This function sets the image of the specified selected grid item to the specified value.

Reference

SFZGridMenu::GetItemSelImage


SFZGridMenu::SetItemText
Set the text of the specified grid item to the specified value.
[ public ]
SFCError SetItemText(
    SInt16 index           // index of item
    SFXPathConstRef path   // path to the resource filw
    UInt16 id              // text object id
);
[ public ]
SFCError SetItemText(
    SInt16 index                  // index of item
    SFXWideStringConstRef param   // text
);

Description

This function sets the text of the specified grid item to the specified value.

Reference

SFZGridMenu::GetItemText


SFZGridMenu::SetPadding
Set the padding size of this grid menu to the specified value. [pixels]
[ public ]
Void SetPadding(
    SInt16 param   // value to set
);

Description

This function sets the padding size of this grid menu to the specified value, which is the amount of space (padding) between two neighbouring items of this grid menu. [pixels]

If this value is greater than 0, the grid lines are drawn in the same color with the background color of this grid menu.

Default: 0 pixel.

Reference

SFZGridMenu::GetItemForeColor


SFZGridMenu::SetRowCol
Set the numbers of rows and columns of this grid menu to specified values.
[ public ]
Void SetRowCol(
    SInt16 row   // number of row to set
    SInt16 col   // number of column to set
);

Description

This function sets the numbers of rows and columns of this grid menu to specified values. The size of each item is calculated based on the real region of this grid menu and those two values.

Default: 4 for the number of rows and 3 for the number of columns

Reference

SFZGridMenu::GetRowNumber | SFZGridMenu::GetColNumber | Real Region


SFZGridMenu::SetSelBackColor
Set the background color of selected item of this grid menu to the specified value.
[ public ]
Void SetSelBackColor(
    SFXRGBColorConstRef param   // background color to set
);

Description

This function sets the background color(SFXRGBColor) of selected item of this grid menu to the specified value.

Default: SFXRGBColor(0x11, 0x22, 0xBB, 0x00)[blue color]

[Note] Foreground color of selected item

For the foreground color of selected item, refer to SFZGridMenu::SetSelForeColor.

[Note] Foreground color of unselected item

For the foreground color of unselected item, refer to SFZGridMenu::SetItemForeColor.

[Note] Background color of unselected item

For the background color of unselected item, refer to SFZGridMenu::SetItemBackColor.

Reference

SFZGridMenu::GetSelBackColor


SFZGridMenu::SetSelBorderColor
Set the border color of currently selected item of this grid menu to the specified value.
[ public ]
Void SetSelBorderColor(
    SFXRGBColorConstRef param   // value to set
);

Description

This function sets the border color(SFXRGBColor) of this grid menu to the specified value, in which color the border of currently selected item is drawn.

Default: SFXRGBColor(0x11, 0x22, 0xBB, 0x00)[blue color]

Reference

SFZGridMenu::GetSelBorderColor


SFZGridMenu::SetSelForeColor
Set the foreground color of selected item of this grid menu to the specified value.
[ public ]
Void SetSelForeColor(
    SFXRGBColorConstRef param   // foreground color to set
);

Description

This function sets the foreground color(SFXRGBColor) of selected item of this grid menu to the specified value.

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

[Note] Background color of selected item

For the background color of selected item, refer to SFZGridMenu::SetSelBackColor.

[Note] Foreground color of unselected item

For the foreground color of unselected item, refer to SFZGridMenu::SetItemForeColor.

[Note] Background color of unselected item

For the background color of unselected item, refer to SFZGridMenu::SetItemBackColor.

Reference

SFZGridMenu::GetSelForeColor | SFZGridMenu::SetItemForeColor | SFZGridMenu::SetItemBackColor | SFZGridMenu::SetSelBackColor | SFXRGBColor


SFZGridMenu::SetSelect
Set the index of currently selected item of this grid menu to the specified value.
[ public ]
Void SetSelect(
    SInt16 param   // index of item
);

Description

This function sets the index of currently selected item of this grid menu to the specified value.

Reference

SFZGridMenu::GetSelect


SFZGridMenu::SetTitle
Set the menu title of this grid menu to the specified value.
[ public ]
SFCError SetTitle(
    SFXPathConstRef path   // path to resource file
    UInt16 id              // text object id
);
[ public ]
SFCError SetTitle(
    SFXWideStringConstRef param   // text to set
);

Description

This function sets the menu title of this grid menu to the specified value.

The menu title is set by specifying the string as an argument directly, or by reading from the resource file.

Reference

SFZGridMenu::GetTitle


SFZGridMenu::SetTitleBackColor
Set the background color of menu title of this grid menu to the specified value.
[ public ]
Void SetTitleBackColor(
    SFXRGBColorConstRef param   // value to set
);

Description

This function sets the background color(SFXRGBColor) of menu title of this grid menu to the specified value, in which the rectangle containing the menu title is filled.

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

Reference

SFZGridMenu::GetTitleBackColor | SFXRGBColor


SFZGridMenu::SetTitleForeColor
Set the foreground color of menu title of this grid menu to the specified value.
[ public ]
Void SetTitleForeColor(
    SFXRGBColorConstRef param   // value to set
);

Description

This function sets the foreground color(SFXRGBColor) of menu title of this grid menu to the specified value, in which the menu title is drawn.

Default: SFXRGBColor(0x00, 0x00, 0x00, 0x00)[black color]

Reference

SFZGridMenu::GetTitleForeColor | SFXRGBColor


SFZGridMenu::SetTitleHeight
Set the height of menu title of this grid menu to the specified value. [pixels]
[ public ]
Void SetTitleHeight(
    SInt16 param   // value to set
);

Description

This function sets the height of menu title of this grid menu to the specified value. If this value is set to "0", the menu title will be hidden and never drawn.

Default: font height + 4 [pixels]

Reference

SFZGridMenu::GetTitleHeight


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

Reference

SFYResponder::GetType | SFYResponder::SetType