PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFYRadiobuttonControl
Abstract class of the control that represents a radio button.
#include <SFYRadiobuttonControl.h.hpp>
class SFYRadiobuttonControl : public SFYCheckboxControl;
SFMTYPEDEFRESPONDER(SFYRadiobuttonControl)

Inheritance diagram

 Inheritance diagram of SFYRadiobuttonControlClass

Collaboration diagram

 Collaboration diagram of SFYRadiobuttonControlClass

Description

How to use

SFYRadiobuttonControl is the abstract base class to define and implement a user-defined radio button control.

In SFYRadiobuttonControl, functions to draw the check box, switch the checked state exclusively and manage the operation key are implemented by default. Several handlers with default behaviour are also implemented as virtual functions.

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

Events and their handlers

In SFYRadiobuttonControl, the following handlers(virtual functions) are registered for the key event[SFEVT_KEY] on the operation key, the region event[SFEVT_RESPONDER_BOUND], and the drawing event[SFEVT_RESPONDER_RENDER].

In a radio button control inheriting from SFYRadiobuttonControl, the following handlers(virtual functions) are booted up first.

Table 214. Events and their Handlers

Event Handler(Virtual function) Default behaviour Override
SFEVT_KEY event of the operation key set with SFYButtonControl::SetOperateKey SFYButtonControl::HandleOperateKey - Optional
SFEVT_KEY_PRESS event of the operation key set with SFYButtonControl::SetOperateKey SFYButtonControl::HandleOperateKeyPress - Optional
SFEVT_KEY_RELEASE event of the operation key set with SFYButtonControl::SetOperateKey SFYRadiobuttonControl::HandleOperateKeyRelease Send the result event of switching the checked state exclusively *1 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 SFYControl::HandleBoundReal Equalize the virtual region with the real region *2 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] NOTE

*1. After switching the checked state exclusively, execute SFYResponder::InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_OK, GetCurrentValue()), false).

*2. Execute SFYResponder::SetVirtualBound(SFXRectangle(SFXGrid::ZeroInstance(), GetRealBound().GetSize())). In other words, equalize the virtual region with the real region.

The code to make a user-defined radio button is as follows:

Example 873. Declaration

SFMTYPEDEFRESPONDER(USRRadiobuttonControl)
class USRRadiobuttonControl: public SFYRadiobuttonControl {
    SFMSEALRESPONDER(USRRadiobuttonControl)
    SFMRESPONDERINSTANTIATESIX(USRRadiobuttonControl, SFYRadiobuttonControl, SFYCheckboxControl, SFYButtonControl, SFYControl, 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', 'R', 'D', 'O')
    };
    SFMTYPEDEFTYPE(CodeEnum)

public:
    static USRRadiobuttonControlSmp NewInstance(SFCErrorPtr exception = null);
protected:
    explicit USRRadiobuttonControl(Void) static_throws;
    virtual ~USRRadiobuttonControl(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 HandleBoundVirtual(Void);
    virtual Void HandleRenderRequest(SFXGraphicsPtr graphics) const;
};

Example 874. Implementation

USRRadiobuttonControl::USRRadiobuttonControl(Void) static_throws
{
    if (static_try()) {

        // set the responder type
 SetType(CODE_TYPE);

        // since radio button control's label doesn't have background, set transparent mode to "true"
 SetPropertyTransparent(true);

        // here describe the initialization
    }
}

USRRadiobuttonControl::~USRRadiobuttonControl(Void)
{
    // here describe the finalization
}

USRRadiobuttonControlSmp USRRadiobuttonControl::NewInstance(SFCErrorPtr exception)
{
    return static_pointer_cast<USRRadiobuttonControl>(Factory(::new USRRadiobuttonControl, exception));
}

Void USRRadiobuttonControl::HandleBoundRequest(SFXRectanglePtr rectangle) const
{
    // calculate the suitable radio button control size
    // set the rectangle argument to the calculated suitable radio button control size
    // for the rectangle argument, it is recommended to set only its size and not to change its origin in this function

    return;
}

Void USRRadiobuttonControl::HandleBoundOptimize(SFXRectanglePtr rectangle) const
{
    // calculate the suitable radio button control size within rectangular region given by the rectangle argument
    // set the rectangle argument to the calculated suitable radio button control size
    // for the rectangle argument, it is recommended to set only its size and not to change its origin in this function

    return;
}

Void USRRadiobuttonControl::HandleBoundVirtual(Void)
{
    // here describe the size recalculation if necessary when the virtual region is changed

    return;
}

Void USRRadiobuttonControl::HandleRenderRequest(SFXGraphicsPtr graphics) const
{
    SFXGrid grid;

    // in case of using function of SFYRadiobuttonControl class to draw radio button and shadow [i.e., SFYRadiobuttonControl::DrawButton**()/DrawShadow**()/DrawCheckmark**()],
    // draw radio button and shadow as below

    // _height variable is hight of radio button 
    // _origin variable is origin of radio button
    // * these variable is calculated with font hight used for label

    if (_height >= 28) {
        grid.Set(DrawShadow28(graphics, _origin));
        DrawButton27(graphics, grid);
        grid.Add(8, 8);
        DrawCheckmark11(graphics, grid);
    }
    else if (_height >= 14) {
        grid.Set(DrawShadow14(graphics, _origin));
        DrawButton13(graphics, grid);
        grid.Add(4, 4);
        DrawCheckmark05(graphics, grid);
    }

    // draw radio button control's label

    return;
}

Reference

Abstract Class that Represents a Radio Button Control[SFYRadiobuttonControl] | SFZRadiobuttonControl | Key Event[SFEVT_KEY] | Region Event[SFEVT_RESPONDER_BOUND] | Drawing Event[SFEVT_RESPONDER_RENDER]

Member

Constructor/Destructor
SFYRadiobuttonControl( Void )
Constructor of the SFYRadiobuttonControl class.
~SFYRadiobuttonControl( Void )
Destructor of the SFYRadiobuttonControl class.
Public Functions
Void Group( SFYRadiobuttonControlSmpConstRef param )
Register this radio button control into the specified group.
Void Ungroup( Void )
Unregister this radio button from the group.
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.
SFXBevelColorConstRef GetButtonColor( Void ) (inherits from SFYButtonControl)
Get the bevel color of bevel region within this button.
SFXRGBColorConstRef GetCheckmarkColor( Void ) (inherits from SFYCheckboxControl)
Get the color of check mark of this check box control.
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.
SInt32 GetCurrentValue( Void ) (inherits from SFYControl)
Get the current value of this control.
SFYDistributerPtr GetDistributer( Void ) (inherits from SFYResponder)
Get the distributer bound with this responder.
SFXBevelColorConstRef GetFocusColor( Void ) (inherits from SFYButtonControl)
Get the bevel color of frame margin of this button control in the "focus" state.
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 GetMaximumValue( Void ) (inherits from SFYControl)
Get the maximum value of this control.
SInt32 GetMinimumValue( Void ) (inherits from SFYControl)
Get the minimum value of this control.
SInt32 GetNthBackward( Void ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthBackward( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthBackward( UInt32 id ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthBackward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the back side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( Void ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( UInt32 id ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
SInt32 GetNthForward( UInt32 id , Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Get the position counted from the front side of this responder among a group of sibling responders, which match the specified search condition.
AVKType GetOperateKey( Void ) (inherits from SFYButtonControl)
Get the operation key of the button control.
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.
SFXRGBColorConstRef GetShadowColor( Void ) (inherits from SFYButtonControl)
Get the shadow color of this button control.
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 GetStatePress( Void ) (inherits from SFYButtonControl)
Get the value of flag indicating whether or not this button is pressed.
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 SetButtonColor( SFXBevelColorConstRef param ) (inherits from SFYButtonControl)
Set the bevel color of bevel region within this button to the specified value.
Void SetCheckmarkColor( SFXRGBColorConstRef param ) (inherits from SFYCheckboxControl)
Set the color of the check mark to the specified value.
Void SetCurrentValue( SInt32 param ) (inherits from SFYControl)
Set the current value of this control to the specified value.
Void SetDistributer( SFYDistributerPtr param ) (inherits from SFYResponder)
Bind this responder with the specified distributer.
Void SetFocusColor( SFXBevelColorConstRef param ) (inherits from SFYButtonControl)
Set the bevel color of frame margin of this button control in the "focus" state to the specified value.
SFCError SetFrame( SFYResponderSmpConstRef param ) (inherits from SFYResponder)
Attach the specified frame to this frame.
Void SetID( UInt32 param ) (inherits from SFYResponder)
Set the ID value of this responder to the specified value.
Void SetMaximumValue( SInt32 param ) (inherits from SFYControl)
Set the maximum value of the control to the specified value.
Void SetMinimumValue( SInt32 param ) (inherits from SFYControl)
Set the minimum value of the control to the specified value.
Void SetOperateKey( AVKType param ) (inherits from SFYButtonControl)
Set the operation key of this button control 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 SetShadowColor( SFXRGBColorConstRef param ) (inherits from SFYButtonControl)
Set the shadow color of this button control to the specified value.
Void SetState( Bool visible , Bool active , Bool enable , Bool focus ) (inherits from SFYResponder)
Set all states of this responder to specified values together.
Void SetStateActive( Bool param ) (inherits from SFYResponder)
Set the active state of this responder to the specified value.
Void SetStateEnable( Bool param ) (inherits from SFYResponder)
Set the enable state of this responder to the specified value.
Void SetStateFocus( Bool param ) (inherits from SFYResponder)
Set the focus state of this responder to the specified value.
Void SetStatePress( Bool param ) (inherits from SFYButtonControl)
Set the flag indicating whether or not this button is pressed 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 DrawButton13( SFXGraphicsPtr graphics , SFXGridConstRef grid )
Draw the 13x13 pixel button of this radio button.
Void DrawButton27( SFXGraphicsPtr graphics , SFXGridConstRef grid )
Draw the 27x27 pixel button of this radio button.
Void DrawCheckmark05( SFXGraphicsPtr graphics , SFXGridConstRef grid )
Draw the 5x5 pixel check mark of this radio button.
Void DrawCheckmark11( SFXGraphicsPtr graphics , SFXGridConstRef grid )
Draw the 11x11 pixel check mark of this radio button.
SFXGrid DrawShadow14( SFXGraphicsPtr graphics , SFXGridConstRef grid )
Draw the 14x14 pixel shadow of this radio button control.
SFXGrid DrawShadow28( SFXGraphicsPtr graphics , SFXGridConstRef grid )
Draw the 28x28 pixel shadow of this radio button control.
Void HandleOperateKeyRelease( Void )
This function will be called when the SFEVT_KEY_RELEASE event of the operation key is received.
Void DrawButton( SFXGraphicsPtr graphics , SFXRectangleConstRef rectangle ) (inherits from SFYButtonControl)
Draw the bevel region of this button control.
Void DrawCheckmark09( SFXGraphicsPtr graphics , SFXGridConstRef grid ) (inherits from SFYCheckboxControl)
Draw the 9x9 pixel check mark of this check box control.
Void DrawCheckmark21( SFXGraphicsPtr graphics , SFXGridConstRef grid ) (inherits from SFYCheckboxControl)
Draw the 21x21 pixel check mark of this check box control.
SFXRectangle DrawShadow( SFXGraphicsPtr graphics , SFXRectangleConstRef rectangle ) (inherits from SFYButtonControl)
Draw the shadow region of this button control.
static
SFYResponderSmp
Factory( SFYResponderPtr responder , SFCErrorPtr exception = null ) (inherits from SFYResponder)
This function is used to implement the NewInstance function.
static
SFXMarginConstRef
GetButtonMargin( Void ) (inherits from SFYButtonControl)
Get the margin region of this button control.
static
SFXGridConstRef
GetPressOffset( Void ) (inherits from SFYButtonControl)
Get the press offset of this button control.
static
SFXMarginConstRef
GetShadowMargin( Void ) (inherits from SFYButtonControl)
Get the margin of shadow region of this button control.
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 SFYControl)
This function will be called when the real region is changed.
Void HandleBoundRequest( SFXRectanglePtr rectangle ) (inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_BOUND, SFP16_BOUND_REQUEST) event is received. [Calculate the suitable rectangle size of this responder.]
Void 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 HandleOperateKey( Void ) (inherits from SFYButtonControl)
This function will be called when the SFEVT_KEY event of the operation key is received.
Void HandleOperateKeyPress( Void ) (inherits from SFYButtonControl)
This function will be called when the SFEVT_KEY_PRESS event of the operation key is received.
Void HandleRenderRequest( SFXGraphicsPtr graphics ) (inherits from SFYWidget)
This function will be called when the (SFEVT_RESPONDER_RENDER, SFP16_RENDER_REQUEST) event is received. [Draw this responder.]
Void Invalidate( Void ) (inherits from SFYResponder)
Register the specified redraw region of this responder.
Void Invalidate( SFXRectangleConstRef param ) (inherits from SFYResponder)
Register the specified redraw region of this responder.
Void InvokeBackward( SFXEventConstRef event , Bool overload , BoolPtr result = null ) (inherits from SFYResponder)
Call the handlers for the specified event from the end of the handler list registered into this responder.
Void InvokeForward( SFXEventConstRef event , Bool overload , BoolPtr result = null ) (inherits from SFYResponder)
Call the handlers for the specified event from the head of the handler list registered into this responder.
Void SetType( SFCType param ) (inherits from SFYResponder)
Set the Type value of this responder to the specified 4-character value.
Void static_throw( static_exception< T > const & param ) (inherits from static_exception)
Set an exception.
Void static_throw( T const & param ) (inherits from static_exception)
Set an exception.
Bool static_try( Void ) (inherits from static_exception)
Confirm whether or not the exception is retained.
Types
CodeEnum
Constant that represents the SFYRadiobuttonControl class.
HorizontalEnum (inherits from SFYResponder)
Constants that represent the horizontal alignment.
VerticalEnum (inherits from SFYResponder)
Constants that represent the vertical alignment.

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

Description

This constructor sets the type of this responder to ".rdo".

Reference

SFYResponder::SetType | SFYRadiobuttonControl::CodeEnum | Type


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

Description

This destructor unregisters this radio button from the group.

Reference

SFYRadiobuttonControl::Ungroup


SFYRadiobuttonControl::DrawButton13
Draw the 13x13 pixel button of this radio button.
[ protected, const ]
Void DrawButton13(
    SFXGraphicsPtr graphics   // graphic object
    SFXGridConstRef grid      // left-top coordinate
);

Description

This function draws the 13x13 button of this radio button control.

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

The default implementation is to draw the 13x13 pixel button of this radio button control.

[Tip] Tip
This function will be called in the SFZRadiobuttonControl::HandleRenderRequest function.

Internal Implementation

Internal implementation of the SFYRadiobuttonControl::DrawButton13 function is as follows:

/*protected */Void SFYRadiobuttonControl::DrawButton13(SFXGraphicsPtr graphics, SFXGridConstRef grid) const
{
    static SFXRectangle::AtomRecConst           rectangle[] = {
        {{ 3,  3}, { 7,  7}}
    };
    static SFXLine::AtomRecConst                line[] = {
        {{ 2,  1}, { 3,  1}}, {{ 4,  0}, { 8,  0}}, {{ 1,  2}, { 1,  3}}, {{ 0,  4}, { 0,  8}},
        {{ 9,  1}, {10,  1}}, {{ 1,  9}, { 1, 10}}, {{ 2,  2}, { 4,  2}}, {{ 4,  1}, { 8,  1}},
        {{ 8,  2}, {10,  2}}, {{10,  2}, {10,  4}}, {{11,  4}, {11,  8}}, {{10,  8}, {10, 10}},
        {{ 2,  2}, { 2,  4}}, {{ 1,  4}, { 1,  8}}, {{ 2,  8}, { 2, 10}}, {{ 2, 10}, { 4, 10}},
        {{ 4, 11}, { 8, 11}}, {{ 8, 10}, {10, 10}}, {{11,  2}, {11,  3}}, {{ 2, 11}, { 3, 11}},
        {{12,  4}, {12,  8}}, {{11,  9}, {11, 10}}, {{ 4, 12}, { 8, 12}}, {{ 9, 11}, {10, 11}},
        {{ 5,  2}, { 7,  2}}, {{10,  5}, {10,  7}}, {{ 2,  5}, { 2,  7}}, {{ 5, 10}, { 7, 10}}
    };
    static SInt16Const                          color[] = {
        0,  0,  4,  6, 18, 20, 24
    };

    RenderButton(graphics, grid, atomic_cast(rectangle), lengthof(rectangle), atomic_cast(line), lengthof(line), color);
    return;
}// SFYRadiobuttonControl::DrawButton13 //

/*private */Void SFYRadiobuttonControl::RenderButton(SFXGraphicsPtr graphics, SFXGridConstRef grid, SFXRectangleConstPtr rectangle, SInt32 rlength, SFXLineConstPtr line, SInt32 llength, SInt16Const color[7]) const
{
    SFXBevelColor                               bevel;
    SFXRGBColor                                 rgb;
    SInt32                                      r0;
    Bool                                        baseBright;

    graphics->SetTranslate(-grid);
    bevel.Set((GetStateFocus(true)) ? (GetFocusColor()) : (GetButtonColor()));
    rgb.Set(GetButtonColor().GetBase());
    baseBright = rgb.GetBrightness() > 0x7F;
    if (!GetStateActive(true)) {
        bevel.SetLight(bevel.GetBase());
        bevel.SetDark(bevel.GetBase());
    }
    if (GetStatePress()) {
        if (baseBright) {
            bevel.SubRGB(0x11);
            rgb.SubRGB(0x11);
        }
        else {
            bevel.AddRGB(0x11);
            rgb.AddRGB(0x11);
        }
    }
    graphics->SetFillMode(true);
    for (r0 = 0; r0 < rlength; ++r0) {
        if (r0 == color[0]) {
            graphics->SetForeColor(rgb);
            graphics->SetFillColor(rgb);
        }
        graphics->DrawRectangle(rectangle[r0]);
    }
    for (r0 = 0; r0 < llength; ++r0) {
        if (r0 == color[1]) {
            graphics->SetForeColor(bevel.GetLight());
        }
        else if (r0 == color[2]) {
     SFXRGBColor light(bevel.GetLight());
            graphics->SetForeColor(
                (baseBright) ? light.SubRGB(0x11) : light.AddRGB(0x11)
            );
        }
        else if (r0 == color[3]) {
            graphics->SetForeColor(bevel.GetBase());
        }
        else if (r0 == color[4]) {
     SFXRGBColor dark(bevel.GetDark());
            graphics->SetForeColor(
                (baseBright) ? dark.AddRGB(0x11) : dark.SubRGB(0x11)
            );
        }
        else if (r0 == color[5]) {
            graphics->SetForeColor(bevel.GetDark());
        }
        else if (r0 == color[6]) {
            graphics->SetForeColor(rgb);
        }
        graphics->DrawLine(line[r0]);
    }
    graphics->SetTranslate(grid);
    return;
}// SFYRadiobuttonControl::RenderButton //

Reference

SFZRadiobuttonControl::HandleRenderRequest


SFYRadiobuttonControl::DrawButton27
Draw the 27x27 pixel button of this radio button.
[ protected, const ]
Void DrawButton27(
    SFXGraphicsPtr graphics   // graphic object
    SFXGridConstRef grid      // left-top coordinate
);

Description

This function draws the 27x27 button of this radio button control.

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

The default implementation is to draw the 27x27 pixel button of this radio button control.

[Tip] Tip
This function will be called in the SFZRadiobuttonControl::HandleRenderRequest function.

Internal Implementation

Internal implementation of the SFYRadiobuttonControl::DrawButton27 function is as follows:

/*protected */Void SFYRadiobuttonControl::DrawButton27(SFXGraphicsPtr graphics, SFXGridConstRef grid) const
{
    static SFXRectangle::AtomRecConst           rectangle[] = {
        {{ 5,  5}, {17, 17}}
    };
    static SFXLine::AtomRecConst                line[] = {
        {{ 4,  3}, { 5,  3}}, {{ 6,  2}, { 6,  2}}, {{ 7,  1}, { 9,  1}}, {{10,  0}, {16,  0}},
        {{ 3,  4}, { 3,  5}}, {{ 2,  6}, { 2,  6}}, {{ 1,  7}, { 1,  9}}, {{ 0, 10}, { 0, 16}},
        {{17,  1}, {19,  1}}, {{20,  2}, {20,  2}}, {{21,  3}, {22,  3}}, {{ 1, 17}, { 1, 19}},
        {{ 2, 20}, { 2, 20}}, {{ 3, 21}, { 3, 22}}, {{ 4,  4}, { 6,  4}}, {{ 6,  3}, { 7,  3}},
        {{ 7,  2}, {10,  2}}, {{10,  1}, {16,  1}}, {{16,  2}, {19,  2}}, {{19,  3}, {20,  3}},
        {{20,  4}, {22,  4}}, {{22,  4}, {22,  6}}, {{23,  6}, {23,  7}}, {{24,  7}, {24, 10}},
        {{25, 10}, {25, 16}}, {{24, 16}, {24, 19}}, {{23, 19}, {23, 20}}, {{22, 20}, {22, 22}},
        {{ 4,  4}, { 4,  6}}, {{ 3,  6}, { 3,  7}}, {{ 2,  7}, { 2, 10}}, {{ 1, 10}, { 1, 16}},
        {{ 2, 16}, { 2, 19}}, {{ 3, 19}, { 3, 20}}, {{ 4, 20}, { 4, 22}}, {{ 4, 22}, { 6, 22}},
        {{ 6, 23}, { 7, 23}}, {{ 7, 24}, {10, 24}}, {{10, 25}, {16, 25}}, {{16, 24}, {19, 24}},
        {{19, 23}, {20, 23}}, {{20, 22}, {22, 22}}, {{23,  4}, {23,  5}}, {{24,  6}, {24,  6}},
        {{25,  7}, {25,  9}}, {{ 4, 23}, { 5, 23}}, {{ 6, 24}, { 6, 24}}, {{ 7, 25}, { 9, 25}},
        {{26, 10}, {26, 16}}, {{25, 17}, {25, 19}}, {{24, 20}, {24, 20}}, {{23, 21}, {23, 22}},
        {{10, 26}, {16, 26}}, {{17, 25}, {19, 25}}, {{20, 24}, {20, 24}}, {{21, 23}, {22, 23}},
        {{11,  2}, {15,  2}}, {{ 8,  3}, {18,  3}}, {{ 7,  4}, {19,  4}}, {{24, 11}, {24, 15}},
        {{23,  8}, {23, 18}}, {{22,  7}, {22, 19}}, {{ 2, 11}, { 2, 15}}, {{ 3,  8}, { 3, 18}},
        {{ 4,  7}, { 4, 19}}, {{11, 24}, {15, 24}}, {{ 8, 23}, {18, 23}}, {{ 7, 22}, {19, 22}}
    };
    static SInt16Const                          color[] = {
        0,  0,  8, 14, 42, 48, 56
    };

    RenderButton(graphics, grid, atomic_cast(rectangle), lengthof(rectangle), atomic_cast(line), lengthof(line), color);
    return;
}// SFYRadiobuttonControl::DrawButton27 //

/*private */Void SFYRadiobuttonControl::RenderButton(SFXGraphicsPtr graphics, SFXGridConstRef grid, SFXRectangleConstPtr rectangle, SInt32 rlength, SFXLineConstPtr line, SInt32 llength, SInt16Const color[7]) const
{
    SFXBevelColor                               bevel;
    SFXRGBColor                                 rgb;
    SInt32                                      r0;
    Bool                                        baseBright;

    graphics->SetTranslate(-grid);
    bevel.Set((GetStateFocus(true)) ? (GetFocusColor()) : (GetButtonColor()));
    rgb.Set(GetButtonColor().GetBase());
    baseBright = rgb.GetBrightness() > 0x7F;
    if (!GetStateActive(true)) {
        bevel.SetLight(bevel.GetBase());
        bevel.SetDark(bevel.GetBase());
    }
    if (GetStatePress()) {
        if (baseBright) {
            bevel.SubRGB(0x11);
            rgb.SubRGB(0x11);
        }
        else {
            bevel.AddRGB(0x11);
            rgb.AddRGB(0x11);
        }
    }
    graphics->SetFillMode(true);
    for (r0 = 0; r0 < rlength; ++r0) {
        if (r0 == color[0]) {
            graphics->SetForeColor(rgb);
            graphics->SetFillColor(rgb);
        }
        graphics->DrawRectangle(rectangle[r0]);
    }
    for (r0 = 0; r0 < llength; ++r0) {
        if (r0 == color[1]) {
            graphics->SetForeColor(bevel.GetLight());
        }
        else if (r0 == color[2]) {
     SFXRGBColor light(bevel.GetLight());
            graphics->SetForeColor(
                (baseBright) ? light.SubRGB(0x11) : light.AddRGB(0x11)
            );
        }
        else if (r0 == color[3]) {
            graphics->SetForeColor(bevel.GetBase());
        }
        else if (r0 == color[4]) {
     SFXRGBColor dark(bevel.GetDark());
            graphics->SetForeColor(
                (baseBright) ? dark.AddRGB(0x11) : dark.SubRGB(0x11)
            );
        }
        else if (r0 == color[5]) {
            graphics->SetForeColor(bevel.GetDark());
        }
        else if (r0 == color[6]) {
            graphics->SetForeColor(rgb);
        }
        graphics->DrawLine(line[r0]);
    }
    graphics->SetTranslate(grid);
    return;
}// SFYRadiobuttonControl::RenderButton //

Reference

SFZRadiobuttonControl::HandleRenderRequest


SFYRadiobuttonControl::DrawCheckmark05
Draw the 5x5 pixel check mark of this radio button.
[ protected, const ]
Void DrawCheckmark05(
    SFXGraphicsPtr graphics   // graphic object
    SFXGridConstRef grid      // left-top coordinate
);

Description

This function draws the 5x5 pixel check mark of this radio button control.

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

The default implementation is to draw the 5x5 pixel check mark of this radio button control.

[Tip] Tip
This function will be called in the SFZRadiobuttonControl::HandleRenderRequest function.

Internal Implementation

Internal implementation of the SFYRadiobuttonControl::DrawCheckmark05 function is as follows:

/*protected */Void SFYRadiobuttonControl::DrawCheckmark05(SFXGraphicsPtr graphics, SFXGridConstRef grid) const
{
    static SFXRectangle::AtomRecConst           rectangle[] = {
        {{ 1,  1}, { 3,  3}}
    };
    static SFXLine::AtomRecConst                line[] = {
        {{ 1,  0}, { 3,  0}}, {{ 4,  1}, { 4,  3}}, {{ 0,  1}, { 0,  3}}, {{ 1,  4}, { 3,  4}}
    };

    RenderCheckmark(graphics, grid, atomic_cast(rectangle), lengthof(rectangle), atomic_cast(line), lengthof(line));
    return;
}// SFYRadiobuttonControl::DrawCheckmark05 //

/*private */Void SFYRadiobuttonControl::RenderCheckmark(SFXGraphicsPtr graphics, SFXGridConstRef grid, SFXRectangleConstPtr rectangle, SInt32 rlength, SFXLineConstPtr line, SInt32 llength) const
{
    SFXRGBColor                                 rgb;
    SInt32                                      r0;

    if (GetCurrentValue()) {
        graphics->SetTranslate(-grid);
        rgb.Set(GetCheckmarkColor());
        if (!GetStateActive(true)) {
            (rgb.GetBrightness() > 0x7F) ? rgb.SubRGB(0x44) : rgb.AddRGB(0x44);
        }
        graphics->SetFillMode(true);
        graphics->SetForeColor(rgb);
        graphics->SetFillColor(rgb);
        for (r0 = 0; r0 < rlength; ++r0) {
            graphics->DrawRectangle(rectangle[r0]);
        }
        for (r0 = 0; r0 < llength; ++r0) {
            graphics->DrawLine(line[r0]);
        }
        graphics->SetTranslate(grid);
    }
    return;
}// SFYRadiobuttonControl::RenderCheckmark //

Reference

SFZRadiobuttonControl::HandleRenderRequest


SFYRadiobuttonControl::DrawCheckmark11
Draw the 11x11 pixel check mark of this radio button.
[ protected, const ]
Void DrawCheckmark11(
    SFXGraphicsPtr graphics   // graphic object
    SFXGridConstRef grid      // left-top coordinate
);

Description

This function draws the 11x11 pixel check mark of this radio button control.

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

The default implementation is to draw the 11x11 pixel check mark of this radio button control.

[Tip] Tip
This function will be called in the SFZRadiobuttonControl::HandleRenderRequest function.

Internal Implementation

Internal implementation of the SFYRadiobuttonControl::DrawCheckmark11 function is as follows:

/*protected */Void SFYRadiobuttonControl::DrawCheckmark11(SFXGraphicsPtr graphics, SFXGridConstRef grid) const
{
    static SFXRectangle::AtomRecConst           rectangle[] = {
        {{ 2,  2}, { 7,  7}}
    };
    static SFXLine::AtomRecConst                line[] = {
        {{ 4,  0}, { 6,  0}}, {{ 2,  1}, { 8,  1}}, {{10,  4}, {10,  6}}, {{ 9,  2}, { 9,  8}},
        {{ 0,  4}, { 0,  6}}, {{ 1,  2}, { 1,  8}}, {{ 4, 10}, { 6, 10}}, {{ 2,  9}, { 8,  9}}
    };

    RenderCheckmark(graphics, grid, atomic_cast(rectangle), lengthof(rectangle), atomic_cast(line), lengthof(line));
    return;
}// SFYRadiobuttonControl::DrawCheckmark11 //

/*private */Void SFYRadiobuttonControl::RenderCheckmark(SFXGraphicsPtr graphics, SFXGridConstRef grid, SFXRectangleConstPtr rectangle, SInt32 rlength, SFXLineConstPtr line, SInt32 llength) const
{
    SFXRGBColor                                 rgb;
    SInt32                                      r0;

    if (GetCurrentValue()) {
        graphics->SetTranslate(-grid);
        rgb.Set(GetCheckmarkColor());
        if (!GetStateActive(true)) {
            (rgb.GetBrightness() > 0x7F) ? rgb.SubRGB(0x44) : rgb.AddRGB(0x44);
        }
        graphics->SetFillMode(true);
        graphics->SetForeColor(rgb);
        graphics->SetFillColor(rgb);
        for (r0 = 0; r0 < rlength; ++r0) {
            graphics->DrawRectangle(rectangle[r0]);
        }
        for (r0 = 0; r0 < llength; ++r0) {
            graphics->DrawLine(line[r0]);
        }
        graphics->SetTranslate(grid);
    }
    return;
}// SFYRadiobuttonControl::RenderCheckmark //

Reference

SFZRadiobuttonControl::HandleRenderRequest


SFYRadiobuttonControl::DrawShadow14
Draw the 14x14 pixel shadow of this radio button control.
[ protected, const ]
SFXGrid DrawShadow14(
    SFXGraphicsPtr graphics   // graphic object
    SFXGridConstRef grid      // left-top coordinate
);

Description

This function draws the 14x14 pixel shadow of this radio button control.

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

The default implementation is to draw the 14x14 pixel shadow of this radio button control.

[Tip] Tip
This function will be called in the SFZRadiobuttonControl::HandleRenderRequest function.

Internal Implementation

Internal implementation of the SFYRadiobuttonControl::DrawShadow14 function is as follows:

/*protected */SFXGrid SFYRadiobuttonControl::DrawShadow14(SFXGraphicsPtr graphics, SFXGridConstRef grid) const
{
    static SFXLine::AtomRecConst                line[][9] = {
        {
            {{11,  1}, {11,  1}}, {{ 1, 11}, { 1, 11}}, {{12,  2}, {12,  3}}, {{ 2, 12}, { 3, 12}},
            {{13,  4}, {13,  8}}, {{12,  9}, {12, 10}}, {{ 4, 13}, { 8, 13}}, {{ 9, 12}, {10, 12}},
            {{11, 11}, {11, 11}}
        },
        {
            {{12,  2}, {12,  2}}, {{ 2, 12}, { 2, 12}}, {{10,  1}, {11,  1}}, {{ 1, 10}, { 1, 11}},
            {{ 3,  1}, { 4,  1}}, {{ 5,  0}, { 9,  0}}, {{ 1,  3}, { 1,  4}}, {{ 0,  5}, { 0,  9}},
            {{ 2,  2}, { 2,  2}}
        }
    };
    static SInt16Const                          color[] = {
        0,  2,  4
    };
    SFXGrid                                     result(grid);

    if (GetStatePress()) {
        RenderShadow(graphics, grid, atomic_cast(line[1]), lengthof(line[1]), color);
        result.Add(1, 1);
    }
    else {
        RenderShadow(graphics, grid, atomic_cast(line[0]), lengthof(line[0]), color);
        result.Add(0, 0);
    }
    return result;
}// SFYRadiobuttonControl::DrawShadow14 //

/*private */Void SFYRadiobuttonControl::RenderShadow(SFXGraphicsPtr graphics, SFXGridConstRef grid, SFXLineConstPtr line, SInt32 llength, SInt16Const color[3]) const
{
    SFXRGBColor                                 rgb;
    SInt32                                      r0;
    Bool                                        shadowBright;

    graphics->SetTranslate(-grid);
    rgb.Set(GetShadowColor());
    shadowBright = rgb.GetBrightness() > 0x7F;
    if (!GetStateActive(true)) {
        (shadowBright) ? rgb.SubRGB(0x44) : rgb.AddRGB(0x44);
    }
    for (r0 = 0; r0 < llength; ++r0) {
        if (r0 == color[0]) {
            graphics->SetForeColor(
                (shadowBright) ? SFXRGBColor(rgb).SubRGB(0x44) : SFXRGBColor(rgb).AddRGB(0x44)
            );
        }
        else if (r0 == color[1]) {
            graphics->SetForeColor(
                (shadowBright) ? SFXRGBColor(rgb).SubRGB(0x22) : SFXRGBColor(rgb).AddRGB(0x22)
            );
        }
        else if (r0 == color[2]) {
            graphics->SetForeColor(rgb);
        }
        graphics->DrawLine(line[r0]);
    }
    graphics->SetTranslate(grid);
    return;
}// SFYRadiobuttonControl::RenderShadow //

Reference

SFZRadiobuttonControl::HandleRenderRequest


SFYRadiobuttonControl::DrawShadow28
Draw the 28x28 pixel shadow of this radio button control.
[ protected, const ]
SFXGrid DrawShadow28(
    SFXGraphicsPtr graphics   // graphic object
    SFXGridConstRef grid      // left-top coordinate
);

Description

This function draws the 28x28 pixel shadow of this radio button control.

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

The default implementation is to draw the 28x28 pixel shadow of this radio button control.

[Tip] Tip
This function will be called in the SFZRadiobuttonControl::HandleRenderRequest function.

Internal Implementation

Internal implementation of the SFYRadiobuttonControl::DrawShadow28 function is as follows:

/*protected */SFXGrid SFYRadiobuttonControl::DrawShadow28(SFXGraphicsPtr graphics, SFXGridConstRef grid) const
{
    static SFXLine::AtomRecConst                line[][17] = {
        {
            {{23,  3}, {23,  3}}, {{24,  4}, {24,  5}}, {{ 3, 23}, { 3, 23}}, {{ 4, 24}, { 5, 24}},
            {{25,  6}, {25,  6}}, {{26,  7}, {26,  9}}, {{ 6, 25}, { 6, 25}}, {{ 7, 26}, { 9, 26}},
            {{27, 10}, {27, 16}}, {{26, 17}, {26, 19}}, {{25, 20}, {25, 20}}, {{24, 21}, {24, 22}},
            {{10, 27}, {16, 27}}, {{17, 26}, {19, 26}}, {{20, 25}, {20, 25}}, {{21, 24}, {22, 24}},
            {{23, 23}, {23, 23}}
        },
        {
            {{22,  3}, {23,  3}}, {{24,  4}, {24,  4}}, {{ 3, 22}, { 3, 23}}, {{ 4, 24}, { 4, 24}},
            {{18,  1}, {20,  1}}, {{21,  2}, {21,  2}}, {{ 1, 18}, { 1, 20}}, {{ 2, 21}, { 2, 21}},
            {{ 5,  3}, { 6,  3}}, {{ 7,  2}, { 7,  2}}, {{ 8,  1}, {10,  1}}, {{11,  0}, {17,  0}},
            {{ 3,  5}, { 3,  6}}, {{ 2,  7}, { 2,  7}}, {{ 1,  8}, { 1, 10}}, {{ 0, 11}, { 0, 17}},
            {{ 4,  4}, { 4,  4}}
        }
    };
    static SInt16Const                          color[] = {
        0,  4,  8
    };
    SFXGrid                                     result(grid);

    if (GetStatePress()) {
        RenderShadow(graphics, grid, atomic_cast(line[1]), lengthof(line[1]), color);
        result.Add(1, 1);
    }
    else {
        RenderShadow(graphics, grid, atomic_cast(line[0]), lengthof(line[0]), color);
        result.Add(0, 0);
    }
    return result;
}// SFYRadiobuttonControl::DrawShadow28 //

/*private */Void SFYRadiobuttonControl::RenderShadow(SFXGraphicsPtr graphics, SFXGridConstRef grid, SFXLineConstPtr line, SInt32 llength, SInt16Const color[3]) const
{
    SFXRGBColor                                 rgb;
    SInt32                                      r0;
    Bool                                        shadowBright;

    graphics->SetTranslate(-grid);
    rgb.Set(GetShadowColor());
    shadowBright = rgb.GetBrightness() > 0x7F;
    if (!GetStateActive(true)) {
        (shadowBright) ? rgb.SubRGB(0x44) : rgb.AddRGB(0x44);
    }
    for (r0 = 0; r0 < llength; ++r0) {
        if (r0 == color[0]) {
            graphics->SetForeColor(
                (shadowBright) ? SFXRGBColor(rgb).SubRGB(0x44) : SFXRGBColor(rgb).AddRGB(0x44)
            );
        }
        else if (r0 == color[1]) {
            graphics->SetForeColor(
                (shadowBright) ? SFXRGBColor(rgb).SubRGB(0x22) : SFXRGBColor(rgb).AddRGB(0x22)
            );
        }
        else if (r0 == color[2]) {
            graphics->SetForeColor(rgb);
        }
        graphics->DrawLine(line[r0]);
    }
    graphics->SetTranslate(grid);
    return;
}// SFYRadiobuttonControl::RenderShadow //

Reference

SFZRadiobuttonControl::HandleRenderRequest


SFYRadiobuttonControl::Group
Register this radio button control into the specified group.
[ public ]
Void Group(
    SFYRadiobuttonControlSmpConstRef param   // group to register into
);

Description

This function groups multiple radio buttons. As a result, selecting a button exclusively among the grouped radio button controls is done automatically.

Reference

SFYRadiobuttonControl::Ungroup


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

Description

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

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

The default implementation is to select this radio button exclusively among the grouped radio button controls and send the SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_OK, current value) event, of which the current value can be obtained by calling the SFYControl::GetCurrentValue function.

Internal Implementation

Internal implementation of the SFYRadiobuttonControl::HandleOperateKeyRelease function is as follows:

/*protected virtual */Void SFYRadiobuttonControl::HandleOperateKeyRelease(Void)
{
    SFYRadiobuttonControlPtr                    responder;

    for (responder = _forward; responder != this; responder = responder->_forward) {
        responder->SetCurrentValue(false);
    }
    SetCurrentValue(true);
    InvokeForward(SFXEvent(SFEVT_RESPONDER_RESULT, SFP16_RESULT_OK, GetCurrentValue()), false);
    return;
}// SFYRadiobuttonControl::HandleOperateKeyRelease //

Reference

SFYButtonControl::SetOperateKey | Key Event[SFEVT_KEY]


SFYRadiobuttonControl::Ungroup
Unregister this radio button from the group.
[ public ]
Void Ungroup(Void);

Reference

SFYRadiobuttonControl::Group


SFYRadiobuttonControl::CodeEnum
Constant that represents the SFYRadiobuttonControl class.
enum CodeEnum {
    CODE_TYPE = four_char_code('.', 'r', 'd', 'o')
};
SFMTYPEDEFTYPE(CodeEnum)

Reference

SFYResponder::GetType | SFYResponder::SetType