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

Inheritance diagram

 Inheritance diagram of SFZQuestionDialogClass

Collaboration diagram

 Collaboration diagram of SFZQuestionDialogClass

Description

How to use

SFZQuestionDialog is the dialog to display a selection message, which consists of the icon image, the message text, the ANOTHER button, the OK button, and the CANCEL button.

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

Figure 360. Example: The bahaviour of SFZQuestionDialog

Example: The bahaviour of SFZQuestionDialog

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

Since the states of the icon image and the message text are set to "disable", the focus cannot be moved to these objects. The ANOTHER, OK, and CANCEL buttons, whose states are set to "enable", can be focused with the scroll keys set using the SFYContainer::SetScrollUpKey and SFYContainer::SetScrollDownKey functions. When the dialog is first displayed on the device screen, the button set last using the SFZQuestionDialog::SetButtonText function is focused.

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

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

  • Result event [SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_OK, 0)] : This event will occur in the internal handler for the OK button or in the SFZDialog::HandleOperateKey function when the OK button or the operation key of the dialog is pressed.
  • Result event [SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_CANCEL, 0)] : This event will occur in the internal handler for the CANCEL button when the CANCEL button is pressed.
  • Result event [SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_ANOTHER, 0)] : This event will occur in the internal handler for the ANOTHER button when the ANOTHER button is pressed.
  • Result event [SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_ESCAPE, 0)] : when the ESCAPE key is pressed, or when the time set with the SFZDialog::ScheduleTimer function elapses

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 ANOTHER, CANCEL, and OK buttons 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, the OK button, the CANCEL button or the ANOTHER button is pressed.
[Note] Operating a dialog with its operation key

If all buttons are omitted or their states are set to "disable", 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 SFZQuestionDialog, 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 891. 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 892. Implementation

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

  SFZQuestionDialogSmp dialog;  // smart pointer of SFZQuestionDialog
  SFCError error(SFERR_NO_ERROR);

  // create the dialog
  if ((dialog = SFZQuestionDialog::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
        // * image can be set from the resource 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 question message.");
          if (error == SFERR_NO_ERROR) {

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

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

                // set the text for the dialog's OK button
                // since the text of OK button is set last, first OK button is displayed in the focus state
                // * SFXWideString text can be set from the resource file
                error = dialog->SetButtonText(SFZQuestionDialog::BUTTON_OK, "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_CANCEL:

            // when the CANCEL button is pressed

            ...

            break;
        case SFP16_RESULT_ANOTHER:

            // when the OTHER button 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 361. Execution result of the above sample code [SFZQuestionDialog]


Execution result of the above sample code [SFZQuestionDialog]

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 893.  Sample code: Attach a bevel frame with a title to a dialog [SFZQuestionDialog 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
  SFZQuestionDialogSmp  dialog; // smart pointer to SFZQuestionDialog
  SFCError              error(SFERR_NO_ERROR);

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

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

    // 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 = SFZQuestionDialog::NewInstance(&error)) != null) {

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

        // set dialog's frame
        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 question dialog with a title bevel frame.");
              if (error == SFERR_NO_ERROR) {

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

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

                    // set the text to the dialog's OK button
                    // OK button is focused since the text for this button is set last
                    // * SFXWideString text can be set from the resource file
                    error = dialog->SetButtonText(SFZQuestionDialog::BUTTON_OK, "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));

                      // move the dialog foremost
                      // * automatically, the frame will be moved foremost 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_CANCEL:

      // when the CANCEL button is pressed

      ...

     break;

    case SFP16_RESULT_ANOTHER:

      // when the ANOTHER button 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 362. Execution result of the above code [SFZQuestionDialog and SFZTitleBevelFrame]


Execution result of the above code [SFZQuestionDialog と 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 Display a Selection Message [SFZQuestionDialog] | SFZDialog | SFZMessageDialog | SFZImageLabelControl | SFZMultipleTextLabelControl | SFZTextButtonControl | SFYWidget | SFXRGBColor | SFYWidget::SetBackgroundColor | SFZQuestionDialog::SetIconImage | SFZQuestionDialog::SetMessageText | SFZQuestionDialog::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
SFZQuestionDialog( Void )
Constructor of the SFZQuestionDialog class.
~SFZQuestionDialog( Void )
Destructor of the SFZQuestionDialog class.
Public Functions
SFXWideStringConstRef GetButton( ButtonEnum button )
Get the button control of this dialog.
SFXWideStringConstRef GetButtonText( ButtonEnum button )
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
SFZQuestionDialogSmp
NewInstance( SFCErrorPtr exception = null )
Create a new instance of this responder class.
SFCError SetButtonText( ButtonEnum button , SFXPathConstRef path , UInt16 id )
Set the button text of this dialog to the specified value.
SFCError SetButtonText( ButtonEnum button , SFXWideStringConstRef param )
Set the button text of this dialog to the specified value.
Void SetFrameSize( SInt16 param )
Set the size of 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
ButtonEnum
Constant that represents the button identifier of this dialog.
CodeEnum
Constant that represents the SFZQuestionDialog 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.

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

Description

This constructor performs the initializations as follows:

  1. Set the type of this responder to "dqst".
  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 SFZQuestionDialog::DEFAULT_FRAME.
  5. Set the size of the space margin to SFZQuestionDialog::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 one of its buttons is pressed.

Reference

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


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

Description

This destructor does nothing.


SFZQuestionDialog::GetButton
Get the button control of this dialog.
[ public, const ]
SFXWideStringConstRef GetButtonText(
    ButtonEnum button   // button enum
);

Return value

Text button control(SFZTextButtonControl) which the SFZQuestionDialog class contains as the ANOTHER, CANCEL, or OK button internally.

Description

This function gets the instance of the SFZTextButtonControl class which the SFZQuestionDialog 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

SFZQuestionDialog::SetButtonText | SFZTextButtonControl | SFZQuestionDialog::ButtonEnum


SFZQuestionDialog::GetButtonText
Get the button text of this dialog.
[ public, const ]
SFXWideStringConstRef GetButtonText(
    ButtonEnum button   // button enum
);

Description

This function gets the text of the button which is specified in the "button" argument.

Reference

SFZQuestionDialog::SetButtonText | SFZQuestionDialog::ButtonEnum | SFXWideString


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

Reference

SFZQuestionDialog::SetFrameSize


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

Description

This function gets the instance of the SFZImageLabelControl class which SFZQuestionDialog 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

SFZQuestionDialog::SetIconImage | SFZImageLabelControl


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

Reference

SFZQuestionDialog::SetIconImage | SFBImage | BREW API IImage


SFZQuestionDialog::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 SFZQuestionDialog 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

SFZQuestionDialog::SetMessageText | SFZMultipleTextLabelControl


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

Reference

SFZQuestionDialog::SetMessageText | SFXWideString


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

Reference

SFZQuestionDialog::SetSpaceSize


SFZQuestionDialog::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 SFZQuestionDialog::HandleBoundOptimize function is as follows:

/*protected virtual */Void SFZQuestionDialog::HandleBoundOptimize(SFXRectanglePtr rectangle) const
{
    SFXRectangle                                rx;
    SFXSize                                     icon;
    SFXSize                                     message;
    SFXSize                                     button[BUTTON_LIMIT];
    SInt32                                      r0;
    SInt16                                      horizontal;
    SInt16                                      vertical;

    rectangle->Deflate(_frame, _frame);
    rx.Set(*rectangle);
    icon.Set(SFXSize::ZeroInstance());
    message.Set(SFXSize::ZeroInstance());
    for (r0 = 0; r0 < BUTTON_LIMIT; ++r0) {
        button[r0].Set(SFXSize::ZeroInstance());
    }
    horizontal = 0;
    vertical = 0;
    for (r0 = BUTTON_LIMIT - 1; r0 >= 0; --r0) {
        if (_button[r0]->GetStateVisible()) {
            button[r0].Set(_button[r0]->GetSuitableBound(rx).GetSize());
            if (!button[r0].IsEmpty()) {
                rx.SubBottom(button[r0].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);
    }
    for (r0 = 0; r0 < BUTTON_LIMIT; ++r0) {
        rx.SetWidth((rx.GetWidth() > button[r0].GetWidth()) ? (rx.GetWidth()) : (button[r0].GetWidth()));
        rx.AddHeight(button[r0].GetHeight());
    }
    rectangle->SetSize(rx.GetSize());
    rectangle->Inflate(_frame, _frame);
    return;
}// SFZQuestionDialog::HandleBoundOptimize //

Reference

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


SFZQuestionDialog::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 SFZQuestionDialog::HandleBoundReal function is as follows:

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

Reference

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


SFZQuestionDialog::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 SFZQuestionDialog::HandleBoundRequest function is as follows:

/*protected virtual */Void SFZQuestionDialog::HandleBoundRequest(SFXRectanglePtr rectangle) const
{
    SFXRectangle                                rx;
    SFXRectangle                                lx;
    SFXSize                                     icon;
    SFXSize                                     message;
    SFXSize                                     button[BUTTON_LIMIT];
    SInt32                                      r0;
    SInt16                                      horizontal;
    SInt16                                      vertical;

    rectangle->Deflate(_frame, _frame);
    rx.Set(*rectangle);
    icon.Set(SFXSize::ZeroInstance());
    message.Set(SFXSize::ZeroInstance());
    for (r0 = 0; r0 < BUTTON_LIMIT; ++r0) {
        button[r0].Set(SFXSize::ZeroInstance());
    }
    horizontal = 0;
    vertical = 0;
    for (r0 = BUTTON_LIMIT - 1; r0 >= 0; --r0) {
        if (_button[r0]->GetStateVisible()) {
            button[r0].Set(_button[r0]->GetSuitableBound().GetSize());
            if (!button[r0].IsEmpty()) {
                rx.SetWidth((rx.GetWidth() > button[r0].GetWidth()) ? (rx.GetWidth()) : (button[r0].GetWidth()));
                rx.SubBottom(button[r0].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);
    }
    for (r0 = 0; r0 < BUTTON_LIMIT; ++r0) {
        rx.SetWidth((rx.GetWidth() > button[r0].GetWidth()) ? (rx.GetWidth()) : (button[r0].GetWidth()));
        rx.AddHeight(button[r0].GetHeight());
    }
    rectangle->SetSize(rx.GetSize());
    rectangle->Inflate(_frame, _frame);
    return;
}// SFZQuestionDialog::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 | SFZQuestionDialog::SetFrameSize | SFZQuestionDialog::SetSpaceSize


SFZQuestionDialog::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, the ANOTHER button, the OK button, or the CANCEL 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 SFZQuestionDialog::HandleBoundVirtual function is as follows:

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

/*private */Void SFZQuestionDialog::Relocate(Void)
{
    SFXRectangle                                lx;
    SFXRectangle                                icon;
    SFXRectangle                                message;
    SFXRectangle                                button[BUTTON_LIMIT];
    SInt32                                      r0;

    lx.Set(GetLocalBound());
    lx.Deflate(_frame, _frame);
    icon.Set(SFXRectangle::ZeroInstance());
    message.Set(SFXRectangle::ZeroInstance());
    for (r0 = 0; r0 < BUTTON_LIMIT; ++r0) {
        button[r0].Set(SFXRectangle::ZeroInstance());
    }
    for (r0 = BUTTON_LIMIT - 1; r0 >= 0; --r0) {
        if (_button[r0]->GetStateVisible()) {
            button[r0].Set(_button[r0]->GetSuitableBound(lx));
            button[r0].SnapLeftBottom(lx.GetLeftBottom());
            if (!button[r0].IsEmpty()) {
                button[r0].SetRight(lx.GetRight());
                lx.SubBottom(button[r0].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);
    for (r0 = 0; r0 < BUTTON_LIMIT; ++r0) {
        _button[r0]->SetRealBound(button[r0]);
    }
    return;
}// SFZQuestionDialog::Relocate //

Reference

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


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

SFZQuestionDialogSmp _questiondialog;
SFCError error;

if ((_questiondialog = SFZQuestionDialog::NewInstance(&error)) != null) {

    ...
}

SFZQuestionDialog::SetButtonText
Set the button text of this dialog to the specified value.
[ public ]
SFCError SetButtonText(
    ButtonEnum button      // button enum to set
    SFXPathConstRef path   // path to resource file
    UInt16 id              // object id
);
[ public ]
SFCError SetButtonText(
    ButtonEnum button             // button enum to set
    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 corresponding 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 SFZQuestionDialog::GetButton function.

Reference

SFZQuestionDialog::GetButtonText | SFZQuestionDialog::ButtonEnum | SFZQuestionDialog::GetButton | SFZTextButtonControl | SFXWideString


SFZQuestionDialog::SetFrameSize
Set the size of 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 frame margin of this dialog to the specified value. [pixels]

Default: SFZQuestionDialog::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 363. Frame margin[SFZQuestionDialog(Expanded Figure)]


Frame margin[SFZQuestionDialog(Expanded Figure)]

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

Reference

SFZQuestionDialog::GetFrameSize | SFZQuestionDialog::DefaultEnum


SFZQuestionDialog::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 SFZQuestionDialog::GetIcon function.

Reference

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


SFZQuestionDialog::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 SFZQuestionDialog::GetMessage function.

Reference

SFZQuestionDialog::GetMessageText | SFZQuestionDialog::GetMessage | SFZMultipleTextLabelControl | SFXWideString


SFZQuestionDialog::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: SFZQuestionDialog::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 364. Space margin[SFZQuestionDialog(Expanded Figure)]


Space margin[SFZQuestionDialog(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

SFZQuestionDialog::GetSpaceSize | SFZQuestionDialog::DefaultEnum


SFZQuestionDialog::ButtonEnum
Constant that represents the button identifier of this dialog.
  
enum ButtonEnum {
    BUTTON_ANOTHER  = 0,
    BUTTON_OK,
    BUTTON_CANCEL,
    BUTTON_LIMIT
};
SFMTYPEDEFTYPE(CodeEnum)

SFZQuestionDialog::CodeEnum
Constant that represents the SFZQuestionDialog class.
enum CodeEnum {
    CODE_TYPE = four_char_code('d', 'q', 's', 't')
};
SFMTYPEDEFTYPE(CodeEnum)

Reference

SFYResponder::GetType | SFYResponder::SetType


SFZQuestionDialog::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 365. Frame margin[SFZQuestionDialog(Expanded Figure)]


Frame margin[SFZQuestionDialog(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 366. Space margin[SFZQuestionDialog(Expanded Figure)]


Space margin[SFZQuestionDialog(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

SFZQuestionDialog::SetFrameSize | SFZQuestionDialog::SetSpaceSize