SophiaFramework UNIVERSE 5.3 |
The SFRResponder class automates GUI-related processes such as event handling and rendering, and offers standard GUI components including window, dialog, menu, button, label, checkbox, etc.
All the UI components such as window and control inherit from the SFRResponder class.
What is responder | |
---|---|
In SophiaFramework, UI component is called as "responder" |
SFRApplication | SFRWindow | SFRDialog | SFRControl | SFRPane | SFRMenu | Responder
Constructor/Destructor |
---|
SFRResponder(
SFRResponderPtr parent
, SFXRectangleConstRef rect
, SFXMarginConstRef margin
, SFCType type
, SFCType attribute
, BehaviorType behavior
)
Constructor of the SFRResponder class.
|
~SFRResponder( Void ) Destructor of the SFRResponder class.
|
Public Functions | |
---|---|
Bool |
ClearHandler( Void )
[Handler] Clear the " Targeted " status of responder, or destroy the responder.
|
Bool |
Compare(
SFCType type
, SFCType attribute
, BehaviorType behavior
) Compare with type, attribute and behavior.
|
Bool |
FocusDown(
Bool repeat = true
) Focus down to the next responder.
|
Bool |
FocusDownHandler( Void )
[Handler] Focus down to the next responder.
|
Bool |
FocusLeft(
Bool repeat = true
) Focus left to the next responder.
|
Bool |
FocusLeftHandler( Void )
[Handler] Focus left to the next responder.
|
Bool |
FocusNext(
Bool repeat = true
) Focus to the next sibling responder.
|
Bool |
FocusNextHandler( Void )
[Handler] Focus to the next sibling responder.
|
Bool |
FocusPrevious(
Bool repeat = true
) Focus to the previous sibling responder.
|
Bool |
FocusPreviousHandler( Void )
[Handler] Focus to the previous sibling responder.
|
Bool |
FocusRight(
Bool repeat = true
) Focus right to the next responder.
|
Bool |
FocusRightHandler( Void )
[Handler] Focus right to the next responder.
|
Bool |
FocusUp(
Bool repeat = true
) Focus up to the next responder.
|
Bool |
FocusUpHandler( Void )
[Handler] Focus up to the next responder.
|
SFCType |
GetAttribute( Void ) Get the attribute.
|
SFRResponderPtr |
GetBack(
SFCType type = TYPE_WILDCARD
, SFCType attribute = ATTRIBUTE_WILDCARD
, BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE
)
Get the child responder at the most background that matches the specified search condition.
|
SFXRectangleConstRef |
GetBaseBound( Void ) Get the base region with the coordinate of content region of parent responder.
|
SFXRectangle |
GetBaseWorld( Void ) Get the base region.
|
SFXRectangleConstRef |
GetContentBound( Void ) Get the content region with the coordinate of base region.
|
SFXRectangle |
GetContentWorld( Void ) Get the content region.
|
SFRResponderPtr |
GetDirector( Void ) Get the parent responder.
|
SFRResponderPtr |
GetFocus( Void ) Get the responder with focus in its ownership hierarchy.
|
SFXMargin |
GetFrameMargin( Void ) Get the margin between base and content region(in pixels).
|
SFRResponderPtr |
GetFront(
SFCType type = TYPE_WILDCARD
, SFCType attribute = ATTRIBUTE_WILDCARD
, BehaviorType compare = STATUS_VISIBLE | STATUS_ENABLE
)
Get the child responder at the most foreground that matches the specified search condition.
|
SInt16 |
GetIndexBackward(
SFCType type = TYPE_WILDCARD
, SFCType attribute = ATTRIBUTE_WILDCARD
, BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE
)
Get the index number from the most background of responder that matches the specified search condition.
|
SInt16 |
GetIndexForward(
SFCType type = TYPE_WILDCARD
, SFCType attribute = ATTRIBUTE_WILDCARD
, BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE
)
Get the index number from the most foreground of responder that matches the specified search condition.
|
Bool |
GetInheritEnable( Void ) Get the " Enable / Disable " status of responder including its parent responders.
|
Bool |
GetInheritFocus( Void ) Get the " Focused / Unfocused " status of responder including its parent responders.
|
Bool |
GetInheritTarget( Void ) Get the " Target / Not-Target " status of responder including its parent responders.
|
Bool |
GetInheritVisible( Void ) Get the " Visible / Invisible " status of responder including its parent responders.
|
SFRResponderPtr |
GetLeft(
SFCType type = TYPE_WILDCARD
, SFCType attribute = ATTRIBUTE_WILDCARD
, BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE
)
Get the previous responder among the grouped responders that matches the specified search condition.
|
SInt16 |
GetMoveInterval( Void )
Get the move interval in pixels.
|
SInt16 |
GetMoveMargin( Void )
Get the margin pixels of content region ( or virtual region if set with the parent responder ) where the child responder cannot move.
|
SFRResponderPtr |
GetNext(
SFCType type = TYPE_WILDCARD
, SFCType attribute = ATTRIBUTE_WILDCARD
, BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE
, Bool repeat = true
)
Get the next sibling responder that matches the specified search condition.
|
SFRResponderPtr |
GetNthBackward(
SInt16 index
, SFCType type = TYPE_WILDCARD
, SFCType attribute = ATTRIBUTE_WILDCARD
, BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE
)
Get the Nth child responder from the most background that matches the specified search condition.
|
SFRResponderPtr |
GetNthForward(
SInt16 index
, SFCType type = TYPE_WILDCARD
, SFCType attribute = ATTRIBUTE_WILDCARD
, BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE
)
Get the Nth child responder from the most foreground that matches the specified search condition.
|
SFRResponderPtr |
GetPrevious(
SFCType type = TYPE_WILDCARD
, SFCType attribute = ATTRIBUTE_WILDCARD
, BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE
, Bool repeat = true
)
Get the previous sibling responder that matches the specified search condition.
|
VoidPtr |
GetReference( Void ) Get the reference value.
|
SFRResponderPtr |
GetRight(
SFCType type = TYPE_WILDCARD
, SFCType attribute = ATTRIBUTE_WILDCARD
, BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE
)
Get the next responder among the grouped responders that matches the specified search condition.
|
SInt16 |
GetScrollInterval( Void )
Get the scroll interval in pixels.
|
Bool |
GetStatusEnable( Void ) Get the value of " Enable / Disable " flag.
|
Bool |
GetStatusFocus( Void ) Get the value of " Focused / Unfocused " flag.
|
Bool |
GetStatusTarget( Void ) Get the value of " Target / Non-target " flag.
|
Bool |
GetStatusVisible( Void ) Get the value of " Visible / Invisible " flag.
|
SFXGrid |
GetTranslate( Void ) Get the origin coordinate of virtual region with the coordinate of content region.
|
SInt16 |
GetTravelMargin( Void )
Get the margin pixels of content region inside which the rectangle in the virtual region but outside the content region should be automatically scrolled by using the SFRResponder::Travel function.
|
SFCType |
GetType( Void ) Get the responder type.
|
SFXRectangleConstRef |
GetVirtualBound( Void ) Get the virtual region with the coordinate of content region.
|
SFXRectangle |
GetVirtualWorld( Void ) Get the virtual region
|
Void |
Group(
SFRResponderPtr with
) Group the responder with the group of which representative responder is specified as an argument.
|
Void |
GroupMove(
SFXSizeConstRef size
)
Move all the responders grouped together.
|
Void |
GroupScroll(
SFXSizeConstRef size
)
Scroll all the virtual regions of responders grouped together.
|
Void |
GroupSelect( Void ) Select all the responders grouped together. ( move all of them to the most foreground )
|
Void |
GroupStatusEnable(
Bool enable
) Set the " Enable / Disable " status of all the responders grouped together.
|
Void |
GroupStatusVisible(
Bool visible
) Set the " Visible / Invisible " status of all the responders grouped together.
|
Void |
InvalidateBase( Void ) Register an area in the base region to be redrawn.
|
Void |
InvalidateBase(
SFXRectangleConstRef rect
) Register an area in the base region to be redrawn.
|
Void |
InvalidateContent( Void ) Register an area in the content region to be redrawn.
|
Void |
InvalidateContent(
SFXRectangleConstRef rect
) Register an area in the content region to be redrawn.
|
Void |
InvalidateVirtual( Void ) Register an area in the virtual region to be redrawn.
|
Void |
InvalidateVirtual(
SFXRectangleConstRef rect
) Register an area in the virtual region to be redrawn.
|
Bool |
Invoke(
SFXEventConstRef event
) Send the specified event.
|
Void |
Move(
SFXSizeConstRef size
)
Move the responder.
|
Bool |
MoveDownHandler( Void )
[Handler] Move the responder down.
|
Bool |
MoveLeftHandler( Void )
[Handler] Move the responder left.
|
Bool |
MoveRightHandler( Void )
[Handler] Move the responder right.
|
Bool |
MoveUpHandler( Void )
[Handler] Move the responder up.
|
Void |
Scroll(
SFXSizeConstRef size
)
Scroll the virtual region.
|
Bool |
ScrollDownHandler( Void )
[Handler] Scroll the virtual region down.
|
Bool |
ScrollLeftHandler( Void )
[Handler] Scroll the virtual region left.
|
Bool |
ScrollRightHandler( Void )
[Handler] Scroll the virtual region right.
|
Bool |
ScrollUpHandler( Void )
[Handler] Scroll the virtual region up.
|
Void |
Select( Void ) Select the responder and move it to the most foreground.
|
Bool |
SelectHandler( Void )
[Handler] Set the target status of a responder to true.
|
Void |
SetBaseBound(
SFXRectangleConstRef rect
) Set the base region with the coordinate of virtual region of parent responder.
|
Void |
SetContentBound(
SFXRectangleConstRef rect
) Set the content region with the coordinate of base region.
|
Void |
SetFrameMargin(
SFXMarginConstRef param
) Set the margin between base and content region(in pixels).
|
Void |
SetMoveInterval(
SInt16 interval
) Set the move interval in pixels.
|
Void |
SetMoveMargin(
SInt16 margin
)
Set the margin pixels of content region ( or virtual region if set with the parent responder ) where the child responder cannot move.
|
Void |
SetReference(
VoidPtr ref
) Set the reference value.
|
Void |
SetScrollInterval(
SInt16 interval
)
Set the scroll interval in pixels.
|
Void |
SetStatusEnable(
Bool enable
) Set the value of " Enable / Disable " flag.
|
Void |
SetStatusFocus(
Bool focus
) Set the value of " Focused / Unfocused " flag.
|
Void |
SetStatusTarget(
Bool target
) Set the value of " Target / Not-Target " flag.
|
Void |
SetStatusVisible(
Bool visible
) Set the value of " Visible / Invisible " flag.
|
Void |
SetTranslate(
SFXGridConstRef point
) Set the origin coordinate of virtual region with the coordinate of content region.
|
Void |
SetTravelMargin(
SInt16 margin
)
Set the margin pixels of content region inside which the rectangle in the virtual region but outside the content region should be automatically scrolled by using the SFRResponder::Travel function.
|
Void |
SetVirtualBound(
SFXRectangleConstRef rect
) Set the virtual region with the coordinate of content region.
|
Void |
Travel(
SFXRectangleConstRef rect
)
Scroll the virtual region of responder so that the specified rectangle can get into the content region.
|
Void |
Ungroup( Void ) Ungroup the responders which are grouped together.
|
SFCError |
RegisterHandler(
HandlerEnum timing
, SFRHandlerSPP spp
, VoidPtr ref
)
(inherits from SFRHandler)
Register a handler.
|
SFCError |
RegisterHandler(
SFCEventEnum type
, HandlerEnum timing
, SFRHandlerSPP spp
, VoidPtr ref
)
(inherits from SFRHandler)
Register a handler.
|
SFCError |
RegisterHandler(
SFCEventEnum type
, UInt16 p16
, HandlerEnum timing
, SFRHandlerSPP spp
, VoidPtr ref
)
(inherits from SFRHandler)
Register a handler.
|
SFCError |
RegisterHandler(
SFCEventEnum type
, UInt16 bp16
, UInt16 ep16
, HandlerEnum timing
, SFRHandlerSPP spp
, VoidPtr ref
)
(inherits from SFRHandler)
Register a handler.
|
SFCError |
RegisterHandler(
SFCEventEnum btype
, SFCEventEnum etype
, HandlerEnum timing
, SFRHandlerSPP spp
, VoidPtr ref
)
(inherits from SFRHandler)
Register a handler.
|
SFCError |
RegisterHandler(
SFCEventEnum btype
, SFCEventEnum endType
, UInt16 p16
, HandlerEnum timing
, SFRHandlerSPP spp
, VoidPtr ref
)
(inherits from SFRHandler)
Register a handler.
|
SFCError |
RegisterHandler(
SFCEventEnum btype
, SFCEventEnum etype
, UInt16 bp16
, UInt16 ep16
, HandlerEnum timing
, SFRHandlerSPP spp
, VoidPtr ref
)
(inherits from SFRHandler)
Register a handler.
|
SFCError |
RegisterTracer(
BehaviorType behavior
, TracerEnum trace
)
(inherits from SFRTracer)
Register the tracer.
|
SFCError |
RegisterTracer(
SFCEventEnum type
, BehaviorType behavior
, TracerEnum trace
)
(inherits from SFRTracer)
Register the tracer.
|
SFCError |
RegisterTracer(
SFCEventEnum type
, UInt16 p16
, BehaviorType behavior
, TracerEnum trace
)
(inherits from SFRTracer)
Register the tracer.
|
SFCError |
RegisterTracer(
SFCEventEnum type
, UInt16 bgnP16
, UInt16 endP16
, BehaviorType behavior
, TracerEnum trace
)
(inherits from SFRTracer)
Register the tracer.
|
SFCError |
RegisterTracer(
SFCEventEnum bgnType
, SFCEventEnum endType
, BehaviorType behavior
, TracerEnum trace
)
(inherits from SFRTracer)
Register the tracer.
|
SFCError |
RegisterTracer(
SFCEventEnum bgnType
, SFCEventEnum endType
, UInt16 p16
, BehaviorType behavior
, TracerEnum trace
)
(inherits from SFRTracer)
Register the tracer.
|
SFCError |
RegisterTracer(
SFCEventEnum bgnType
, SFCEventEnum endType
, UInt16 bgnP16
, UInt16 endP16
, BehaviorType behavior
, TracerEnum trace
)
(inherits from SFRTracer)
Register the tracer.
|
Void |
UnregisterHandler(
HandlerEnum timing
)
(inherits from SFRHandler)
Unregister the registered handler.
|
Void |
UnregisterHandler(
SFCEventEnum type
, HandlerEnum timing
)
(inherits from SFRHandler)
Unregister the registered handler.
|
Void |
UnregisterHandler(
SFCEventEnum type
, UInt16 p16
, HandlerEnum timing
)
(inherits from SFRHandler)
Unregister the registered handler.
|
Void |
UnregisterHandler(
SFCEventEnum type
, UInt16 bgnP16
, UInt16 endP16
, HandlerEnum timing
)
(inherits from SFRHandler)
Unregister the registered handler.
|
Void |
UnregisterHandler(
SFCEventEnum bgnType
, SFCEventEnum endType
, HandlerEnum timing
)
(inherits from SFRHandler)
Unregister the registered handler.
|
Void |
UnregisterHandler(
SFCEventEnum bgnType
, SFCEventEnum endType
, UInt16 p16
, HandlerEnum timing
)
(inherits from SFRHandler)
Unregister the registered handler.
|
Void |
UnregisterHandler(
SFCEventEnum bgnType
, SFCEventEnum endType
, UInt16 bgnP16
, UInt16 endP16
, HandlerEnum timing
)
(inherits from SFRHandler)
Unregister the registered handler.
|
Void |
UnregisterTracer( Void )
(inherits from SFRTracer)
Unregister the tracer.
|
Void |
UnregisterTracer(
SFCEventEnum type
)
(inherits from SFRTracer)
Unregister the tracer.
|
Void |
UnregisterTracer(
SFCEventEnum type
, UInt16 p16
)
(inherits from SFRTracer)
Unregister the tracer.
|
Void |
UnregisterTracer(
SFCEventEnum type
, UInt16 bgnP16
, UInt16 endP16
)
(inherits from SFRTracer)
Unregister the tracer.
|
Void |
UnregisterTracer(
SFCEventEnum bgnType
, SFCEventEnum endType
)
(inherits from SFRTracer)
Unregister the tracer.
|
Void |
UnregisterTracer(
SFCEventEnum bgnType
, SFCEventEnum endType
, UInt16 p16
)
(inherits from SFRTracer)
Unregister the tracer.
|
Void |
UnregisterTracer(
SFCEventEnum bgnType
, SFCEventEnum endType
, UInt16 bgnP16
, UInt16 endP16
)
(inherits from SFRTracer)
Unregister the tracer.
|
Protected Functions | |
---|---|
Bool |
GetAppearanceTransparent( Void ) Get the value of APPEARANCE_TRANSPARENT flag.
|
Bool |
GetPropertyClosable( Void ) Get the value of PROPERTY_CLOSABLE flag.
|
Bool |
GetPropertyDirect( Void ) Get the value of PROPERTY_DIRECT flag.
|
Bool |
GetPropertyMovable( Void ) Get the value of PROPERTY_MOVABLE flag.
|
Bool |
GetPropertyScrollable( Void ) Get the value of PROPERTY_SCROLLABLE flag.
|
Bool |
GetPropertySelect( Void ) Get the value of PROPERTY_SELECT flag.
|
Bool |
GetPropertyTravel( Void ) Get the value of PROPERTY_TRAVEL flag.
|
HandlerRecConstPtr |
SearchHandler(
SFXEventConstRef event
, HandlerEnum timing
)
(inherits from SFRHandler)
Search for the handler that matches the specified event.
|
TracerRecConstPtr |
SearchTracer(
SFXEventConstRef event
)
(inherits from SFRTracer)
Search for the tracer that matches the specified event.
|
Types |
---|
BehaviorEnum
Constant that represents the behavior of responder.
|
HandlerEnum
(inherits from SFRHandler)
Constant that represents the timing to call the handler.
|
SFRHandlerSPP
(inherits from SFRHandler)
Type of the callback function.
|
TracerEnum
(inherits from SFRTracer)
Constant that represents the trace order.
|
TracerTraceMPP
(inherits from SFRTracer)
Type of the callback function.
|
[ protected ] SFRResponder( SFRResponderPtr parent // pointer to parent responder SFXRectangleConstRef rect // position of parent responder SFXMarginConstRef margin // margin between base and content region SFCType type // type SFCType attribute // attribute BehaviorType behavior // behavior );
[ protected, virtual ] ~SFRResponder(Void);
[ public ] Bool ClearHandler(Void);
The " Targeted " status of responder with the PROPERTY_DIRECT flag set on is cleared if it is targeted.
The responder with the PROPERTY_CLOSABLE flag set on is destroyed if it is not targeted, or focused with the PROPERTY_DIRECT flag set on.
It is necessary to associate a responder with the CLEAR key event and so on by using RegisterHandler function.
For details : Behavior
RegisterHandler(SFEVT_KEY, AVK_CLR, HANDLER_AFTER, HANDLER_FUNCTION(ClearHandler)));
[ public, const ] Bool Compare( SFCType type // type SFCType attribute // attribute BehaviorType behavior // behavior );
Focus down to the next responder which shares some of the X axis values with the currently-focused responder.
[Prerequisite] The responder status should be "Visible" and "Enable for response" to be focused.
About "Visible" and "Enable for response" | |
---|---|
For details : Behavior |
About Focus | |
---|---|
For details : Focus |
SFRResponder::FocusUp | SFRResponder::FocusLeft | SFRResponder::FocusRight | SFRResponder::FocusNext | SFRResponder::FocusPrevious
[ public ] Bool FocusDownHandler(Void);
Focus down to the next responder which shares some of the X axis values with the currently-focused responder.
[Prerequisite] The responder status should be "Visible" and "Enable for response" to be focused.
About "Visible" and "Enable for response" | |
---|---|
For details : Behavior |
It is necessary to associate the DOWN_ARROW key event and so on with the SFRHandler::RegisterHandler function.
RegisterHandler(SFEVT_KEY, AVK_DOWN, HANDLER_AFTER, HANDLER_FUNCTION(FocusDownHandler));
SFRResponder::FocusUpHandler | SFRResponder::FocusLeftHandler | SFRResponder::FocusRightHandler | SFRResponder::FocusNextHandler | SFRResponder::FocusPreviousHandler
Focus left to the next responder which shares some of the Y axis values with the currently-focused responder.
[Prerequisite] The responder status should be "Visible" and "Enable for response" to be focused.
About "Visible" and "Enable for response" | |
---|---|
For details : Behavior |
About Focus | |
---|---|
For details : Focus |
SFRResponder::FocusUp | SFRResponder::FocusDown | SFRResponder::FocusRight | SFRResponder::FocusNext | SFRResponder::FocusPrevious
[ public ] Bool FocusLeftHandler(Void);
Focus left to the next responder which shares some of the Y axis values with the currently-focused responder.
[Prerequisite] The responder status should be "Visible" and "Enable for response" to be focused.
About "Visible" and "Enable for response" | |
---|---|
For details : Behavior |
It is necessary to associate the LEFT_ARROW key event and so on with the SFRHandler::RegisterHandler function.
RegisterHandler(SFEVT_KEY, AVK_LEFT, HANDLER_AFTER, HANDLER_FUNCTION(FocusLeftHandler));
SFRResponder::FocusUpHandler | SFRResponder::FocusDownHandler | SFRResponder::FocusRightHandler | SFRResponder::FocusNextHandler | SFRResponder::FocusPreviousHandler
[ public, const ] Bool FocusNext( Bool repeat = true // if not found, search from the beginning again );
[Prerequisite] The responder status should be "Visible" and "Enable for response" to be focused.
About "Visible" and "Enable for response" | |
---|---|
For details : Behavior |
About Focus | |
---|---|
For details : Focus |
If there is not next sibling responder, the first sibling responder is focused.
SFRResponder::FocusPrevious | SFRResponder::FocusUp | SFRResponder::FocusDown | SFRResponder::FocusLeft | SFRResponder::FocusRight
[ public ] Bool FocusNextHandler(Void);
[Prerequisite] The responder status should be "Visible" and "Enable for response" to be focused.
About "Visible" and "Enable for response" | |
---|---|
For details : Behavior |
If there is not next sibling responder, the first sibling responder is focused.
It is necessary to associate the UP_ARROW event and so on with the SFRHandler::RegisterHandler function.
RegisterHandler(SFEVT_KEY, AVK_UP, HANDLER_AFTER, HANDLER_FUNCTION(FocusNextHandler));
SFRResponder::FocusPreviousHandler | SFRResponder::FocusUpHandler | SFRResponder::FocusDownHandler | SFRResponder::FocusLeftHandler | SFRResponder::FocusRightHandler
[ public, const ] Bool FocusPrevious( Bool repeat = true // if not found, search from the end again );
[Prerequisite] The responder status should be "Visible" and "Enable for response" to be focused.
About "Visible" and "Enable for response" | |
---|---|
For details : Behavior |
About Focus | |
---|---|
For details : Focus |
If there is not previous sibling responder, the last sibling responder is focused.
SFRResponder::FocusNext | SFRResponder::FocusUp | SFRResponder::FocusDown | SFRResponder::FocusLeft | SFRResponder::FocusRight
[ public ] Bool FocusPreviousHandler(Void);
[Prerequisite] The responder status should be "Visible" and "Enable for response" to be focused.
About "Visible" and "Enable for response" | |
---|---|
For details : Behavior |
If there is not previous sibling responder, the last sibling responder is focused.
It is necessary to associate the DOWN_ARROW key event and so on with the SFRHandler::RegisterHandler function.
RegisterHandler(SFEVT_KEY, AVK_DOWN, HANDLER_AFTER, HANDLER_FUNCTION(FocusPreviousHandler));
SFRResponder::FocusNextHandler | SFRResponder::FocusUpHandler | SFRResponder::FocusDownHandler | SFRResponder::FocusLeftHandler | SFRResponder::FocusRightHandler
Focus right to the next responder which shares some of the Y axis values with the currently-focused responder.
[Prerequisite] The responder status should be "Visible" and "Enable for response" to be focused.
About "Visible" and "Enable for response" | |
---|---|
For details : Behavior |
About Focus | |
---|---|
For details : Focus |
SFRResponder::FocusUp | SFRResponder::FocusDown | SFRResponder::FocusLeft | SFRResponder::FocusNext | SFRResponder::FocusPrevious
[ public ] Bool FocusRightHandler(Void);
Focus right to the next responder which shares some of the Y axis values with the currently-focused responder.
[Prerequisite] The responder status should be "Visible" and "Enable for response" to be focused.
About "Visible" and "Enable for response" | |
---|---|
For details : Behavior |
It is necessary to associate the RIGHT_ARROW key event and so on with the SFRHandler::RegisterHandler function.
RegisterHandler(SFEVT_KEY, AVK_RIGHT, HANDLER_AFTER, HANDLER_FUNCTION(FocusRightHandler));
SFRResponder::FocusUpHandler | SFRResponder::FocusDownHandler | SFRResponder::FocusLeftHandler | SFRResponder::FocusNextHandler | SFRResponder::FocusPreviousHandler
Focus up to the next responder which shares some of the X axis values with the currently-focused responder.
[Prerequisite] The responder status should be "Visible" and "Enable for response" to be focused.
About "Visible" and "Enable for response" | |
---|---|
For details : Behavior |
About Focus | |
---|---|
For details : Focus |
SFRResponder::FocusDown | SFRResponder::FocusLeft | SFRResponder::FocusRight | SFRResponder::FocusNext | SFRResponder::FocusPrevious
[ public ] Bool FocusUpHandler(Void);
Focus up to the next responder which shares some of the X axis values with the currently-focused responder.
[Prerequisite] The responder status should be "Visible" and "Enable for response" to be focused.
About "Visible" and "Enable for response" | |
---|---|
For details : Behavior |
It is necessary to associate the UP_ARROW key event and so on with the SFRHandler::RegisterHandler function.
RegisterHandler(SFEVT_KEY, AVK_UP, HANDLER_AFTER, HANDLER_FUNCTION(FocusUpHandler));
SFRResponder::FocusDownHandler | SFRResponder::FocusLeftHandler | SFRResponder::FocusRightHandler | SFRResponder::FocusNextHandler | SFRResponder::FocusPreviousHandler
[ protected, const ] Bool GetAppearanceTransparent(Void);
[ public, const ] SFCType GetAttribute(Void);
// when there is an unknown kind of responder // branch processing by the attribute of responder switch (responder->GetAttribute()) { case ATTRIBUTE_SFRTITLEWINDOW: // window ... case ATTRIBUTE_SFRBUTTONCONTROL: // button ... case ATTRIBUTE_SFRRADIOBUTTONCONTROL: // radiobutton ... }
[ public, const ] SFRResponderPtr GetBack( SFCType type = TYPE_WILDCARD // type SFCType attribute = ATTRIBUTE_WILDCARD // attribute BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE // behavior );
Specify the "Type" of responder to match.
TYPE_WILDCARD, which means arbitrary "Type", is the default value.
Specify the "Attribute" of responder to match.
ATTRIBUTE_WILDCARD, which means arbitrary "Attribute", is the default value.
Specify the "Behavior" of responder to match.
Visible | Enable for responder (STATUS_VISIBLE|STATUS_ENABLE) is the default value.
BEHAVIOR_NONE, which means arbitrary "Behavior", can be specified.
Return the first child responder to match the specified condition, searching from background to foremost. If no child responder to match the specified condition is found, a null will be returned.
The code to get the most background responder regardless of "Type", "Attribute", nor "Behavior" is as below:
SFRResponderPtr r; SFRResponderPtr w; w = r->GetBack();
SFRResponder::GetFront | SFRResponder::GetNthForward | SFRResponder::GetNthBackward | SFRResponder::GetIndexForward | SFRResponder::GetIndexBackward
[ public, const ] SFXRectangleConstRef GetBaseBound(Void);
The code to move the responder 10 pixels right and 10 pixels down is as below:
SFRResponderPtr r; SFXRectangle u; u = r->GetBaseBound(); u.Offset(10,10); r->SetBaseBound(u);
SFRResponder::SetBaseBound | SFRResponder::GetContentBound | SFRResponder::GetVirtualBound | SFRResponder::GetBaseWorld
[ public, const ] SFXRectangle GetBaseWorld(Void);
The SFRResponder::GetBaseWorld function returns the rectangle of base region. The coordinate of left-up corner is always ( 0, 0 ).
SFRResponder::GetContentWorld | SFRResponder::GetVirtualWorld | SFRResponder::SetBaseBound | SFRResponder::GetBaseBound
[ public, const ] SFXRectangleConstRef GetContentBound(Void);
SFRResponder::SetContentBound | SFRResponder::GetBaseBound | SFRResponder::GetVirtualBound | SFRResponder::GetContentWorld
[ public, const ] SFXRectangle GetContentWorld(Void);
The SFRResponder::GetContentWorld function returns the rectangle of content region. The coordinate of left-top corner is always ( 0, 0 ).
SFRResponder::GetBaseWorld | SFRResponder::GetVirtualWorld | SFRResponder::SetContentBound | SFRResponder::GetContentBound
[ public, const ] SFRResponderPtr GetDirector(Void);
[ public, const ] SFRResponderPtr GetFocus(Void);
If there is no responder being focused, null is returned.
[ public, const ] SFXMargin GetFrameMargin(Void);
[ public, const ] SFRResponderPtr GetFront( SFCType type = TYPE_WILDCARD // type SFCType attribute = ATTRIBUTE_WILDCARD // attribute BehaviorType compare = STATUS_VISIBLE | STATUS_ENABLE // behavior );
Specify the "Type" of responder to match.
TYPE_WILDCARD, which means arbitrary "Type", is the default value.
Specify the "Attribute" of responder to match.
ATTRIBUTE_WILDCARD, which means arbitrary "Attribute", is the default value.
Specify the "Behavior" of responder to match.
Visible | Enable for responder (STATUS_VISIBLE|STATUS_ENABLE) is the default value.
BEHAVIOR_NONE, which means arbitrary "Behavior", can be specified.
Return the first child responder to match the specified condition, searching from foremost to background. If no child responder to match the specified condition is found, a null will be returned.
The code to get the most foreground responder regardless of "Type", "Attribute", nor "Behavior", is as below:
SFRResponderPtr r; SFRResponderPtr w; w = r->GetFront();
SFRResponder::GetBack | SFRResponder::GetNthForward | SFRResponder::GetNthBackward | SFRResponder::GetIndexForward | SFRResponder::GetIndexBackward
[ public, const ] SInt16 GetIndexBackward( SFCType type = TYPE_WILDCARD // type SFCType attribute = ATTRIBUTE_WILDCARD // attribute BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE // behavior );
Specify the "Type" of responder to match.
TYPE_WILDCARD, which means arbitrary "Type", is the default value.
Specify the "Attribute" of responder to match.
ATTRIBUTE_WILDCARD, which means arbitrary "Attribute", is the default value.
Specify the "Behavior" of responder to match.
Visible | Enable for responder (STATUS_VISIBLE|STATUS_ENABLE) is the default value.
BEHAVIOR_NONE, which means arbitrary "Behavior", can be specified.
Return the index number from background among sibling responders to match the specified condition. The index starts from 0.
SFRResponder::GetIndexForward | SFRResponder::GetNthForward | SFRResponder::GetNthBackward | SFRResponder::GetFront | SFRResponder::GetBack
[ public, const ] SInt16 GetIndexForward( SFCType type = TYPE_WILDCARD // type SFCType attribute = ATTRIBUTE_WILDCARD // attribute BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE // behavior );
Specify the "Type" of responder to match.
TYPE_WILDCARD, which means arbitrary "Type", is the default value.
Specify the "Attribute" of responder to match.
ATTRIBUTE_WILDCARD, which means arbitrary "Attribute", is the default value.
Specify the "Behavior" of responder to match.
Visible | Enable for responder (STATUS_VISIBLE|STATUS_ENABLE) is the default value.
BEHAVIOR_NONE, which means arbitrary "Behavior", can be specified.
Return the index number from foreground among sibling responders to match the specified condition. The index starts from 0.
SFRResponder::GetIndexBackward | SFRResponder::GetNthForward | SFRResponder::GetNthBackward | SFRResponder::GetFront | SFRResponder::GetBack
[ public, const ] Bool GetInheritEnable(Void);
If a parent responder in the ownership hierarchy is disabled for response, the GetInheritEnable function returns the " Disable " status.
Usage | |
---|---|
Since the " Enable / Disable " status of a responder including its parent responders can be gotten by using the SFRResponder::GetInheritEnable function, this function is used to draw the responder and so on. |
SFRResponder::GroupStatusEnable | SFRResponder::SetStatusEnable | SFRResponder::GetStatusEnable
[ public, const ] Bool GetInheritFocus(Void);
If a parent responder in the ownership hierarchy is unfocused, the SFRResponder::GetInheritFocus function returns the " Unfocused " status.
Usage | |
---|---|
Since the " Focused / Unfocused " status of a responder including its parent responders can be gotten by using the SFRResponder::GetInheritFocus function, this function is used to draw the responder and so on. |
[ public, const ] Bool GetInheritTarget(Void);
If a parent responder in the ownership hierarchy is non-target, the SFRResponder::GetInheritTarget function returns the " Not-Target " status.
Usage | |
---|---|
Since the " Target / Not-Target " status of a responder including its parent responders can be gotten by using the SFRResponder::GetInheritTarget function, this function is used to draw the responder and so on. |
[ public, const ] Bool GetInheritVisible(Void);
If a parent responder in the ownership hierarchy is invisible, the SFRResponder::GetInheritVisible function returns the " Invisible " status.
Usage | |
---|---|
Since the " Visible / Invisible " status of a responder including its parent responders can be gotten by using the SFRResponder::GetInheritVisible function, this function is used to draw the responder and so on. |
SFRResponder::GroupStatusVisible | SFRResponder::SetStatusVisible | SFRResponder::GetStatusVisible
[ public, const ] SFRResponderPtr GetLeft( SFCType type = TYPE_WILDCARD // type SFCType attribute = ATTRIBUTE_WILDCARD // attribute BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE // behavior );
Specify the "Type" of responder to match.
TYPE_WILDCARD, which means arbitrary "Type", is the default value.
Specify the "Attribute" of responder to match.
ATTRIBUTE_WILDCARD, which means arbitrary "Attribute", is the default value.
Specify the "Behavior" of responder to match.
Visible | Enable for responder (STATUS_VISIBLE|STATUS_ENABLE) is the default value.
BEHAVIOR_NONE, which means arbitrary "Behavior", can be specified.
Return the sibling responder located at one more left-hand to match the specified search condition. If the responder is at the most left-hand, search from the most right-hand sibling responder. If no sibling responder is found, a null will be returned.
SFRResponder::GetRight | SFRResponder::Group | SFRResponder::Ungroup
[ public, const ] SInt16 GetMoveInterval(Void);
The SFRResponder::GetMoveInterval function returns the pixel number(move interval) that the responder is moved when calling the SFRResponder::MoveUpHandler, SFRResponder::MoveDownHandler, SFRResponder::MoveLeftHandler, or SFRResponder::MoveRightHandler function.
The default value of move interval is 8 pixels. To set the move interval by the above functions, use the SFRResponder::SetMoveInterval function.
SFRResponder::SetMoveInterval | SFRResponder::MoveUpHandler | SFRResponder::MoveDownHandler | SFRResponder::MoveLeftHandler | SFRResponder::MoveRightHandler
[ public, const ] SInt16 GetMoveMargin(Void);
The default value of move margin is 1 pixel. To set this margin, use the SFRResponder::SetMoveMargin function.
To move the child responder, use the SFRResponder::MoveUpHandler, SFRResponder::MoveDownHandler, SFRResponder::MoveRightHandler, SFRResponder::MoveLeftHandler, or SFRResponder::Move function.
SFRResponder::SetMoveMargin | SFRResponder::MoveUpHandler | SFRResponder::MoveDownHandler | SFRResponder::MoveLeftHandler | SFRResponder::MoveRightHandler | SFRResponder::Move
[ public, const ] SFRResponderPtr GetNext( SFCType type = TYPE_WILDCARD // type SFCType attribute = ATTRIBUTE_WILDCARD // attribute BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE // behavior Bool repeat = true // if not found, search from the beginning again );
Specify the "Type" of responder to match.
TYPE_WILDCARD, which means arbitrary "Type", is the default value.
Specify the "Attribute" of responder to match.
ATTRIBUTE_WILDCARD, which means arbitrary "Attribute", is the default value.
Specify the "Behavior" of responder to match.
Visible | Enable for responder (STATUS_VISIBLE|STATUS_ENABLE) is the default value.
BEHAVIOR_NONE, which means arbitrary "Behavior", can be specified.
Return the sibling responder located at one more background to match the specified search condition. If the responder is at the most background, search from the most foreground sibling responder. If no sibling responder is found, a null will be returned.
[ public, const ] SFRResponderPtr GetNthBackward( SInt16 index // index SFCType type = TYPE_WILDCARD // type SFCType attribute = ATTRIBUTE_WILDCARD // attribute BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE // behavior );
The index value is 0-based. Minus value is invalid.
Specify the "Type" of responder to match.
TYPE_WILDCARD, which means arbitrary "Type", is the default value.
Specify the "Attribute" of responder to match.
ATTRIBUTE_WILDCARD, which means arbitrary "Attribute", is the default value.
Specify the "Behavior" of responder to match.
Visible | Enable for responder (STATUS_VISIBLE|STATUS_ENABLE) is the default value.
BEHAVIOR_NONE, which means arbitrary "Behavior", can be specified.
Return the Nth child responder from the most background that matches the specified search condition. If no child responder is found, a null will be returned.
SFRResponder::GetNthForward | SFRResponder::GetIndexForward | SFRResponder::GetIndexBackward | SFRResponder::GetFront | SFRResponder::GetBack
[ public, const ] SFRResponderPtr GetNthForward( SInt16 index // index SFCType type = TYPE_WILDCARD // type SFCType attribute = ATTRIBUTE_WILDCARD // attribute BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE // behavior );
The index value is 0-based. Minus value is invalid.
Specify the "Type" of responder to match.
TYPE_WILDCARD, which means arbitrary "Type", is the default value.
Specify the "Attribute" of responder to match.
ATTRIBUTE_WILDCARD, which means arbitrary "Attribute", is the default value.
Specify the "Behavior" of responder to match.
Visible | Enable for responder (STATUS_VISIBLE|STATUS_ENABLE) is the default value.
BEHAVIOR_NONE, which means arbitrary "Behavior", can be specified.
Return the Nth child responder from the most foreground that matches the specified search condition. If no child responder is found, a null will be returned.
SFRResponder::GetNthBackward | SFRResponder::GetIndexForward | SFRResponder::GetIndexBackward | SFRResponder::GetFront | SFRResponder::GetBack
[ public, const ] SFRResponderPtr GetPrevious( SFCType type = TYPE_WILDCARD // type SFCType attribute = ATTRIBUTE_WILDCARD // attribute BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE // behavior Bool repeat = true // if not found, search from the beginning again );
Specify the "Type" of responder to match.
TYPE_WILDCARD, which means arbitrary "Type", is the default value.
Specify the "Attribute" of responder to match.
ATTRIBUTE_WILDCARD, which means arbitrary "Attribute", is the default value.
Specify the "Behavior" of responder to match.
Visible | Enable for responder (STATUS_VISIBLE|STATUS_ENABLE) is the default value.
BEHAVIOR_NONE, which means arbitrary "Behavior", can be specified.
Return the sibling responder located at one more foreground to match the specified search condition. If the responder is at the most foreground, search from the most background sibling responder. If no sibling responder is found, a null will be returned.
SFRResponder::GetNext | SFRResponder::GetFront | SFRResponder::GetBack
[ protected, const ] Bool GetPropertyClosable(Void);
[ protected, const ] Bool GetPropertyDirect(Void);
[ protected, const ] Bool GetPropertyMovable(Void);
[ protected, const ] Bool GetPropertyScrollable(Void);
[ protected, const ] Bool GetPropertySelect(Void);
[ protected, const ] Bool GetPropertyTravel(Void);
[ public, const ] VoidPtr GetReference(Void);
SFRButtonControlPtr button; SInt32 i; // create 10 buttons with reference value for (i = 0; i < 10; ++i) { button = new SFRButtonControl(this, SFXRectangle(0, i * 30, 20, 20), "); // set the reference value onto the button for identification button->SetReference(reinterpret_cast<VoidPtr>(i)); } ... // get the reference value SInt32 number = reinterpret_cast<SInt32>(button->GetReference());
[ public, const ] SFRResponderPtr GetRight( SFCType type = TYPE_WILDCARD // type SFCType attribute = ATTRIBUTE_WILDCARD // attribute BehaviorType compare = STATUS_VISIBLE|STATUS_ENABLE // behavior );
Specify the "Type" of responder to match.
TYPE_WILDCARD, which means arbitrary "Type", is the default value.
Specify the "Attribute" of responder to match.
ATTRIBUTE_WILDCARD, which means arbitrary "Attribute", is the default value.
Specify the "Behavior" of responder to match.
Visible | Enable for responder (STATUS_VISIBLE|STATUS_ENABLE) is the default value.
BEHAVIOR_NONE, which means arbitrary "Behavior", can be specified.
Return the sibling responder located at one more right-hand to match the specified search condition. If the responder is at the most right-hand, search from the most left-hand sibling responder. If no sibling responder is found, a null will be returned.
SFRResponder::GetLeft | SFRResponder::Group | SFRResponder::Ungroup
[ public, const ] SInt16 GetScrollInterval(Void);
The SFRResponder::GetScrollInterval function returns the pixel number(scroll interval) that the virtual region of responder is scrolled when calling the SFRResponder::ScrollUpHandler, SFRResponder::ScrollDownHandler, SFRResponder::ScrollLeftHandler, or SFRResponder::ScrollRightHandler function.
The default value of scroll interval is 8 pixels. To set the scroll interval by the above functions, use the SFRResponder::SetScrollInterval function.
Reference: Scrolling
SFRResponder::SetScrollInterval | SFRResponder::ScrollUpHandler | SFRResponder::ScrollDownHandler | SFRResponder::ScrollLeftHandler | SFRResponder::ScrollRightHandler
[ public, const ] Bool GetStatusEnable(Void);
SFRResponder::GroupStatusEnable | SFRResponder::SetStatusEnable | SFRResponder::GetInheritEnable
[ public, const ] Bool GetStatusFocus(Void);
[ public, const ] Bool GetStatusTarget(Void);
[ public, const ] Bool GetStatusVisible(Void);
SFRResponder::GroupStatusVisible | SFRResponder::SetStatusVisible | SFRResponder::GetInheritVisible
[ public, const ] SFXGrid GetTranslate(Void);
SFRResponder::SetTranslate | SFRResponder::SetVirtualBound | SFRResponder::GetVirtualBound
[ public, const ] SInt16 GetTravelMargin(Void);
The default value of this margin is 4 pixels. To set this margin, use the SFRResponder::SetTravelMargin function.
To scroll the rectangle in the virtual region but outside the content region into the content region automatically, use the SFRResponder::Travel function.
[ public, const ] SFCType GetType(Void);
Get the type of the responder. The return value should be 1 of below:
TYPE_SFRAPPLICATION ( Application responder ) |
TYPE_SFRWINDOW ( Window responder ) |
TYPE_SFRDIALOG ( Dialog responder ) |
TYPE_SFRMENU ( Menu responder ) |
TYPE_SFRCONTROL ( Control responder ) |
TYPE_SFRPANE ( Pane responder ) |
[ public, const ] SFXRectangleConstRef GetVirtualBound(Void);
The code to move the virtual region 10 pixels left and 10 pixels up is as below:
SFRResponderPtr r; SFXRectangle u; u = r->GetVirtualBound(); u.Offset(-10,-10); r->SetVirtualBound(u);
SFRResponder::SetVirtualBound | SFRResponder::GetBaseBound | SFRResponder::GetContentBound | SFRResponder::GetVirtualWorld
[ public, const ] SFXRectangle GetVirtualWorld(Void);
This function retuns the rectangle of virtual world. The coordinate of left-up corner must be ( 0, 0 ).
SFRResponder::GetBaseWorld | SFRResponder::GetContentWorld | SFRResponder::SetVirtualBound | SFRResponder::GetVirtualBound
[ public, virtual ] Void Group( SFRResponderPtr with // pointer to the representative responder of group );
To apply specific processing to all the related responders at once, group together them by using the SFRResponder::Group function.
For example, once grouping together several SFRRadiobuttonControl objects, one of SFRRadiobuttonControl objects is exclusively selected automatically.
The code to group together the SFRRadiobuttonControl objects is as below:
SFRRadiobuttonControlPtr rb0; SFRRadiobuttonControlPtr rb1; SFRRadiobuttonControlPtr rb2; rb1->Group(rb0); rb2->Group(rb0);
SFRResponder::Ungroup | SFRResponder::GetLeft | SFRResponder::GetRight
[ public ] Void GroupMove( SFXSizeConstRef size // size to move );
SFRResponder::Move | SFRResponder::Group | SFRResponder::Ungroup
[ public ] Void GroupScroll( SFXSizeConstRef size // size to scroll );
Reference: Scrolling
SFRResponder::Scroll | SFRResponder::Group | SFRResponder::Ungroup
[ public ] Void GroupSelect(Void);
SFRResponder::SetStatusEnable | SFRResponder::GetStatusEnable | SFRResponder::GetInheritEnable | SFRResponder::Group | SFRResponder::Ungroup
SFRResponder::SetStatusVisible | SFRResponder::GetStatusVisible | SFRResponder::GetInheritVisible | SFRResponder::Group | SFRResponder::Ungroup
[ public ] Void InvalidateBase(Void);
[ public ] Void InvalidateBase( SFXRectangleConstRef rect // area in the base region to be redrawn );
The code to register all the base region as an area to be redrawn is as below:
InvalidateBase();
[ public ] Void InvalidateContent(Void);
[ public ] Void InvalidateContent( SFXRectangleConstRef rect // area in the base region to be redrawn );
The code to register all the content region as an area to be redrawn is as below:
InvalidateContent();
[ public ] Void InvalidateVirtual(Void);
[ public ] Void InvalidateVirtual( SFXRectangleConstRef rect // area in the virtual region to be redrawn );
The code to register all the virtual region as an area to be redrawn is as below:
InvalidateVirtual();
[ public, virtual ] Bool Invoke( SFXEventConstRef event // event to send );
To change the method to handle the specified event, override the SFRResponder::Invoke function.
[ public ] Void Move( SFXSizeConstRef size // size to move );
[ public ] Bool MoveDownHandler(Void);
[Precondition] The PROPERTY_MOVABLE flag of the responder must be set.
It is necessary to associate the DOWN_ARROW key event and so on with the SFRResponder::MoveDownHandler function by using the SFRHandler::RegisterHandler function.
The pixel number to move the responder down by the SFRResponder::MoveDownHandler function can be set by using the SFRResponder::SetMoveInterval function.
Each of the following examples is the code that moves the window 10 pixel down.
Example 793. The code to move the window 10 pixel down by the SFRResponder::MoveDownHandler function
SFRWindowPtr _window; // create the window // set the behavior of window to PROPERTY_MOVABLE _window = new SFRTitleWindow(this, SFXRectangle(10, 10, 100, 180), "sample", SFRTitleWindow::ALIGN_LEFT, BEHAVIOR_SFRTITLEWINDOW | PROPERTY_MOVABLE); // register the MoveDownHandler function as an event handler // when the DOWN_ARROW key is pressed, move this window down RegisterHandler(SFEVT_KEY, AVK_DOWN, HANDLER_AFTER, HANDLER_FUNCTION(MoveDownHandler)); // set the pixel number to move the window down SetMoveInterval(10);
Example 794. The code to move the window 10 pixel down by the key handler
SFRWindowPtr _window; // create the window // it is unnecessary to set the behavior of window to PROPERTY_MOVABLE _window = new SFRTitleWindow(this, SFXRectangle(10, 10, 100, 180), "sample"); // register the key handler RegisterHandler(SFEVT_KEY, HANDLER_AFTER, HANDLER_FUNCTION(OnKey)); // content of the key handler HANDLER_IMPLEMENT_BOOLEVENT(MoveSample, OnKey, event) { switch (event.GetP16()) { case AVK_DOWN: // move the window 10 pixel down _window->Move(SFXSize(0, 10)); return true; } return false; }
SFRResponder::MoveUpHandler | SFRResponder::MoveLeftHandler | SFRResponder::MoveRightHandler | SFRResponder::BehaviorEnum
[ public ] Bool MoveLeftHandler(Void);
[Precondition] The PROPERTY_MOVABLE flag of responder must be set.
It is necessary to associate the LEFT_ARROW key event and so on with the SFRResponder::MoveLeftHandler function by using the SFRHandler::RegisterHandler function.
The pixel number to move the responder left by the SFRResponder::MoveLeftHandler function can be set by using the SFRResponder::SetMoveInterval function.
Each of the following examples is the code that moves the window 10 pixel left.
Example 795. The code to move the window 10 pixel left by the SFRResponder::MoveLeftHandler function
SFRWindowPtr _window; // create the window // set the behavior to PROPERTY_MOVABLE _window = new SFRTitleWindow(this, SFXRectangle(10, 10, 100, 180), "sample", SFRTitleWindow::ALIGN_LEFT, BEHAVIOR_SFRTITLEWINDOW | PROPERTY_MOVABLE); // register the MoveLeftHandler function as an event handler // when the LEFT_ARROW key is pressed, move this window left RegisterHandler(SFEVT_KEY, AVK_LEFT, HANDLER_AFTER, HANDLER_FUNCTION(MoveLeftHandler)); // set the pixel number to move the window left SetMoveMargin(10);
Example 796. The code to move the window 10 pixel left by the key handler
SFRWindowPtr _window; // create the window // it is unnecessary to set the behavior of window to PROPERTY_MOVABLE _window = new SFRTitleWindow(this, SFXRectangle(10, 10, 100, 180), "sample"); // register the key handler RegisterHandler(SFEVT_KEY, HANDLER_AFTER, HANDLER_FUNCTION(OnKey)); // content of the key handler HANDLER_IMPLEMENT_BOOLEVENT(MoveSample, OnKey, event) { switch (event.GetP16()) { case AVK_LEFT: // move the window 10 pixel left _window->Move(SFXSize(-10, 0)); return true; } return false; }
SFRResponder::MoveUpHandler | SFRResponder::MoveDownHandler | SFRResponder::MoveRightHandler | SFRResponder::BehaviorEnum
[ public ] Bool MoveRightHandler(Void);
[Precondition] The PROPERTY_MOVABLE flag of responder must be set.
It is necessary to associate the RIGHT_ARROW key event and so on with the SFRResponder::MoveRightHandler function by using the SFRHandler::RegisterHandler function.
The pixel number to move the responder right by the SFRResponder::MoveRightHandler function can be set by using the SFRResponder::SetMoveInterval function.
Each of the following examples is the code that moves the window 10 pixel right.
Example 797. The code to move the window 10 pixel right by the SFRResponder::MoveRightHandler function
SFRWindowPtr _window; // create the window // set the behavior to PROPERTY_MOVABLE _window = new SFRTitleWindow(this, SFXRectangle(10, 10, 100, 180), "sample", SFRTitleWindow::ALIGN_LEFT, BEHAVIOR_SFRTITLEWINDOW | PROPERTY_MOVABLE); // register the MoveRightHandler function as an event handler // when the RIGHT_ARROW key is pressed, move this window right RegisterHandler(SFEVT_KEY, AVK_RIGHT, HANDLER_AFTER, HANDLER_FUNCTION(MoveRightHandler)); // set the pixel number to move the window right SetMoveMargin(10);
Example 798. The code to move the window 10 pixel right by the key handler
SFRWindowPtr _window; // create the window // it is unnecessary to set the behavior of window to PROPERTY_MOVABLE _window = new SFRTitleWindow(this, SFXRectangle(10, 10, 100, 180), "sample"); // register the key handler RegisterHandler(SFEVT_KEY, HANDLER_AFTER, HANDLER_FUNCTION(OnKey)); // content of the key handler HANDLER_IMPLEMENT_BOOLEVENT(MoveSample, OnKey, event) { switch (event.GetP16()) { case AVK_RIGHT: // move the window _window->Move(SFXSize(10, 0)); return true; } return false; }
SFRResponder::MoveUpHandler | SFRResponder::MoveDownHandler | SFRResponder::MoveLeftHandler | SFRResponder::BehaviorEnum
[ public ] Bool MoveUpHandler(Void);
[Precondition] The PROPERTY_MOVABLE flag of the responder must be set.
It is necessary to associate the UP_ARROW key event and so on with the SFRResponder::MoveUpHandler function by using the SFRHandler::RegisterHandler function.
The pixel number to move the responder up by the SFRResponder::MoveUpHandler function can be set by using the SFRResponder::SetMoveInterval function.
Each of the following examples is the code that moves the window 10 pixel up.
Example 799. The code to move the window 10 pixel up by the SFRResponder::MoveUpHandler function
SFRWindowPtr _window; // create the window // set the behavior of window to PROPERTY_MOVABLE _window = new SFRTitleWindow(this, SFXRectangle(10, 10, 100, 180), "sample", SFRTitleWindow::ALIGN_LEFT, BEHAVIOR_SFRTITLEWINDOW | PROPERTY_MOVABLE); // register the MoveUpHandler function as an event handler // when the UP_ARROW key is pressed, move this window up RegisterHandler(SFEVT_KEY, AVK_UP, HANDLER_AFTER, HANDLER_FUNCTION(MoveUpHandler)); // set the pixel number to move the window up SetMoveMargin(10);
Example 800. The code to move the window 10 pixel up by the key handler
SFRWindowPtr _window; // create the window // it is unnecessary to set the behavior of window to PROPERTY_MOVABLE _window = new SFRTitleWindow(this, SFXRectangle(10, 10, 100, 180), "sample"); // register the key handler RegisterHandler(SFEVT_KEY, HANDLER_AFTER, HANDLER_FUNCTION(OnKey)); // content of the key handler HANDLER_IMPLEMENT_BOOLEVENT(MoveSample, OnKey, event) { switch (event.GetP16()) { case AVK_UP: // move the window 10 pixel up _window->Move(SFXSize(0, -10)); return true; } return false; }
SFRResponder::MoveDownHandler | SFRResponder::MoveLeftHandler | SFRResponder::MoveRightHandler | SFRResponder::BehaviorEnum
[ public ] Void Scroll( SFXSizeConstRef size // size to scroll );
Reference: Scrolling
[ public ] Bool ScrollDownHandler(Void);
[Precondition] The PROPERTY_SCROLLABLE flag of responder must be set.
It is necessary to associate the DOWN_ARROW key event and so on with the SFRResponder::ScrollDownHandler function by using the SFRHandler::RegisterHandler function.
The scroll interval is set by the SFRResponder::SetScrollInterval function.
Reference: Scrolling
RegisterHandler(SFEVT_KEY, AVK_DOWN, HANDLER_AFTER, HANDLER_FUNCTION(ScrollDownHandler));
SFRHandler::RegisterHandler | SFRResponder::SetScrollInterval | SFRResponder::ScrollUpHandler | SFRResponder::ScrollLeftHandler | SFRResponder::ScrollRightHandler | SFRResponder::BehaviorEnum
[ public ] Bool ScrollLeftHandler(Void);
[Precondition] The PROPERTY_SCROLLABLE flag of responder must be set.
It is necessary to associate the LEFT_ARROW key event and so on with the SFRResponder::ScrollLeftHandler function by using the SFRHandler::RegisterHandler function.
The scroll interval is set by the SFRResponder::SetScrollInterval function.
Reference: Scrolling
RegisterHandler(SFEVT_KEY, AVK_LEFT, HANDLER_AFTER, HANDLER_FUNCTION(ScrollLeftHandler));
SFRHandler::RegisterHandler | SFRResponder::SetScrollInterval | SFRResponder::ScrollUpHandler | SFRResponder::ScrollDownHandler | SFRResponder::ScrollRightHandler | SFRResponder::BehaviorEnum
[ public ] Bool ScrollRightHandler(Void);
[Precondition] The PROPERTY_SCROLLABLE flag of responder must be set.
It is necessary to associate the RIGHT_ARROW key event and so on with the SFRResponder::ScrollRightHandler function by using the SFRHandler::RegisterHandler function.
The scroll interval is set by the SFRResponder::SetScrollInterval function.
Reference: Scrolling
RegisterHandler(SFEVT_KEY, AVK_RIGHT, HANDLER_AFTER, HANDLER_FUNCTION(ScrollRightHandler));
SFRHandler::RegisterHandler | SFRResponder::SetScrollInterval | SFRResponder::ScrollUpHandler | SFRResponder::ScrollDownHandler | SFRResponder::ScrollLeftHandler | SFRResponder::BehaviorEnum
[ public ] Bool ScrollUpHandler(Void);
[Precondition] The PROPERTY_SCROLLABLE flag of responder must be set.
It is necessary to associate the UP_ARROW key event and so on with the SFRResponder::ScrollUpHandler function by using the SFRHandler::RegisterHandler function.
The scroll interval is set by the SFRResponder::SetScrollInterval function.
Reference: Scrolling
RegisterHandler(SFEVT_KEY, AVK_UP, HANDLER_AFTER, HANDLER_FUNCTION(ScrollUpHandler));
SFRHandler::RegisterHandler | SFRResponder::SetScrollInterval | SFRResponder::ScrollDownHandler | SFRResponder::ScrollLeftHandler | SFRResponder::ScrollRightHandler | SFRResponder::BehaviorEnum
[ public, virtual ] Void Select(Void);
[ public ] Bool SelectHandler(Void);
[Precondition] The precondition of target status is that the responder must be focused. Otherwise, the most foreground responder will be focused.
For details: Behavior
It is necessary to associate the SELECT key event and so on with RegisterHandler function.
RegisterHandler(SFEVT_KEY, AVK_SELECT, HANDLER_AFTER, HANDLER_FUNCTION(SelectHandler));
[ public, virtual ] Void SetBaseBound( SFXRectangleConstRef rect // value to set );
The code to move the responder 10 pixels right and 10 pixels down is as below:
SFRResponderPtr r; SFXRectangle u; u = r->GetBaseBound(); u.Offset(10,10); r->SetBaseBound(u);
SFRResponder::GetBaseBound | SFRResponder::SetContentBound | SFRResponder::SetVirtualBound | SFRResponder::GetBaseWorld
[ public, virtual ] Void SetContentBound( SFXRectangleConstRef rect // value to set );
SFRResponder::GetContentBound | SFRResponder::SetBaseBound | SFRResponder::SetVirtualBound | SFRResponder::GetContentWorld
[ public ] Void SetFrameMargin( SFXMarginConstRef param // margin to set );
The SFRResponder::SetMoveInterval function sets the pixel number(move interval) that the responder is moved when calling the SFRResponder::MoveUpHandler, SFRResponder::MoveDownHandler, SFRResponder::MoveLeftHandler, or SFRResponder::MoveRightHandler function.
The default value of move interval is 8 pixels. To get the move interval by the above functions, use the SFRResponder::GetMoveInterval function.
SFRResponder::GetMoveInterval | SFRResponder::MoveUpHandler | SFRResponder::MoveDownHandler | SFRResponder::MoveLeftHandler | SFRResponder::MoveRightHandler
The default value of this margin is 1 pixel. To get this margin, use the SFRResponder::GetMoveMargin function.
To move the child responder, use the SFRResponder::MoveUpHandler, SFRResponder::MoveDownHandler, SFRResponder::MoveRightHandler, SFRResponder::MoveLeftHandler, or SFRResponder::Move function.
SFRResponder::GetMoveMargin | SFRResponder::MoveUpHandler | SFRResponder::MoveDownHandler | SFRResponder::MoveLeftHandler | SFRResponder::MoveRightHandler | SFRResponder::Move
The SFRResponder::SetScrollInterval function sets the pixel number(scroll interval) that the virtual region of responder is scrolled when calling the SFRResponder::ScrollUpHandler, SFRResponder::ScrollDownHandler, SFRResponder::ScrollLeftHandler, or SFRResponder::ScrollRightHandler function.
The default value of scroll interval is 8 pixels. To get the scroll interval by the above functions, use the SFRResponder::GetScrollInterval function.
Reference: Scrolling
SFRResponder::GetScrollInterval | SFRResponder::ScrollUpHandler | SFRResponder::ScrollDownHandler | SFRResponder::ScrollLeftHandler | SFRResponder::ScrollRightHandler
SFRResponder::GroupStatusEnable | SFRResponder::GetStatusEnable | SFRResponder::GetInheritEnable
SFRResponder::GroupStatusVisible | SFRResponder::GetStatusVisible | SFRResponder::GetInheritVisible
[ public ] Void SetTranslate( SFXGridConstRef point // value to set );
SFRResponder::GetTranslate | SFRResponder::SetVirtualBound | SFRResponder::GetVirtualBound
The default value of this margin is 4 pixels. To get this margin, use the SFRResponder::GetTravelMargin function.
To scroll the rectangle in the virtual region but outside the content region into the content region automatically, use the SFRResponder::Travel function.
[ public, virtual ] Void SetVirtualBound( SFXRectangleConstRef rect // value to set );
The code to move the virtual region 10 pixels left and 10 pixels up is as below:
SFRResponderPtr r; SFXRectangle u; u = r->GetVirtualBound(); u.Offset(-10,-10); r->SetVirtualBound(u);
SFRResponder::GetVirtualBound | SFRResponder::SetBaseBound | SFRResponder::SetContentBound | SFRResponder::GetVirtualWorld
[ public ] Void Travel( SFXRectangleConstRef rect // rectangle to scroll into the content region );
If the specified rectangle is inside the content region, it will not be scrolled.
[ public, virtual ] Void Ungroup(Void);
SFRResponder::Group | SFRResponder::GetLeft | SFRResponder::GetRight
enum BehaviorEnum;
The constants that represent the behavior of responder are as below.
BEHAVIOR_NONE | - |
STATUS_VISIBLE | Visible or Invisible |
STATUS_ENABLE | Enable or Unable to respond |
STATUS_FOCUS | Focused or Not-Focused |
STATUS_TARGET | Target or Not-target |
APPEARANCE_TRANSPARENT | Transparently drawn or not |
PROPERTY_DIRECT | Always targeted or not |
PROPERTY_SELECT | Whether or not the responder is moved at the most foreground when it is selected. |
PROPERTY_TRAVEL | Whether or not the virtual region is automatically scrolled so that the focused responder can be inside the content region when it is outside the content region. |
PROPERTY_CLOSABLE | Whether or not the responder can be destroyed by the CLEAR key. |
PROPERTY_MOVABLE | Whether or not the responder can be moved by the number keys. |
PROPERTY_SCROLLABLE | Whether or not the virtual region can be scrolled by the number keys. |
TRACER_PROVIDE | Whether or not the responder permits the other responders to duplicately handle the same events that it handles. |
SFRResponder::SFRResponder | SFRResponder::GetStatusVisible | SFRResponder::GetStatusEnable | SFRResponder::GetStatusFocus | SFRResponder::GetStatusTarget | SFRResponder::GetAppearanceTransparent | SFRResponder::GetPropertyDirect | SFRResponder::GetPropertySelect | SFRResponder::GetPropertyTravel | SFRResponder::GetPropertyClosable | SFRResponder::GetPropertyMovable | SFRResponder::GetPropertyScrollable | SFRTracer::RegisterTracer
Copyright(c) 2002 - 2024 Sophia Cradle Incorporated All Rights Reserved. |