Tizen Native API
5.5
|
A RadioButton provides a radio button which two states selected or unselected. More...
Public Member Functions | |
RadioButton () | |
Creates an uninitialized RadioButton; this can be initialized with RadioButton::New(). | |
RadioButton (const RadioButton &radioButton) | |
Copy constructor. | |
RadioButton & | operator= (const RadioButton &radioButton) |
Assignment operator. | |
~RadioButton () | |
Destructor. | |
Static Public Member Functions | |
static RadioButton | New () |
Creates an initialized RadioButton. | |
static RadioButton | New (const std::string &label) |
Creates an initialized RadioButton with given label. | |
static RadioButton | DownCast (BaseHandle handle) |
Downcasts 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::Property::LABEL and Button::Property::SELECTED.
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.SetProperty( Button::Property::LABEL, "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.SetProperty( Toolkit::Button::Property::LABEL, "button2" ); button2.SetBackgroundColor( Color::WHITE ); button2.SetPosition( 0, 40 ); radioGroup.Add( button2 );
- Since:
- 2.4, DALi version 1.0.0
Constructor & Destructor Documentation
Creates an uninitialized RadioButton; this can be initialized with RadioButton::New().
Calling member functions with an uninitialized Dali::Object is not allowed.
- Since:
- 2.4, DALi version 1.0.0
Dali::Toolkit::RadioButton::RadioButton | ( | const RadioButton & | radioButton | ) |
Destructor.
This is non-virtual since derived Handle types must not contain data or virtual methods.
- Since:
- 2.4, DALi version 1.0.0
Member Function Documentation
static RadioButton Dali::Toolkit::RadioButton::DownCast | ( | BaseHandle | handle | ) | [static] |
Downcasts 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, DALi version 1.0.0
- Parameters:
-
[in] handle Handle to an object
- Returns:
- A handle to a RadioButton or an uninitialized handle
Reimplemented from Dali::Toolkit::Button.
static RadioButton Dali::Toolkit::RadioButton::New | ( | ) | [static] |
Creates an initialized RadioButton.
- Since:
- 2.4, DALi version 1.0.0
- 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] |
Creates an initialized RadioButton with given label.
- Since:
- 2.4, DALi version 1.0.0
- Parameters:
-
[in] label The button label
- Returns:
- A handle to a newly allocated Dali resource
RadioButton& Dali::Toolkit::RadioButton::operator= | ( | const RadioButton & | radioButton | ) |
Assignment operator.
- Since:
- 2.4, DALi version 1.0.0
- Parameters:
-
[in] radioButton Handle to an object
- Returns:
- A reference to this