SophiaFramework UNIVERSE 5.3 |
How to use
SFZDialog is the general purpose container and the abstract base class for all dialogs with functions to scroll the virtual region larger than the real region, move the focus, automatically close itself after specified period elapses, and handle some key events by default.
For instance, dialogs such as SFZMessageDialog or SFZQuestionDialog is implemented by inheriting from SFZDialog.
Note | |
---|---|
Dialog is the responder designed to be placed in the root[SFZRoot]. |
Though a dialog can be used as a container to place controls like a window, it is used for user to select a result from screen displayed temporarily.
The concrete dialog is the part class which can be used as it is in the applet development. On the other hand, the abstract dialog is the base class to define and implement a user-defined dialog.
Table 225. Concrete dialog's type
Class name | Description |
---|---|
SFZDialog | General purpose dialog to place controls, containers etc. |
SFZMessageDialog | Dialog to display a notification message. |
SFZQuestionDialog | Dialog to display a selection message. |
IMPORTANT | |
---|---|
In the concrete dialog, the SFYResponder::SetParent, SFYResponder::SetState, and SFYResponder::SetRealBound functions must be always called. Other functions are optionally called. * When a frame is attached to a dialog with the SFYResponder::SetFrame function, calling the SFYResponder::SetRealBound function of the dialog can be omitted by setting the real region of the frame with the SFYResponder::SetRealBound function since that of the dialog will be internally set to the region obtained by deflating it by the frame margin. |
Default background color | |
---|---|
In SFZDialog, the default background color set with the SFYWidget::SetBackgroundColor function is the gray color[SFXRGBColor(0xEE, 0xEE, 0xEE,0x00)]. |
Table 226. Abstract dialog's type
Class name | Description |
---|---|
SFZDialog | Abstract class which represents a dialog. |
General purpose dialog to place controls, containers etc. [SFZDialog]
SFZDialog is the general purpose dialog to place various controls or containers.
When controls and/or containers are placed, the focus can be moved using the scroll key set with the SFYContainer::SetScrollDownKey / SFYContainer::SetScrollUpKey / SFYContainer::SetPageDownKey / SFYContainer::SetPageUpKey / SFYContainer::SetSnapDownKey / SFYContainer::SetSnapUpKey functions.
The virtual region larger than the real region can be scrolled up and down, and the focus can be moved among responders in the window. At this time, scrolling is performed in cooperation with moving the focus.
In the default implementation, the general purpose dialog[SFZDialog] will receive the following result events[SFEVT_RESPONDER_RESULT].
The developer can register handlers for these events. The default handler closes the dialog only.
The operation key of the dialog is set with the SFZDialog::SetOperateKey function. By default, the operation key of the dialog is set to the SELECT key.
The ESCAPE key is set with the SFZDialog::SetEscapeKey function. By default, the ESCAPE key is set to the CLEAR key.
Note | |
---|---|
The timer processing callback scheduled with the SFZDialog::ScheduleTimer function will be canceled automatically when the operation key of the dialog or the ESCAPE key is pressed. |
Sample code of the dialog
The sample code of the dialog(SFZDialog) is as follows:
Example 881. Declaration
SFMTYPEDEFCLASS(USRApplication)
class USRApplication: public SFYApplication {
SFMSEALCOPY(USRApplication)
private:
static SFCInvokerPtr Factory(Void);
private:
explicit USRApplication(Void) static_throws;
virtual ~USRApplication(Void);
// result handler
XANDLER_DECLARE_VOIDRESULT(OnResult)
};
Example 882. Implementation
USRApplication::USRApplication(Void) static_throws { // ... (omitted) ... SFZDialogSmp dialog; // smart pointer of SFZDialog SFCError error(SFERR_NO_ERROR); // create the dialog if ((dialog = SFZDialog::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) { // Calculate the suitable dialog region within the hint region obtained by deflating the screen device region by (20, 20), // 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 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; }
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 883. Sample code: Attach a bevel frame with a title to a dialog [SFZDialog 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) ..... SFCError error(SFERR_NO_ERROR); SFZTitleBevelFrameSmp frame; // smart pointer to SFZTitleBevelFrame SFZDialogSmp dialog; // smart pointer to SFZDialog // create the frame if ((frame = SFZTitleBevelFrame::NewInstance(&error)) != null) { // set the 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 the dialog if ((dialog = SFZDialog::NewInstance(&error)) != null) { // set the 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) { // 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 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; }
General purpose dialog as abstract class which represents a dialog [SFZDialog]
SFZDialog is the base class, which the user-defined dialog inherits from to implement itself.
For instance, the dialog such as SFZMessageDialog or SFZQuestionDialog is implemented by inheriting from the SFZDialog class.
In SFZDialog, there are functions to close itself after the specified period, to scroll up and down the virtual region larger than the real region in cooperation with the move-focus function, manage the dialog operation, ESCAPE key, and scroll keys, and implement some default handlers(virtual functions).
When controls and/or containers are placed in the dialog, the focus can be moved among the child responders of the dialog using the scroll key set with the SFYContainer::SetScrollDownKey and SFYContainer::SetScrollUpKey functions.
The virtual region larger than the real region can be scrolled up and down, and the focus can be moved among the child responders of the dialog . At this time, scrolling is performed in cooperation with moving the focus.
In the default implementation, the abstract dialog[SFZDialog] will receive the following result events[SFEVT_RESPONDER_RESULT].
The developer can register handlers for these events. The default handler closes the dialog only.
The operation key of the dialog is set with the SFZDialog::SetOperateKey function. By default, the operation key of the dialog is set to the SELECT key.
The ESCAPE key is set with the SFZDialog::SetEscapeKey function. By default, the ESCAPE key is set to the CLEAR key.
Note | |
---|---|
The timer processing callback scheduled with the SFZDialog::ScheduleTimer function will be canceled automatically when the operation key of the dialog or the ESCAPE key is pressed. |
Events and their handlers
The handlers(virtual functions) below for the key event[SFEVT_KEY] on the dialog operation, ESCAPE, and scroll keys, the region event[SFEVT_RESPONDER_BOUND], and the drawing event[SFEVT_RESPONDER_RENDER] are registered.
In a dialog inheriting from SFZDialog, the following handlers(virtual functions) will be booted up first when the event is received.
Table 227. Events and their Handlers
Event | Handler(Virtual function) | Default behaviour | Override |
---|---|---|---|
SFEVT_KEY event of the operation key set with SFZDialog::SetOperateKey | SFZDialog::HandleOperateKey | Send the result event *1 | Optional |
SFEVT_KEY event of the ESCAPE key set with SFZDialog::SetEscapeKey | SFZDialog::HandleEscapeKey | Send the result event *2 | Optional |
SFEVT_KEY event of the ScrollUp key set with SFYContainer::SetScrollUpKey | SFYContainer::HandleScrollUpKey | Scroll up the virtual region *3 | Optional |
SFEVT_KEY event of the ScrollDown key set with SFYContainer::SetScrollDownKey | SFYContainer::HandleScrollDownKey | Scroll down the virtual region *4 | Optional |
SFEVT_KEY event of the PageUp key set with SFYContainer::SetPageUpKey | SFYContainer::HandlePageUpKey | Scroll up the virtual region by 1 page *5 | Optional |
SFEVT_KEY event of the PageDown key set with SFYContainer::SetPageDownKey | SFYContainer::HandlePageDownKey | Scroll down the virtual region by 1 page *6 | Optional |
SFEVT_KEY event of the SnapUp key set with SFYContainer::SetSnapUpKey | SFYContainer::HandleSnapUpKey | Scroll up the virtual region to the top *7 | Optional |
SFEVT_KEY event of the SnapDown key set with SFYContainer::SetSnapDownKey | SFYContainer::HandleSnapDownKey | Scroll down the virtual region to the bottom *8 | Optional |
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event | SFYWidget::HandleBoundRequest | - | Recommended |
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE) event | SFYWidget::HandleBoundOptimize | - | Recommended |
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event | SFYWidget::HandleBoundReal | - | Optional |
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event | SFYWidget::HandleBoundVirtual | - | Optional |
(SFEVT_RESPONDER_BOUND, SFP16_BOUND_GLOBAL) event | SFYWidget::HandleBoundGlobal | - | Optional |
(SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event | SFYWidget::HandleRenderRequest | - | Optional |
* "-" in the default behaviour column represents that nothing is implemented.
NOTE | |
---|---|
*1. Execute SFYResponder::InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_OK, 0), false). And cancel the timer processing callback scheduled with the SFZDialog::ScheduleTimer function, if any. *2. Execute SFYResponder::InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_ESCAPE, 0), false). And cancel the timer processing callback scheduled with the SFZDialog::ScheduleTimer function, if any. *3. Execute the SFYContainer::ScrollUp function. *4. Execute the SFYContainer::ScrollDown function. *5. Execute the SFYContainer::PageUp function. *6. Execute the SFYContainer::PageDown function. *7. Execute the SFYContainer::SnapUp function. *8. Execute the SFYContainer::SnapDown function. |
The minimum code necessary to make a user-defined dialog is as follows:
Example 884. Declaration
SFMTYPEDEFRESPONDER(USRDialog) class USRDialog: public SFZDialog { SFMSEALRESPONDER(USRDialog) SFMRESPONDERINSTANTIATEFIVE(USRDialog, SFZDialog, SFZWindow, SFYContainer, SFYWidget, SFYResponder) public: // define responder type // small alphabet and symbol must not be used since they are reserved for SophiaFramework UNIVERSE enum CodeEnum { CODE_TYPE = four_char_code('U', 'D', 'L', 'G') }; SFMTYPEDEFTYPE(CodeEnum) public: static USRDialogSmp NewInstance(SFCErrorPtr exception = null); protected: explicit USRDialog(Void) static_throws; virtual ~USRDialog(Void); // virtual functions defined in the parent class and recommended to be implemented virtual Void HandleBoundRequest(SFXRectanglePtr rectangle) const; virtual Void HandleBoundOptimize(SFXRectanglePtr rectangle) const; virtual Void HandleBoundReal(Void); virtual Void HandleBoundVirtual(Void); virtual Void HandleRenderRequest(SFXGraphicsPtr graphics) const; };
Example 885. Implementation
USRDialog::USRDialog(Void) static_throws { if (static_try()) { // set the responder type SetType(CODE_TYPE); // here describe the initialization } } USRDialog::~USRDialog(Void) { // here describe the finalization } USRDialogSmp USRDialog::NewInstance(SFCErrorPtr exception) { return static_pointer_cast<USRDialog>(Factory(::new USRDialog, exception)); } Void USRDialog::HandleBoundRequest(SFXRectanglePtr rectangle) const { // calculate the suitable dialog size // set the rectangle argument to the calculated suitable dialog size // for the rectangle argument, it is recommended to set only its size and not to change its origin in this function return; } Void USRDialog::HandleBoundOptimize(SFXRectanglePtr rectangle) const { // calculate the suitable dialog size within rectangular region given by the rectangle argument // set the rectangle argument to the calculated suitable dialog size // for the rectangle argument, it is recommended to set only its size and not to change its origin in this function return; } Void USRDialog::HandleBoundReal(Void) { // here describe the size recalculation if necessary when the real region is changed return; } Void USRDialog::HandleBoundVirtual(Void) { // here describe the size recalculation if necessary when the virtual region is changed return; } Void USRDialog::HandleRenderRequest(SFXGraphicsPtr graphics) const { // draw the dialog return; }
Dialog(Basic) | SFZMessageDialog | SFZQuestionDialog | SFZWindow | SFYContainer | SFYWidget | SFXRGBColor | SFYWidget::SetBackgroundColor | Frame | SFYResponder::ToFront | SFYResponder::Terminate | Virtual Region | Real Region | Local Region | SFZDialog::SetOperateKey | SFZDialog::SetEscapeKey | SFYContainer::SetScrollDownKey | SFYContainer::SetScrollUpKey | SFYContainer::SetPageDownKey | SFYContainer::SetPageUpKey | SFYContainer::SetSnapDownKey | SFYContainer::SetSnapUpKey | Key Event[SFEVT_KEY] | Region Event[SFEVT_RESPONDER_BOUND] | Drawing Event[SFEVT_RESPONDER_RENDER]
Constructor/Destructor |
---|
SFZDialog( Void ) Constructor of the SFZDialog class.
|
~SFZDialog( Void ) Destructor of the SFZDialog class.
|
Public Functions | |
---|---|
Void |
CancelTimer( Void ) Cancel the timer of this dialog.
|
AVKType |
GetEscapeKey( Void ) Get the ESCAPE key of this dialog.
|
AVKType |
GetOperateKey( Void ) Get the operation key of this dialog.
|
static SFZDialogSmp |
NewInstance(
SFCErrorPtr exception = null
) Create a new instance of this responder class.
|
Void |
RewindTimer( Void ) Reset the time until this dialog is automatically closed.
|
Void |
ScheduleTimer(
UInt32 param
)
Schedule the timer that HandleEscapeKey() will be called after the specified time elapses. [milliseconds]
|
Void |
SetEscapeKey(
AVKType param
) Set the ESCAPE key of this dialog to the specified value.
|
Void |
SetOperateKey(
AVKType param
) Set the operation key of this dialog to the specified value.
|
Void |
ClearHandler( Void )
(inherits from SFYResponder)
Unregister all handlers from this responder.
|
Void |
ClearTracer( Void )
(inherits from SFYResponder)
Unregister all dispatching rules from the tracer of this responder.
|
SFCError |
Distribute(
SFXEventConstRef event
, BoolPtr result = null
)
(inherits from SFYResponder)
Distribute the specified event.
|
SFXRGBColorConstRef |
GetBackgroundColor( Void )
(inherits from SFYWidget)
Get the background color.
|
SFYResponderSmp |
GetChildBack( Void )
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBack(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBack(
UInt32 id
)
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBack(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the backmost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBackward(
SInt32 index
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBackward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBackward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildBackward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the back side,
which matches the specified search condition.
|
SInt32 |
GetChildCount( Void )
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
SInt32 |
GetChildCount(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
SInt32 |
GetChildCount(
UInt32 id
)
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
SInt32 |
GetChildCount(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the number of child responders of this responder,
which match the specified search condition.
|
SFYResponderSmp |
GetChildForward(
SInt32 index
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildForward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildForward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildForward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the child responder of this responder at the specified position from the front side,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildFront( Void )
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildFront(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildFront(
UInt32 id
)
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
SFYResponderSmp |
GetChildFront(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the foremost child responder of this responder,
which matches the specified search condition.
|
SFYDistributerPtr |
GetDistributer( Void )
(inherits from SFYResponder)
Get the distributer bound with this responder.
|
SFYResponderSmp |
GetFrame( Void )
(inherits from SFYResponder)
Get the frame which has been attached to this responder.
|
SFXRectangle |
GetGlobalBound( Void )
(inherits from SFYResponder)
Get the globle region of this responder.
|
UInt32 |
GetID( Void )
(inherits from SFYResponder)
Get the ID of this responder instance.
|
SFXRectangle |
GetLocalBound( Void )
(inherits from SFYResponder)
Get the local region of this responder.
|
SInt32 |
GetNthBackward( Void )
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthBackward(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthBackward(
UInt32 id
)
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthBackward(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthForward( Void )
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthForward(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthForward(
UInt32 id
)
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
SInt32 |
GetNthForward(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders,
which match the specified search condition.
|
SFYResponderSmp |
GetParent( Void )
(inherits from SFYResponder)
Get the parent responder of this responder.
|
Bool |
GetPropertyTransparent( Void )
(inherits from SFYResponder)
Get the transparency attribute of this responder.
|
SFXRectangleConstRef |
GetRealBound( Void )
(inherits from SFYResponder)
Get the real region of this responder.
|
VoidPtr |
GetReference( Void )
(inherits from SFYResponder)
Get the reference of this responder.
|
SFYRendererPtr |
GetRenderer( Void )
(inherits from SFYResponder)
Get the renderer bound with this responder.
|
SFYResponderSmp |
GetRoot( Void )
(inherits from SFYResponder)
Get the root responder.
|
Bool |
GetStateActive(
Bool inherit = false
)
(inherits from SFYResponder)
Get the active state of this responder.
|
Bool |
GetStateEnable(
Bool inherit = false
)
(inherits from SFYResponder)
Get the enable state of this responder.
|
Bool |
GetStateFocus(
Bool inherit = false
)
(inherits from SFYResponder)
Get the focus state of this responder.
|
Bool |
GetStateValid(
Bool inherit = false
)
(inherits from SFYResponder)
Get the valid state of this responder.
|
Bool |
GetStateVisible(
Bool inherit = false
)
(inherits from SFYResponder)
Get the visible state of this responder.
|
SFXRectangle |
GetSuitableBound( Void )
(inherits from SFYResponder)
Get the suitable region of this responder.
|
SFXRectangle |
GetSuitableBound(
SFXRectangleConstRef rectangle
)
(inherits from SFYResponder)
Get the suitable region of this responder.
|
SFXRectangle |
GetSuitableBound(
SFXRectangleConstRef param
, HorizontalEnum horizontal
, VerticalEnum vertical
)
(inherits from SFYResponder)
Get the suitable region of this responder.
|
SFXMargin |
GetSuitableMargin( Void )
(inherits from SFYResponder)
Get the suitable frame margin region of this responder.
|
SFCType |
GetType( Void )
(inherits from SFYResponder)
Get the type of this responder class.
|
SFXRectangleConstRef |
GetVirtualBound( Void )
(inherits from SFYResponder)
Get the virtual region of this responder.
|
Bool |
HasFrame( Void )
(inherits from SFYResponder)
Check whether or not this responder is a content-responder.
|
Void |
Initialize( Void )
(inherits from SFYResponder)
Initialize this responder.
|
Bool |
IsBack( Void )
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsBack(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsBack(
UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsBack(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the backmost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsFrame( Void )
(inherits from SFYResponder)
Check whether or not this responder is an attachment-frame.
|
Bool |
IsFront( Void )
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsFront(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsFront(
UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsFront(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is the foremost responder among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthBackward(
SInt32 index
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthBackward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthBackward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthBackward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthForward(
SInt32 index
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthForward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthForward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsNthForward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Check whether or not this responder is at the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Bool |
IsRoot( Void )
(inherits from SFYResponder)
Check whether or not this responder is the root responder.
|
SFCError |
Recover( Void )
(inherits from SFYResponder)
Recover the intersection region between this responder and the responder space by using the saved bitmap to restore the device bitmap.
|
SFCError |
RegisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
SFCError |
RegisterHandler(
SFXEventRangeConstRef range
, SFYHandler::HandlerSPP spp
, VoidPtr reference
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
SFCError |
RegisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::RuleRecConstPtr rule
, SInt32 length
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
SFCError |
RegisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::HandlerSPPConstPtr spp
, VoidPtrConstPtr reference
, SInt32 length
)
(inherits from SFYResponder)
Register specified handlers into this responder.
|
SFCError |
RegisterTracer(
SFXEventRangeConstRef range
, SFYTracer::RuleRecConstRef rule
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
SFCError |
RegisterTracer(
SFXEventRangeConstRef range
, SFYTracer::OrderEnum order
, SFYTracer::StateEnum state
, Bool overload
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
SFCError |
RegisterTracer(
SFXEventRangeConstPtr range
, SFYTracer::RuleRecConstPtr rule
, SInt32 length
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
SFCError |
RegisterTracer(
SFXEventRangeConstPtr range
, SFYTracer::OrderEnumConstPtr order
, SFYTracer::StateEnumConstPtr state
, BoolConstPtr overload
, SInt32 length
)
(inherits from SFYResponder)
Register specified dispatching rules into the tracer of this responder.
|
SFCError |
Render(
Bool force = false
)
(inherits from SFYResponder)
Boot up the renderer for redrawing this responder and its descendant responders.
|
Void |
SetBackgroundColor(
SFXRGBColorConstRef param
)
(inherits from SFYWidget)
Set the background color to the specified value.
|
Void |
SetDistributer(
SFYDistributerPtr param
)
(inherits from SFYResponder)
Bind this responder with the specified distributer.
|
SFCError |
SetFrame(
SFYResponderSmpConstRef param
)
(inherits from SFYResponder)
Attach the specified frame to this frame.
|
Void |
SetID(
UInt32 param
)
(inherits from SFYResponder)
Set the ID value of this responder to the specified value.
|
SFCError |
SetParent(
SFYResponderSmpConstRef param
)
(inherits from SFYResponder)
Set the parent responder of this responder to the specified responder.
|
Void |
SetProperty(
Bool transparent
)
(inherits from SFYResponder)
Set the property of this responder to the specified value.
|
Void |
SetPropertyTransparent(
Bool param
)
(inherits from SFYResponder)
Set the transparency attribute of this responder to the specified value.
|
Void |
SetRealBound(
SFXRectangleConstRef param
)
(inherits from SFYResponder)
Set the real region of this responder to the specified region.
|
Void |
SetReference(
VoidPtr param
)
(inherits from SFYResponder)
Set the reference value of this responder to the specified value.
|
Void |
SetRenderer(
SFYRendererPtr param
)
(inherits from SFYResponder)
Bind this responder with the specified renderer.
|
Void |
SetState(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Set all states of this responder to specified values together.
|
Void |
SetStateActive(
Bool param
)
(inherits from SFYResponder)
Set the active state of this responder to the specified value.
|
Void |
SetStateEnable(
Bool param
)
(inherits from SFYResponder)
Set the enable state of this responder to the specified value.
|
Void |
SetStateFocus(
Bool param
)
(inherits from SFYResponder)
Set the focus state of this responder to the specified value.
|
Void |
SetStateVisible(
Bool param
)
(inherits from SFYResponder)
Set the visible state of this responder to the specified value.
|
Void |
SetVirtualBound(
SFXRectangleConstRef param
)
(inherits from SFYResponder)
Set the virtual region of this responder to the specified value.
|
SFCError |
Snapshot(
SFBBitmapSmpConstRef bitmap
)
(inherits from SFYResponder)
Get a snapshot image of the intersection region between this responder and the responder space by using the saved bitmap.
|
Void |
Terminate( Void )
(inherits from SFYResponder)
Terminate this responder.
|
Void |
ToBack( Void )
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToBack(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToBack(
UInt32 id
)
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToBack(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the backmost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToFront( Void )
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToFront(
Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToFront(
UInt32 id
)
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToFront(
UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the foremost position among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthBackward(
SInt32 index
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthBackward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthBackward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthBackward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the back side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthForward(
SInt32 index
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthForward(
SInt32 index
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthForward(
SInt32 index
, UInt32 id
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Void |
ToNthForward(
SInt32 index
, UInt32 id
, Bool visible
, Bool active
, Bool enable
, Bool focus
)
(inherits from SFYResponder)
Move this responder to the specified position from the front side among a group of the sibling responders
which match the specified search condition.
|
Void |
UnregisterHandler(
SFXEventRangeConstRef range
, SFYHandler::RuleRecConstRef rule
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
Void |
UnregisterHandler(
SFXEventRangeConstRef range
, SFYHandler::HandlerSPP spp
, VoidPtr reference
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
Void |
UnregisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::RuleRecConstPtr rule
, SInt32 length
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
Void |
UnregisterHandler(
SFXEventRangeConstPtr range
, SFYHandler::HandlerSPPConstPtr spp
, VoidPtrConstPtr reference
, SInt32 length
)
(inherits from SFYResponder)
Unregister the handler from this responder which matches the specified condition.
|
Void |
UnregisterTracer(
SFXEventRangeConstRef range
)
(inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
|
Void |
UnregisterTracer(
SFXEventRangeConstPtr range
, SInt32 length
)
(inherits from SFYResponder)
Unregister the dispatching rule from the tracer of this responder which matches the specified condition.
|
T const & |
static_catch(
Void
)
(inherits from static_exception)
Get the current exception.
|
Protected Functions | |
---|---|
Void |
HandleEscapeKey( Void )
This function will be called
when the SFEVT_KEY event of the ESCAPE key is received or
the time scheduled by ScheduleTimer() elapses.
|
Void |
HandleOperateKey( Void ) This function will be called when the SFEVT_KEY event of the operation key is received.
|
static SFYResponderSmp |
Factory(
SFYResponderPtr responder
, SFCErrorPtr exception = null
)
(inherits from SFYResponder)
This function is used to implement the NewInstance function.
|
SFYResponderSmp |
GetThis( Void )
(inherits from SFYResponder)
Get the smart pointer of this responder.
|
Void |
HandleBoundGlobal(
SFXRectangleConstRef rectangle
)
(inherits from SFYWidget)
This function will be called when the global region is changed.
|
Void |
HandleBoundOptimize(
SFXRectanglePtr rectangle
)
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_OPTIMIZE) event is received.
[Calculate the suitable rectangle size of this responder within the specified hint rectangle.]
|
Void |
HandleBoundReal( Void )
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REAL) event is received.
[Perform the processing when the real region is changed.]
|
Void |
HandleBoundRequest(
SFXRectanglePtr rectangle
)
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event is received.
[Calculate the suitable rectangle size of this responder.]
|
Void |
HandleBoundVirtual( Void )
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_VIRTUAL) event is received.
[Perform the processing when the virtual region is changed.]
|
Void |
HandleRenderRequest(
SFXGraphicsPtr graphics
)
(inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received.
[Draw this responder.]
|
Void |
Invalidate( Void )
(inherits from SFYResponder)
Register the specified redraw region of this responder.
|
Void |
Invalidate(
SFXRectangleConstRef param
)
(inherits from SFYResponder)
Register the specified redraw region of this responder.
|
Void |
InvokeBackward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
)
(inherits from SFYResponder)
Call the handlers for the specified event from the end of the handler list registered into this responder.
|
Void |
InvokeForward(
SFXEventConstRef event
, Bool overload
, BoolPtr result = null
)
(inherits from SFYResponder)
Call the handlers for the specified event from the head of the handler list registered into this responder.
|
Void |
SetType(
SFCType param
)
(inherits from SFYResponder)
Set the Type value of this responder to the specified 4-character value.
|
Void |
static_throw(
static_exception< T > const & param
)
(inherits from static_exception)
Set an exception.
|
Void |
static_throw(
T const & param
)
(inherits from static_exception)
Set an exception.
|
Bool |
static_try(
Void
)
(inherits from static_exception)
Confirm whether or not the exception is retained.
|
Types |
---|
CodeEnum Constant that represents the SFZDialog class.
|
HorizontalEnum
(inherits from SFYResponder)
Constants that represent the horizontal alignment.
|
VerticalEnum
(inherits from SFYResponder)
Constants that represent the vertical alignment.
|
[ protected, explicit ] SFZDialog(Void);
This constructor performs the initializations as follows:
Table 228. Event handler
Event | Content of the handler |
---|---|
SFEVT_KEY event of the operation key set with SFZDialog::SetOperateKey. | Cancel the timer processing scheduled with the SFZDialog::ScheduleTimer function and call the SFZDialog::HandleOperateKey function. |
SFEVT_KEY event of the ESCAPE key set with SFZDialog::SetEscapeKey. | Cancel the timer processing scheduled with the SFZDialog::ScheduleTimer function and call the SFZDialog::HandleEscapeKey function. |
Result event[SFEVT_RESPONDER_RESULT] | Terminate this dialog. |
Timer event set with SFZDialog::ScheduleTimer | Call the SFZDialog::HandleEscapeKey function and then redraw the screen. |
Applet-suspend event[SFEVT_APP_SUSPEND] | Cancel the timer processing to close this dialog after the specified time elapses. |
Applet-resume event[SFEVT_APP_RESUME] | Restart the timer processing to close this dialog after the specified time elapses. |
Note | |
---|---|
In a responder inheriting from SFZDialog, the corresponding handler will be called when one of the above events occurs. |
Internal implementation of this constructor is as follows:
/*protected */SFZDialog::SFZDialog(Void) static_throws : _state(STATE_IDLE) { static SFXRGBColor::AtomRecConst rgb[] = { {{{0x00, 0xEE, 0xEE, 0xEE}}} }; static SFXEventRange::AtomRecConst trange[] = { { SFEVT_APP_RESUME, SFEVT_APP_RESUME, SFP16_BEGIN, SFP16_END}, { SFEVT_APP_SUSPEND, SFEVT_APP_SUSPEND, SFP16_BEGIN, SFP16_END}, #if TARGET_VERSION_GE(3, 0, 0) { SFEVT_KEY_PRESS, SFEVT_KEY_RELEASE, SFP16_BEGIN, SFP16_END}, #else { SFEVT_KEY_PRESS, SFEVT_KEY_HELD, SFP16_BEGIN, SFP16_END}, #endif { SFEVT_KEY, SFEVT_KEY, SFP16_BEGIN, SFP16_END}, { SFEVT_KEY, SFEVT_KEY, SFP16_BEGIN, SFP16_END}, { SFEVT_RESPONDER_STATE, SFEVT_RESPONDER_STATE, SFP16_STATE_VALID, SFP16_STATE_VALID}, {SFEVT_RESPONDER_RESULT, SFEVT_RESPONDER_RESULT, SFP16_BEGIN, SFP16_END} }; SFYHandler::RuleRec trule[lengthof(trange)]; if (static_try()) { SetType(CODE_TYPE); trule[0].spp = XANDLER_FUNCTION(OnAppResume); trule[0].reference = this; trule[1].spp = XANDLER_FUNCTION(OnAppSuspend); trule[1].reference = this; trule[2].spp = XANDLER_FUNCTION(OnShield); trule[2].reference = this; trule[3].spp = XANDLER_FUNCTION(OnKey); trule[3].reference = this; trule[4].spp = XANDLER_FUNCTION(OnRewind); trule[4].reference = this; trule[5].spp = XANDLER_FUNCTION(OnStateValid); trule[5].reference = this; trule[6].spp = XANDLER_FUNCTION(OnDialogResult); trule[6].reference = this; static_throw(RegisterHandler(atomic_cast(trange), trule, lengthof(trange))); if (static_try()) { SetBackgroundColor(rgb[0]); _timer.Set(XALLBACK_INTERNAL(OnTimer)); _msec = 0; _key.operate = AVK_SELECT; _key.escape = AVK_CLR; } } }// SFZDialog::SFZDialog // /*private */XANDLER_IMPLEMENT_VOIDRESUME(SFZDialog, OnAppResume, invoker, environment) { unused(invoker); unused(environment); if (_state == STATE_FIRE) { _timer.Schedule(_msec); } return; }// XANDLER_IMPLEMENT_VOIDRESUME(SFZDialog, OnAppResume) // /*private */XANDLER_IMPLEMENT_VOIDSUSPEND(SFZDialog, OnAppSuspend, invoker, reason, info) { unused(invoker); unused(reason); unused(info); if (_state != STATE_IDLE) { _timer.Cancel(); } return; }// XANDLER_IMPLEMENT_VOIDSUSPEND(SFZDialog, OnAppSuspend) // /*private */XANDLER_IMPLEMENT_BOOLEVENT(SFZDialog, OnShield, invoker, event) { unused(invoker); return (event.GetP16() == _key.operate || event.GetP16() == _key.escape); }// XANDLER_IMPLEMENT_BOOLEVENT(SFZDialog, OnShield) // /*private */XANDLER_IMPLEMENT_BOOLEVENT(SFZDialog, OnKey, invoker, event) { Bool result(false); unused(invoker); if (event.GetP16() == _key.operate) { CancelTimer(); HandleOperateKey(); result = true; } else if (event.GetP16() == _key.escape) { CancelTimer(); HandleEscapeKey(); result = true; } return result; }// XANDLER_IMPLEMENT_BOOLEVENT(SFZDialog, OnKey) // /*private */XANDLER_IMPLEMENT_BOOLEVENT(SFZDialog, OnRewind, invoker, event) { unused(invoker); unused(event); RewindTimer(); return false; }// XANDLER_IMPLEMENT_BOOLEVENT(SFZDialog, OnRewind) // /*private */XANDLER_IMPLEMENT_VOIDSTATE(SFZDialog, OnStateValid, invoker, reason, state) { unused(invoker); unused(reason); if (!state) { CancelTimer(); } return; }// XANDLER_IMPLEMENT_VOIDSTATE(SFZDialog, OnStateValid) // /*private */XANDLER_IMPLEMENT_VOIDRESULT(SFZDialog, OnDialogResult, invoker, reason, result) { unused(invoker); unused(reason); unused(result); Terminate(); return; }// XANDLER_IMPLEMENT_VOIDRESULT(SFZDialog, OnDialogResult) // /*private */XALLBACK_IMPLEMENT_SFXTIMER(SFZDialog, OnTimer) { SFYResponderSmp root; SFCError error; error = SFERR_NO_ERROR; if ((root = GetRoot()) != null) { if (_state == STATE_FIRE) { _state = STATE_IDLE; _msec = 0; Invalidate(); HandleEscapeKey(); error = root->Render(); } } else { error = SFERR_FAILED; } if (error != SFERR_NO_ERROR) { // internal fault! } return; }// XALLBACK_IMPLEMENT_SFXTIMER(SFZDialog, OnTimer) //
SFYResponder::SetType | SFZDialog::CodeEnum | SFYWidget::SetBackgroundColor | SFZDialog::SetOperateKey | SFZDialog::SetEscapeKey | SFZDialog::HandleOperateKey | SFZDialog::HandleEscapeKey | SFZDialog::ScheduleTimer | SFXEvent | SFXRGBColor | Type | Event | Key Event[SFEVT_KEY] | Result Event[SFEVT_RESPONDER_RESULT] | Applet-Suspend Event[SFEVT_APP_SUSPEND] | Applet-Resume Event[SFEVT_APP_RESUME]
[ protected, virtual ] virtual ~SFZDialog(Void);
This destructor cancels the timer processing.
[ public ] Void CancelTimer(Void);
If this function is called, the dialog will not be closed after the time set with the SFZDialog::ScheduleTimer function elapses.
[ public, const ] AVKType GetEscapeKey(Void);
This function gets the ESCAPE key of this dialog set with the SFZDialog::SetEscapeKey function.
[ public, const ] AVKType GetOperateKey(Void);
This function gets the operation key of this dialog set with the SFZDialog::SetOperateKey function.
[ protected, virtual ] Void HandleEscapeKey(Void);
This function will be called when the SFEVT_KEY event(key event[SFEVT_KEY]) of the ESCAPE key set with the SFZDialog::SetEscapeKey function is received or the time scheduled by the SFZDialog::ScheduleTimer elapses without the operation nor ESCAPE key press.
In case you want to perform your own processing, override this function.
The default implementation is to send the result event [SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_ESCAPE, 0)], which will boot up the result handler.
Note | |
---|---|
Implementation of the default result handler is only to close this dialog. |
Internal implementation of the SFZDialog::HandleEscapeKey function is as follows:
/*protected virtual */Void SFZDialog::HandleEscapeKey(Void) { InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_ESCAPE, 0), false); return; }// SFZDialog::HandleEscapeKey //
SFZDialog::SetEscapeKey | SFZDialog::ScheduleTimer | SFZDialog::SetOperateKey | SFXEvent | Result Event[SFEVT_RESPONDER_RESULT] | Key Event[SFEVT_KEY]
[ protected, virtual ] Void HandleOperateKey(Void);
This function will be called when the SFEVT_KEY event(key event[SFEVT_KEY]) of the operaion key set with the SFZDialog::SetOperateKey function is received.
In case you want to perform your own processing, override this function.
The default implementation is to send the result event [SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_OK, 0)], which will boot up the result handler.
Note | |
---|---|
Implementation of the default result handler is only to close this dialog. |
Internal implementation of the SFZDialog::HandleOperateKey function is as follows:
/*protected virtual */Void SFZDialog::HandleOperateKey(Void) { InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_OK, 0), false); return; }// SFZDialog::HandleOperateKey //
SFZDialog::SetOperateKey | SFXEvent | Result Event[SFEVT_RESPONDER_RESULT] | Key Event[SFEVT_KEY]
[ public, static ] SFZDialogSmp NewInstance( SFCErrorPtr exception = null // error value );
Return the error value generated inside the function.
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.
The code to create a new instance of this responder class is as follows:
SFZDialogSmp _dialog;
SFCError error;
if ((_dialog = SFZDialog::NewInstance(&error)) != null) {
...
}
[ public ] Void RewindTimer(Void);
This function resets the time until this dialog is automatically closed, which has been set with the SFZDialog::ScheduleTimer function.
This function schedules the timer that the SFZDialog::HandleEscapeKey function will be called and the screen will be redrawn when neither the operation key nor the ESCAPE key has been pressed for the specified time. [milliseconds]
Note | |
---|---|
In case of SFZMessageDialog or SFZQuestionDialog class, this function schedules the timer that the SFZDialog::HandleEscapeKey function will be called and the screen will be redrawn when neither the operation key, the ESCAPE key, nor any button has been pressed for the specified time. |
Scheduling of timer processing callback | |
---|---|
This function registers the timer processing callback that the SFZDialog::HandleEscapeKey function will be called and the screen will be redrawn when the specified time elapses. If the operation key set with the SFZDialog::SetOperateKey function or the ESCAPE key set with the SFZDialog::SetEscapeKey function is pressed before the specified time elapses, this timer processing callback will be canceled. If this timer processing callback is scheduled at the suspend time, it will be canceled and re-scheduled at the resume time automatically. When the valid state of this dialog becomes invalid, if this timer processing callback is scheduled, it will be canceled automatically. |
SFZDialog::HandleEscapeKey | SFZDialog::CancelTimer | SFZDialog::RewindTimer | SFZDialog::SetOperateKey | SFZDialog::SetEscapeKey | State
This function sets the ESCAPE key of this dialog to the specified value.
The SFZDialog::HandleEscapeKey function will be called when this key is pressed.
Default: AVK_CLR
This function sets the operation key of this dialog to the specified value.
The SFZDialog::HandleOperateKey function will be called when this key is pressed.
Default: AVK_SELECT
enum CodeEnum { CODE_TYPE = four_char_code('d', 'l', 'o', 'g') }; SFMTYPEDEFTYPE(CodeEnum)
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |