PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFZMessageDialog
Responder which represents a dialog to display a notification message.
#include <SFZMessageDialog.h.hpp>
class SFZMessageDialog : public SFZDialog;
SFMTYPEDEFCLASS(SFZMessageDialog)

Inheritance diagram

 Inheritance diagram of SFZMessageDialogClass

Collaboration diagram

 Collaboration diagram of SFZMessageDialogClass

Description

How to use

SFZMessageDialog is the dialog to display a notification message, which consists of the icon image, the message text, and the OK button.

Each element can be omitted(it will be omitted if nothing is set with the Set function).

Figure 342. Example: The bahaviour of SFZMessageDialog

Example: The bahaviour of SFZMessageDialog

The icon image, the message text, and the OK button are internally contained as the SFZImageLabelControl, SFZMultipleTextLabelControl, and SFZTextButtonControl instance respectively. There are the APIs to get these instances.

Since the state of icon image and message text are set to "disable", the focus cannot be moved to these objects. The OK button, whose state is set to "enable", will be focused if the focus is moved to the dialog.

If the icon image, the message text, or the button text is not set with the SFZMessageDialog::SetIconImage, SFZMessageDialog::SetMessageText, or SFZMessageDialog::SetButtonText function respectively, it will not be displayed since regarded as omitted.

In the default implementation, the notification message dialog[SFZMessageDialog] will receive the following result events[SFEVT_RESPONDER_RESULT].

The handler for these events can be registered. The default handler closes the dialog only.

The operation key of the dialog is set with the SFZDialog::SetOperateKey function. The operation key of the button for operating the OK button is set with the SFYButtonControl::SetOperateKey function. By default, the operation key of the dialog and the operation key of the button are set to the SELECT key. When the button is displayed, the SELECT key is handled as the operation key of the button.

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

[Note] Note
The timer processing callback scheduled with the SFZDialog::ScheduleTimer function will be canceled automatically when the operation key of the dialog, the ESCAPE key, or the OK button is pressed.
[Note] Operating a dialog with its operation key

If the OK button is omitted or its state is set to "disable", the dialog will be operated by its operation key. In the default implementation, its behaviour is the same as when the OK button is pressed.

That is, if the operation key is pressed, the (SFEVT_RESPONDER_RESULT, SFP16_RESULT_OK) event will be sent, and then the dialog will close. This function is used for the dialog with no button which has only the warning message and is closed with its operation key.

[Note] Default background color

In SFZMessageDialog, the default background color set with the SFYWidget::SetBackgroundColor function is the gray color[SFXRGBColor(0xEE, 0xEE, 0xEE,0x00)].

[Important] IMPORTANT

In the concrete container, the SFYResponder::SetParent, SFYResponder::SetState, and SFYResponder::SetRealBound functions must be always called.

Other functions are optionally called.

Sample code

Example 887. Declaration

SFMTYPEDEFCLASS(USRApplication)
class USRApplication: public SFYApplication {
    SFMSEALCOPY(USRApplication)
public:
  static SFCInvokerPtr Factory(Void);
private:
  explicit USRApplication(Void) static_throws;
  virtual ~USRApplication(Void);

  // result handler
  XANDLER_DECLARE_VOIDRESULT(OnResult)
};

Example 888. Implementation

USRApplication::USRApplication(Void) static_throws
{
  // ... (omitted) ...
  SFZMessageDialogSmp dialog;  // smart pointer of SFZMessageDialog
  SFCError error(SFERR_NO_ERROR);

  // create the dialog
  if ((dialog = SFZMessageDialog::NewInstance(&error)) != null) {

    // set the dialog's parent responder to USRApplication
    error = dialog->SetParent(GetThis());
    if (error == SFERR_NO_ERROR) {

      // register the result handler into the dialog
      error = dialog->RegisterHandler(
          SFXEventRange(SFEVT_RESPONDER_RESULT, SFEVT_RESPONDER_RESULT, SFP16_BEGIN, SFP16_END),
          XANDLER_INTERNAL(OnResult)
      );
      if (error == SFERR_NO_ERROR) {

        // set the image for the dialog's icon
        // * SFBImage image can be set from the resource file or normal file
        error = dialog->SetIconImage(SFXPath("resource.bar"), IMAGE_ID);
        if (error == SFERR_NO_ERROR) {

          // set the text for the dialog's message
          // * SFXWideString text can be set from the resource file
          error = dialog->SetMessageText("hello world\n\nThis is a notification message.");
          if (error == SFERR_NO_ERROR) {

            // set the text for the dialog's OK button
            // * SFXWideString text can be set from the resource file
            error = dialog->SetButtonText("OK");
            if (error == SFERR_NO_ERROR) {

              // Calculate the suitable dialog region within the hint region obtained by deflating the screen device region by (20, 20) margin, 
              // which will be aligned at the center and the middle of the hint region.
              // Set the dialog's real region to it.
              dialog->SetRealBound(dialog->GetSuitableBound(GetLocalBound().Deflate(20, 20), SFYResponder::HORIZONTAL_CENTER, SFYResponder::VERTICAL_MIDDLE));

              // set the dialog's state to "visible" + "active" + "enable" + "focus" together
              dialog->SetState(true, true, true, true);

              // move the dialog foremost
              dialog->ToFront();
            }
          }
        }
      }
    }
  }
  static_throw(error);
}

// result handler
XANDLER_IMPLEMENT_VOIDRESULT(USRApplication, OnResult, invoker, reason, result)
{
    // the dialog will be passed via the invoker argument
    // the P16 value of the result event will be passed via the reason argument
    // "0" will be passed via the result argument

    switch (reason) {
        case SFP16_RESULT_OK:

            // when the OK button or the operation key is pressed
 
            ...

           break;

        case SFP16_RESULT_ESCAPE:

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

            ...

            break;
    }

    // close the dialog
    invoker->Terminate();

    return;
}

Figure 343. Execution result of the above sample code [SFZMessageDialog]

Execution result of the above sample code [SFZMessageDialog]

Sample code of this dialog with a title and a border

A frame with a border and/or a title can be attached to this dialog.

The below is the code to attach a bevel frame with a title [SFZTitleBevelFrame] to this dialog.

Example 889. Sample code: Attach a bevel frame with a title to a dialog [SFZMessageDialog and SFZTitleBevelFrame]

// define the class
SFMTYPEDEFCLASS(USRApplication)
class USRApplication : public SFYApplication {
  SFMSEALCOPY(USRApplication)
public:
  static SFCInvokerPtr Factory(Void);
private:
  explicit USRApplication(Void) static_throws;
  virtual ~USRApplication(Void);

  XANDLER_DECLARE_VOIDRESULT(OnResult)        // dialog's result handler
};


// constructor
USRApplication::USRApplication(Void) static_throws
{
  // ... (omitted) ...

  SFZTitleBevelFrameSmp frame;  // smart pointer to SFZTitleBevelFrame
  SFZMessageDialogSmp   dialog; // smart pointer to SFZMessageDialog
  SFCError              error(SFERR_NO_ERROR);

  // create the frame
  if ((frame = SFZTitleBevelFrame::NewInstance(&error)) != null) {

    // set frame title
    frame->SetText("SFZMessageDialog");

    // In general, the frame's state is set to "visible" + "active" + "enable" + "focus".
    frame->SetState(true, true, true, true);

    // create and place dialog
    if ((dialog = SFZMessageDialog::NewInstance(&error)) != null) {

      // set dialog's parent responder to the application class(root)
      error = dialog->SetParent(GetThis());
      if (error == SFERR_NO_ERROR) {

        // attach the frame to the dialog
        error = dialog->SetFrame(frame);
        if (error == SFERR_NO_ERROR) {

          // register the result handler into the dialog
          error = dialog->RegisterHandler(
               SFXEventRange(SFEVT_RESPONDER_RESULT, SFEVT_RESPONDER_RESULT, SFP16_BEGIN, SFP16_END),
                      XANDLER_INTERNAL(OnResult)
          );
          if (error == SFERR_NO_ERROR) {

            // set the image for the dialog's icon
            // * SFBImage image can be set from the resource file or normal file
            error = dialog->SetIconImage(SFXPath(USRApplication_RES_FILE), ICON);
            if (error == SFERR_NO_ERROR) {

              // set the text for the dialog's message
              // * SFXWideString text can be set from the resource file
              error = dialog->SetMessageText("This is a message dialog with a title bevel frame.");
              if (error == SFERR_NO_ERROR) {

                // set the text for the dialog's OK button
                // * SFXWideString text can be set from the resource file
                error = dialog->SetButtonText("OK");
                if (error == SFERR_NO_ERROR) {

                  // Calculate the suitable dialog region within the hint region obtained by deflating the screen device region by (20, 20) margin, 
                  // which will be aligned at the center and the middle of the hint region.
                  // Set the dialog's real region to it.
                  // * Automatically, the frame's real region will be set to the region obtained by inflating it by the frame margin.
                  dialog->SetRealBound(dialog->GetSuitableBound(GetLocalBound().Deflate(20, 20), SFYResponder::HORIZONTAL_CENTER, SFYResponder::VERTICAL_MIDDLE));

                  // set the dialog's state to "visible" + "active" + "enable" + "focus" together
                  dialog->SetState(true, true, true, true);

                  // move the dialog foremost
                  // * automatically, the frame will be moved foremost together
                  dialog->ToFront();
                }
              }
            }
          }
        }
      }
    }
  }
  static_throw(error);
}


// result handler
XANDLER_IMPLEMENT_VOIDRESULT(USRApplication, OnResult, invoker, reason, result)
{
  // the dialog will be passed via the invoker argument
  // the P16 value of the result event will be passed via the reason argument
  // "0" will be passed via the result argument

  switch (reason) {
    case SFP16_RESULT_OK:

      // when the OK button or the operation key is pressed

      ...

      break;

    case SFP16_RESULT_ESCAPE:

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

      ...

      break;
  }

  // close the dialog only
  // * automatically, the frame will be detached from the dialog and become invisible
  invoker->Terminate();

  return;
}

Figure 344. Execution result of the above code [SFZMessageDialog and SFZTitleBevelFrame]


Execution result of the above code [SFZMessageDialog and SFZTitleBevelFrame]

[Caution] Note when calling and passing nothing as an argument to GetSuitableBound()

Before calling and passing nothing as an argument to the GetSuitableBound() function, the real region( local region*) must be set using the SFYResponder::SetRealBound function. The width of this real region is used as the hint value to calculate the size of its suitable region. In general, the value more than [the width of the used font + (the width of the frame margin) * 2] should be set.

* Unless the virtual region is set, the real region is the same with the virtual region. When setting the real region which is used for the hint value, you have to consider the frame margin set with the SFZMessageDialog::SetFrameSize function.

Reference: Getting the Suitable Size of Responder for Displaying a Multiple Text |

Reference

Dialog to a Display Notification Message [SFZMessageDialog] | SFZDialog | SFZQuestionDialog | SFZImageLabelControl | SFZMultipleTextLabelControl | SFZTextButtonControl | SFYWidget | SFXRGBColor | SFYWidget::SetBackgroundColor | SFZMessageDialog::SetIconImage | SFZMessageDialog::SetMessageText | SFZMessageDialog::SetButtonText | SFZDialog::SetOperateKey | SFZDialog::SetEscapeKey | SFYButtonControl::SetOperateKey | SFYContainer::SetScrollUpKey | SFYContainer::SetScrollDownKey | SFZDialog::ScheduleTimer | SFYResponder::ToFront | SFYResponder::Terminate | Frame | SFZTitleBevelFrame | Real Region | Local Region | Virtual Region | Getting the Suitable Size of Responder for Displaying a Multiple Text | SFZMessageDialog::SetFrameSize

Member

Constructor/Destructor
SFZMessageDialog( Void )
Constructor of the SFZMessageDialog class.
~SFZMessageDialog( Void )
Destructor of the SFZMessageDialog class.
Public Functions
SFZTextButtonControlSmpConstRef GetButton( Void )
Get the button control of this dialog.
SFXWideStringConstRef GetButtonText( Void )
Get the button text of this dialog.
SInt16 GetFrameSize( Void )
Get the size of the frame margin of this dialog.[pixel unit]
SFZImageLabelControlSmpConstRef GetIcon( Void )
Get the icon of this dialog.
SFBImageSmpConstRef GetIconImage( Void )
Get the icon image of this dialog.
SFZMultipleTextLabelControlSmpConstRef GetMessage( Void )
Get the multiple text label control of this dialog.
SFXWideStringConstRef GetMessageText( Void )
Get the message text of this dialog.
SInt16 GetSpaceSize( Void )
Get the size of the space margin of this dialog.[pixel unit]
static
SFZMessageDialogSmp
NewInstance( SFCErrorPtr exception = null )
Create a new instance of this responder class.
SFCError SetButtonText( SFXPathConstRef path , UInt16 id )
Set the button text of this dialog to the specified value.
SFCError SetButtonText( SFXWideStringConstRef param )
Set the button text of this dialog to the specified value.
Void SetFrameSize( SInt16 param )
Set the size of the frame margin of this dialog to the specified value. [pixels]
SFCError SetIconImage( SFXPathConstRef path )
Set the icon image of this dialog to the specified value.
SFCError SetIconImage( SFXPathConstRef path , UInt16 id )
Set the icon image of this dialog to the specified value.
SFCError SetIconImage( SFBImageSmpConstRef param )
Set the icon image of this dialog to the specified value.
SFCError SetMessageText( SFXPathConstRef path , UInt16 id )
Set the message text of this dialog to the specified value.
SFCError SetMessageText( SFXWideStringConstRef param )
Set the message text of this dialog to the specified value.
Void SetSpaceSize( SInt16 param )
Set the size of the space margin of this dialog to the specified value. [pixels]
Void CancelTimer( Void ) (inherits from SFZDialog)
Cancel the timer of this dialog.
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 SFZDialog)
Get the ESCAPE key of this dialog.
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 SFZDialog)
Get the operation key of this dialog.
SFYResponderSmp GetParent( Void ) (inherits from SFYResponder)
Get the parent responder of this responder.
Bool GetPropertyTransparent( Void ) (inherits from SFYResponder)
Get the transparency attribute of this responder.
SFXRectangleConstRef GetRealBound( Void ) (inherits from SFYResponder)
Get the real region of this responder.
VoidPtr GetReference( Void ) (inherits from SFYResponder)
Get the reference of this responder.
SFYRendererPtr GetRenderer( Void ) (inherits from SFYResponder)
Get the renderer bound with this responder.
SFYResponderSmp GetRoot( Void ) (inherits from SFYResponder)
Get the root responder.
Bool GetStateActive( Bool inherit = false ) (inherits from SFYResponder)
Get the active state of this responder.
Bool GetStateEnable( Bool inherit = false ) (inherits from SFYResponder)
Get the enable state of this responder.
Bool GetStateFocus( Bool inherit = false ) (inherits from SFYResponder)
Get the focus state of this responder.
Bool GetStateValid( Bool inherit = false ) (inherits from SFYResponder)
Get the valid state of this responder.
Bool GetStateVisible( Bool inherit = false ) (inherits from SFYResponder)
Get the visible state of this responder.
SFXRectangle GetSuitableBound( Void ) (inherits from SFYResponder)
Get the suitable region of this responder.
SFXRectangle GetSuitableBound( SFXRectangleConstRef rectangle ) (inherits from SFYResponder)
Get the suitable region of this responder.
SFXRectangle GetSuitableBound( SFXRectangleConstRef param , HorizontalEnum horizontal , VerticalEnum vertical ) (inherits from SFYResponder)
Get the suitable region of this responder.
SFXMargin GetSuitableMargin( Void ) (inherits from SFYResponder)
Get the suitable frame margin region of this responder.
SFCType GetType( Void ) (inherits from SFYResponder)
Get the type of this responder class.
SFXRectangleConstRef GetVirtualBound( Void ) (inherits from SFYResponder)
Get the virtual region of this responder.
Bool HasFrame( Void ) (inherits from SFYResponder)
Check whether or not this responder is a content-responder.
Void Initialize( Void ) (inherits from SFYResponder)
Initialize this responder.
Bool IsBack( Void ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsBack( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsBack( UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders which match the specified search condition.
Bool IsFrame( Void ) (inherits from SFYResponder)
Check whether or not this responder is an attachment-frame.
Bool IsFront( Void ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsFront( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsFront( UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders which match the specified search condition.
Bool IsRoot( Void ) (inherits from SFYResponder)
Check whether or not this responder is the root responder.
SFCError Recover( Void ) (inherits from SFYResponder)
Recover the intersection region between this responder and the responder space by using the saved bitmap to restore the device bitmap.
SFCError RegisterHandler( SFXEventRangeConstRef range , SFYHandler::RuleRecConstRef rule ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) (inherits from SFYResponder)
Register specified handlers into this responder.
SFCError RegisterTracer( SFXEventRangeConstRef range , SFYTracer::RuleRecConstRef rule ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError RegisterTracer( SFXEventRangeConstRef range , SFYTracer::OrderEnum order , SFYTracer::StateEnum state , Bool overload ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::RuleRecConstPtr rule , SInt32 length ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError RegisterTracer( SFXEventRangeConstPtr range , SFYTracer::OrderEnumConstPtr order , SFYTracer::StateEnumConstPtr state , BoolConstPtr overload , SInt32 length ) (inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
SFCError Render( Bool force = false ) (inherits from SFYResponder)
Boot up the renderer for redrawing this responder and its descendant responders.
Void RewindTimer( Void ) (inherits from SFZDialog)
Reset the time until this dialog is automatically closed.
Void ScheduleTimer( UInt32 param ) (inherits from SFZDialog)
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 SFZDialog)
Set the ESCAPE key of this dialog 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 SFZDialog)
Set the operation key of this dialog to the specified value.
SFCError SetParent( SFYResponderSmpConstRef param ) (inherits from SFYResponder)
Set the parent responder of this responder to the specified responder.
Void SetProperty( Bool transparent ) (inherits from SFYResponder)
Set the property of this responder to the specified value.
Void SetPropertyTransparent( Bool param ) (inherits from SFYResponder)
Set the transparency attribute of this responder to the specified value.
Void SetRealBound( SFXRectangleConstRef param ) (inherits from SFYResponder)
Set the real region of this responder to the specified region.
Void SetReference( VoidPtr param ) (inherits from SFYResponder)
Set the reference value of this responder to the specified value.
Void SetRenderer( SFYRendererPtr param ) (inherits from SFYResponder)
Bind this responder with the specified renderer.
Void SetState( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Set all states of this responder to specified values together.
Void SetStateActive( Bool param ) (inherits from SFYResponder)
Set the active state of this responder to the specified value.
Void SetStateEnable( Bool param ) (inherits from SFYResponder)
Set the enable state of this responder to the specified value.
Void SetStateFocus( Bool param ) (inherits from SFYResponder)
Set the focus state of this responder to the specified value.
Void SetStateVisible( Bool param ) (inherits from SFYResponder)
Set the visible state of this responder to the specified value.
Void SetVirtualBound( SFXRectangleConstRef param ) (inherits from SFYResponder)
Set the virtual region of this responder to the specified value.
SFCError Snapshot( SFBBitmapSmpConstRef bitmap ) (inherits from SFYResponder)
Get a snapshot image of the intersection region between this responder and the responder space by using the saved bitmap.
Void Terminate( Void ) (inherits from SFYResponder)
Terminate this responder.
Void ToBack( Void ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToBack( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToBack( UInt32 id ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToBack( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders which match the specified search condition.
Void ToFront( Void ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToFront( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToFront( UInt32 id ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToFront( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthBackward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index , UInt32 id ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void ToNthForward( SInt32 index , UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders which match the specified search condition.
Void UnregisterHandler( SFXEventRangeConstRef range , SFYHandler::RuleRecConstRef rule ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstRef range , SFYHandler::HandlerSPP spp , VoidPtr reference ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::RuleRecConstPtr rule , SInt32 length ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterHandler( SFXEventRangeConstPtr range , SFYHandler::HandlerSPPConstPtr spp , VoidPtrConstPtr reference , SInt32 length ) (inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
Void UnregisterTracer( SFXEventRangeConstRef range ) (inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
Void UnregisterTracer( SFXEventRangeConstPtr range , SInt32 length ) (inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
T const & static_catch( Void ) (inherits from static_exception)
Get the current exception.
Protected Functions
Void HandleBoundOptimize( SFXRectanglePtr rectangle )
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 )
This function will be called when the real region is changed.
Void HandleBoundRequest( SFXRectanglePtr rectangle )
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event is received. [Calculate the suitable rectangle size of this responder.]
Void HandleBoundVirtual( Void )
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event is received. [Perform the processing when the virtual region is changed.]
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 HandleEscapeKey( Void ) (inherits from SFZDialog)
This function will be called when the SFEVT_KEY event of the ESCAPE key is received or the time scheduled by ScheduleTimer() elapses.
Void HandleOperateKey( Void ) (inherits from SFZDialog)
This function will be called when the SFEVT_KEY event of the operation key is received.
Void HandleRenderRequest( SFXGraphicsPtr graphics ) (inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received. [Draw this responder.]
Void Invalidate( Void ) (inherits from SFYResponder)
Register the specified redraw region of this responder.
Void Invalidate( SFXRectangleConstRef param ) (inherits from SFYResponder)
Register the specified redraw region of this responder.
Void InvokeBackward( SFXEventConstRef event , Bool overload , BoolPtr result = null ) (inherits from SFYResponder)
Call the handlers for the specified event from the end of the handler list registered into this responder.
Void InvokeForward( SFXEventConstRef event , Bool overload , BoolPtr result = null ) (inherits from SFYResponder)
Call the handlers for the specified event from the head of the handler list registered into this responder.
Void SetType( SFCType param ) (inherits from SFYResponder)
Set the Type value of this responder to the specified 4-character value.
Void static_throw( static_exception< T > const & param ) (inherits from static_exception)
Set an exception.
Void static_throw( T const & param ) (inherits from static_exception)
Set an exception.
Bool static_try( Void ) (inherits from static_exception)
Confirm whether or not the exception is retained.
Types
CodeEnum
Constant that represents the SFZMessageDialog class.
DefaultEnum
Constant that represents the default values of the frame margin and the space margin.
HorizontalEnum (inherits from SFYResponder)
Constants that represent the horizontal alignment.
VerticalEnum (inherits from SFYResponder)
Constants that represent the vertical alignment.

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

Description

This constructor performs the initializations as follows:

  1. Set the type of this responder to "dmsg".
  2. Set the horizontal alignment of the message text to SFZMultipleTextLabelControl::HORIZONTAL_LEFT.
  3. Set the vertical alignment of the message text to SFZMultipleTextLabelControl::VERTICAL_TOP.
  4. Set the size of the frame margin to SFZMessageDialog::DEFAULT_FRAME.
  5. Set the size of the space margin to SFZMessageDialog::DEFAULT_SPACE.
  6. Set this responder so that the timer processing scheduled with the SFZDialog::ScheduleTimer function will be canceled and it will send the result event[SFEVT_RESPONDER_RESULT] if its button is pressed.

Reference

SFYResponder::SetType | SFZMessageDialog::CodeEnum | SFZMessageDialog::DefaultEnum | SFZMultipleTextLabelControl::HorizontalEnum | SFZMultipleTextLabelControl::VerticalEnum | SFZMultipleTextLabelControl | SFXEvent | SFXRGBColor | Type | Event | Result Event[SFEVT_RESPONDER_RESULT]


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

Description

This destructor does nothing.


SFZMessageDialog::GetButton
Get the button control of this dialog.
[ public, const ]
SFZTextButtonControlSmpConstRef GetButton(Void);

Return value

Text button control(SFZTextButtonControl) which the SFZMessageDialog class contains as the OK button internally.

Description

This function gets the instance of the SFZTextButtonControl class which the SFZMessageDialog class contains as the OK button internally.

The text or color of the button can be changed using the functions of the SFZTextButtonControl class.

Reference

SFZMessageDialog::SetButtonText | SFZTextButtonControl


SFZMessageDialog::GetButtonText
Get the button text of this dialog.
[ public, const ]
SFXWideStringConstRef GetButtonText(Void);

Reference

SFZMessageDialog::SetButtonText | SFXWideString


SFZMessageDialog::GetFrameSize
Get the size of the frame margin of this dialog.[pixel unit]
[ public, const ]
SInt16 GetFrameSize(Void);

Reference

SFZMessageDialog::SetFrameSize


SFZMessageDialog::GetIcon
Get the icon of this dialog.
[ public, const ]
SFZImageLabelControlSmpConstRef GetIcon(Void);

Description

This function gets the instance of the SFZImageLabelControl class which SFZMessageDialog contains as an icon image of this dialog internally.

The image or alignment of the icon can be changed using the APIs of the SFZImageLabelControl class.

Reference

SFZMessageDialog::SetIconImage | SFZImageLabelControl


SFZMessageDialog::GetIconImage
Get the icon image of this dialog.
[ public, const ]
SFBImageSmpConstRef GetIconImage(Void);

Reference

SFZMessageDialog::SetIconImage | SFBImage | BREW API IImage


SFZMessageDialog::GetMessage
Get the multiple text label control of this dialog.
[ public, const ]
SFZMultipleTextLabelControlSmpConstRef GetMessage(Void);

Description

This function gets the instance of the SFZMultipleTextLabelControl class which SFZMessageDialog contains as a message text of this dialog internally.

The color or alignment of the message text can be changed using the APIs of the SFZMultipleTextLabelControl class.

Reference

SFZMultipleTextLabelControl


SFZMessageDialog::GetMessageText
Get the message text of this dialog.
[ public, const ]
SFXWideStringConstRef GetMessageText(Void);

Reference

SFZMessageDialog::SetMessageText | SFXWideString


SFZMessageDialog::GetSpaceSize
Get the size of the space margin of this dialog.[pixel unit]
[ public, const ]
SInt16 GetFrameSize(Void);

Reference

SFZMessageDialog::SetSpaceSize


SFZMessageDialog::HandleBoundOptimize
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.]
[ protected, virtual, const ]
Void HandleBoundOptimize(
    SFXRectanglePtr rectangle   // hint region and calculated region
);

Description

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

This function calculates the suitable rectangle size of this dialog within the hint rectangle specified as an argument.

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

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

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

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

Internal Implementation

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

/*protected virtual */Void SFZMessageDialog::HandleBoundOptimize(SFXRectanglePtr rectangle) const
{
    SFXRectangle                                rx;
    SFXSize                                     icon;
    SFXSize                                     message;
    SFXSize                                     button;
    SInt16                                      horizontal;
    SInt16                                      vertical;

    rectangle->Deflate(_frame, _frame);
    rx.Set(*rectangle);
    icon.Set(SFXSize::ZeroInstance());
    message.Set(SFXSize::ZeroInstance());
    button.Set(SFXSize::ZeroInstance());
    horizontal = 0;
    vertical = 0;
    if (_button->GetStateVisible()) {
        button.Set(_button->GetSuitableBound(rx).GetSize());
        if (!button.IsEmpty()) {
            rx.SubBottom(button.GetHeight() + _space);
            ++vertical;
        }
    }
    if (_icon->GetStateVisible()) {
        icon.Set(_icon->GetSuitableBound(rx).GetSize());
        if (!icon.IsEmpty()) {
            rx.AddLeft(icon.GetWidth() + _space);
            ++horizontal;
            if (message.IsEmpty()) {
                ++vertical;
            }
        }
    }
    if (_message->GetStateVisible()) {
        message.Set(_message->GetSuitableBound(rx).GetSize());
        if (!message.IsEmpty()) {
            ++horizontal;
            if (icon.IsEmpty()) {
                ++vertical;
            }
        }
    }
    rx.SetSize(icon.GetWidth() + message.GetWidth(), (icon.GetHeight() > message.GetHeight()) ? (icon.GetHeight()) : (message.GetHeight()));
    if (--horizontal > 0) {
        rx.AddWidth(_space * horizontal);
    }
    if (--vertical > 0) {
        rx.AddHeight(_space * vertical);
    }
    rx.SetSize((rx.GetWidth() > button.GetWidth()) ? (rx.GetWidth()) : (button.GetWidth()), rx.GetHeight() + button.GetHeight());
    rectangle->SetSize(rx.GetSize());
    rectangle->Inflate(_frame, _frame);
    return;
}// SFZMessageDialog::HandleBoundOptimize //

Reference

SFYResponder::GetSuitableBound | SFXEvent | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND] SFZTextButtonControl::HandleBoundOptimize | SFZMultipleTextLabelControl::HandleBoundOptimize | SFZImageLabelControl::HandleBoundOptimize | SFZMessageDialog::SetFrameSize | SFZMessageDialog::SetSpaceSize


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

Description

This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event is received.

This function will equalize the virtual region with the real region when the real region is changed.

[Note] Sending the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event

The (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event will occur when the real region is changed by calling the SFYResponder::SetRealBound function.

[Note] Processing when the real region is changed

Other than overriding this virtual function, there is another method to define and implement the handler for the region event[XANDLER_DECLARE_VOIDBOUND], and register it into the responder.

In the processing when the real region is updated, this virtual function is executed first, and next the handlers for the region event are executed in the registered order.

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

Internal Implementation

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

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

Reference

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


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

Description

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

This function calculates the suitable rectangle size of this dialog.

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

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

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

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

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

Internal Implementation

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

/*protected virtual */Void SFZMessageDialog::HandleBoundRequest(SFXRectanglePtr rectangle) const
{
    SFXRectangle                                rx;
    SFXRectangle                                lx;
    SFXSize                                     icon;
    SFXSize                                     message;
    SFXSize                                     button;
    SInt16                                      horizontal;
    SInt16                                      vertical;

    rectangle->Deflate(_frame, _frame);
    rx.Set(*rectangle);
    icon.Set(SFXSize::ZeroInstance());
    message.Set(SFXSize::ZeroInstance());
    button.Set(SFXSize::ZeroInstance());
    horizontal = 0;
    vertical = 0;
    if (_button->GetStateVisible()) {
        button.Set(_button->GetSuitableBound().GetSize());
        if (!button.IsEmpty()) {
            rx.SetWidth((rx.GetWidth() > button.GetWidth()) ? (rx.GetWidth()) : (button.GetWidth()));
            rx.SubBottom(button.GetHeight() + _space);
            ++vertical;
        }
    }
    if (_icon->GetStateVisible()) {
        icon.Set(_icon->GetSuitableBound().GetSize());
        if (!icon.IsEmpty()) {
            rx.AddLeft(icon.GetWidth() + _space);
            rx.SetHeight((rx.GetHeight() > icon.GetHeight()) ? (rx.GetHeight()) : (icon.GetHeight()));
            ++horizontal;
            if (message.IsEmpty()) {
                ++vertical;
            }
        }
    }
    if (_message->GetStateVisible()) {
        lx.Set(_message->GetRealBound());
        _message->SetRealBound(rx);
        message.Set(_message->GetSuitableBound().GetSize());
        _message->SetRealBound(lx);
        if (!message.IsEmpty()) {
            ++horizontal;
            if (icon.IsEmpty()) {
                ++vertical;
            }
        }
    }
    rx.SetSize(icon.GetWidth() + message.GetWidth(), (icon.GetHeight() > message.GetHeight()) ? (icon.GetHeight()) : (message.GetHeight()));
    if (--horizontal > 0) {
        rx.AddWidth(_space * horizontal);
    }
    if (--vertical > 0) {
        rx.AddHeight(_space * vertical);
    }
    rx.SetSize((rx.GetWidth() > button.GetWidth()) ? (rx.GetWidth()) : (button.GetWidth()), rx.GetHeight() + button.GetHeight());
    rectangle->SetSize(rx.GetSize());
    rectangle->Inflate(_frame, _frame);
    return;
}// SFZMessageDialog::HandleBoundRequest //

Reference

SFYResponder::GetSuitableBound | SFXEvent | Real Region Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND] SFZTextButtonControl::HandleBoundRequest | SFZMultipleTextLabelControl::HandleBoundRequest | SFZImageLabelControl::HandleBoundRequest | Real Region | Local Region | Virtual Region | Getting the Suitable Size of Responder for Displaying a Multiple Text | SFZMessageDialog::SetFrameSize | SFZMessageDialog::SetSpaceSize


SFZMessageDialog::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.

This function will relocate the icon, the message, and the button within this dialog when the virtual region is changed.

[Caution] CAUTION

If the icon, the message, or the button is omitted, the corresponding item will not be relocated.

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

/*protected virtual */Void SFZMessageDialog::HandleBoundVirtual(Void)
{
    Relocate();
    return;
}// SFZMessageDialog::HandleBoundVirtual //

/*private */Void SFZMessageDialog::Relocate(Void)
{
    SFXRectangle                                lx;
    SFXRectangle                                icon;
    SFXRectangle                                message;
    SFXRectangle                                button;

    lx.Set(GetLocalBound());
    lx.Deflate(_frame, _frame);
    icon.Set(SFXRectangle::ZeroInstance());
    message.Set(SFXRectangle::ZeroInstance());
    button.Set(SFXRectangle::ZeroInstance());
    if (_button->GetStateVisible()) {
        button.Set(_button->GetSuitableBound(lx));
        button.SnapLeftBottom(lx.GetLeftBottom());
        if (!button.IsEmpty()) {
            button.SetRight(lx.GetRight());
            lx.SubBottom(button.GetHeight() + _space);
        }
    }
    if (_icon->GetStateVisible()) {
        icon.Set(_icon->GetSuitableBound(lx));
        icon.SnapLeftTop(lx.GetLeftTop());
        if (!icon.IsEmpty()) {
            lx.AddLeft(icon.GetWidth() + _space);
        }
    }
    if (_message->GetStateVisible()) {
        message.Set(_message->GetSuitableBound(lx));
        message.SnapRightTop(lx.GetRightTop());
        if (!message.IsEmpty()) {
            message.SetLeftBottom(lx.GetLeftBottom());
        }
    }
    _icon->SetRealBound(icon);
    _message->SetRealBound(message);
    _button->SetRealBound(button);
    return;
}// SFZMessageDialog::Relocate //

Reference

SFYResponder::SetRealBound | SFYResponder::SetVirtualBound | Virtual Region | Region Event[SFEVT_RESPONDER_BOUND] | Handler for the Region Event[XANDLER_DECLARE_VOIDBOUND] SFZTextButtonControl::HandleBoundRequest | SFZMultipleTextLabelControl::HandleBoundRequest | SFZImageLabelControl::HandleBoundRequest | SFZMessageDialog::SetFrameSize | SFZMessageDialog::SetSpaceSize


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

SFZMessageDialogSmp _messagedialog;
SFCError error;

if ((_messagedialog = SFZMessageDialog::NewInstance(&error)) != null) {

    ...
}

SFZMessageDialog::SetButtonText
Set the button text of this dialog to the specified value.
[ public ]
SFCError SetButtonText(
    SFXPathConstRef path   // path to resource file
    UInt16 id              // object id
);
[ public ]
SFCError SetButtonText(
    SFXWideStringConstRef param   // text to set
);

Description

This function sets the button text of this dialog to the specified value.

If the button text is not set using this function, the button will not be displayed on this dialog.

In addition, the text set with this function is internally contained by the instance of the SFZTextButtonControl class. This instance can be obtained by calling the SFZMessageDialog::GetButton function.

Reference

SFZMessageDialog::GetButtonText | SFZMessageDialog::GetButton | SFZTextButtonControl | SFXWideString


SFZMessageDialog::SetFrameSize
Set the size of the frame margin of this dialog to the specified value. [pixels]
[ public ]
Void SetFrameSize(
    SInt16 param   // value to set
);

Description

This function sets the size of the frame margin of this dialog to the specified value. [pixels]

Default: SFZMessageDialog::DEFAULT_FRAME [5 pixels]

[Note] Frame margin

Frame margin is the margin between the border and the controls of this dialog. This margin has the same value from the top, bottom, left, and right edges of this dialog.

The icon, the message, and the button are placed at the left-top, right-top, and bottom of this dialog with this frame margin respectively.

Figure 345. Frame margin[SFZMessageDialog(Expanded Figure)]


Frame margin[SFZMessageDialog(Expanded Figure)]

The icon, the message, and the button of the dialog are placed in the region surrounded by the frame margin.

Reference

SFZMessageDialog::GetFrameSize | SFZMessageDialog::DefaultEnum


SFZMessageDialog::SetIconImage
Set the icon image of this dialog to the specified value.
[ public ]
SFCError SetIconImage(
    SFXPathConstRef path   // path to resource file
);
[ public ]
SFCError SetIconImage(
    SFXPathConstRef path   // path to resource file
    UInt16 id              // object id
);
[ public ]
SFCError SetIconImage(
    SFBImageSmpConstRef param   // image to set
);

Description

This function sets the icon image of this dialog by specifying the image object directly or reading from the resource file.

The image of which size is in valid or the animated bitmap cannot be used.

If the icon image is not set using this function, the corresponding icon will not be displayed on this dialog.

In addition, the icon image set with this function is contained as the instance of SFZImageLabelControl class. This instance can be obtained by calling the SFZMessageDialog::GetIcon function.

Reference

SFZMessageDialog::GetIconImage | SFZMessageDialog::GetIcon | SFZImageLabelControl | SFBImage | BREW API IImage


SFZMessageDialog::SetMessageText
Set the message text of this dialog to the specified value.
[ public ]
SFCError SetMessageText(
    SFXPathConstRef path   // path to resource file
    UInt16 id              // object id
);
[ public ]
SFCError SetMessageText(
    SFXWideStringConstRef param   // text to set
);

Description

This function sets the message text of this dialog by specifying the image object directly or reading from the resource file.

If the message text is not set using this function, the message will not be displayed on this dialog.

In addition, the icon image set with this function is contained as the instance of SFZMultipleTextLabelControl class. This instance can be obtained by calling the SFZMessageDialog::GetMessage function.

Reference

SFZMessageDialog::GetMessageText | SFZMessageDialog::GetMessage | SFZMultipleTextLabelControl | SFXWideString


SFZMessageDialog::SetSpaceSize
Set the size of the space margin of this dialog to the specified value. [pixels]
[ public ]
Void SetSpaceSize(
    SInt16 param   // value to set
);

Description

This function sets the size of the space margin of this dialog to the specified value. [pixels]

When calculating the suitable size of this dialog automatically, the controls are placed with the space margin between them.

Default: SFZMessageDialog::DEFAULT_SPACE [5 pixels]

[Note] Space margin

Space margin is the margin between the controls of this dialog.

The space margin is set between the icon and the message, and between the message and the button.

If the height of the dialog region is big, the space between the message and the button may be bigger than the space margin.

Figure 346. Space margin[SFZMessageDialog(Expanded Figure)]


Space margin[SFZMessageDialog(Expanded Figure)]

The space margin is set between the icon and the message, and between the message and the button.

If the height of the dialog region is big, the space between the message and the button may be bigger than the space margin.

Reference

SFZMessageDialog::GetSpaceSize | SFZMessageDialog::DefaultEnum


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

Reference

SFYResponder::GetType | SFYResponder::SetType


SFZMessageDialog::DefaultEnum
Constant that represents the default values of the frame margin and the space margin.
  
enum DefaultEnum {
    DEFAULT_FRAME  = 5,  // default values of frame margin [5 pixels]
    DEFAULT_SPACE  = 5   // default values of space margin [5 pixels]
};
SFMTYPEDEFTYPE(CodeEnum)

Description

[Note] Frame margin

Frame margin is the margin between the border and the controls of this dialog. This margin has the same value from the top, bottom, left, and right edges of this dialog.

The icon, the message, and the button are placed at the left-top, right-top, and bottom of this dialog with this frame margin respectively.

Figure 347. Frame margin[SFZMessageDialog(Expanded Figure)]


Frame margin[SFZMessageDialog(Expanded Figure)]

The icon, the message, and the button of the dialog are placed in the region surrounded by the frame margin.

[Note] Space margin

Space margin is the margin between the controls of this dialog.

The space margin is set between the icon and the message, and between the message and the button.

If the height of the dialog region is big, the space between the message and the button may be bigger than the space margin.

Figure 348. Space margin[SFZMessageDialog(Expanded Figure)]


Space margin[SFZMessageDialog(Expanded Figure)]

The space margin is set between the icon and the message, and between the message and the button.

If the height of the dialog region is big, the space between the message and the button may be bigger than the space margin.

Reference

SFZMessageDialog::SetFrameSize | SFZMessageDialog::SetSpaceSize