Tizen Native API
Dali::Toolkit::RadioButton Class Reference

A RadioButton provides a radio button which two states selected or unselected. More...

Inheritance diagram for Dali::Toolkit::RadioButton:
Dali::Toolkit::Button Dali::Toolkit::Control Dali::CustomActor Dali::Actor Dali::Handle Dali::BaseHandle

Public Member Functions

 RadioButton ()
 Create an uninitialized RadioButton; this can be initialized with RadioButton::New().
 RadioButton (const RadioButton &radioButton)
 Copy constructor.
RadioButtonoperator= (const RadioButton &radioButton)
 Assignment operator.
 ~RadioButton ()
 Destructor.

Static Public Member Functions

static RadioButton New ()
 Create an initialized RadioButton.
static RadioButton New (const std::string &label)
 Create an initialized RadioButton with given label.
static RadioButton DownCast (BaseHandle handle)
 Downcast a handle to RadioButton handle.

Detailed Description

A RadioButton provides a radio button which two states selected or unselected.

Radio buttons are designed to select one of many option at the same time.

Every button have its own label and state, which can be modified by Button::SetLabelText and Button::SetSelected.

RadioButton can change its current state using Button::SetSelected.

RadioButtons can be grouped. Two or more RadioButtons are in one group when they have this same parent. In each groups only one RadioButton can be selected at a given time. So when RadioButton is set to selected, other RadioButtons in its group are set to unselected. When selected RadioButton is set to unselected no other RadioButtons in his group is set to selected.

A Button::StateChangedSignal() is emitted when the RadioButton change its state to selected or unselected.

Usage example: -

 // in Creating a DALi Application

 // Create a group to bind two or more RadioButtons together
 Actor radioGroup = Actor::New();
 radioGroup.SetParentOrigin( ParentOrigin::CENTER );
 Stage::GetCurrent().Add( radioGroup );

 // Make the first RadioButton and add it to its parent
 RadioButton button1 = RadioButton::New();
 button1.SetLabelText( "button1" );
 button1.SetBackgroundColor( Color::WHITE );
 button1.SetPosition( 0, -40 );
 radioGroup.Add( button1 );

 // Make more RadioButtons and add them to their parent
 RadioButton button2 = RadioButton::New();
 button2.SetLabelText( "button2" );
 button2.SetBackgroundColor( Color::WHITE );
 button2.SetPosition( 0, 40 );
 radioGroup.Add( button2 );
Since :
2.4

Constructor & Destructor Documentation

Create an uninitialized RadioButton; this can be initialized with RadioButton::New().

Calling member functions with an uninitialized Dali::Object is not allowed.

Since :
2.4

Copy constructor.

Since :
2.4

Destructor.

This is non-virtual since derived Handle types must not contain data or virtual methods.

Since :
2.4

Member Function Documentation

Downcast a handle to RadioButton handle.

If handle points to a RadioButton the downcast produces valid handle. If not the returned handle is left uninitialized.

Since :
2.4
Parameters:
[in]handleHandle to an object
Returns:
A handle to a RadioButton or an uninitialized handle

Reimplemented from Dali::Toolkit::Button.

Create an initialized RadioButton.

Since :
2.4
Returns:
A handle to a newly allocated Dali resource

Reimplemented from Dali::Toolkit::Control.

static RadioButton Dali::Toolkit::RadioButton::New ( const std::string &  label) [static]

Create an initialized RadioButton with given label.

Since :
2.4
Parameters:
[in]labelThe button label
Returns:
A handle to a newly allocated Dali resource
RadioButton& Dali::Toolkit::RadioButton::operator= ( const RadioButton radioButton)

Assignment operator.

Since :
2.4