Tizen Native API  6.5
Dali::Toolkit::CheckBoxButton Class Reference

CheckBoxButton provides a check box button which user can check or uncheck. More...

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

Public Member Functions

 CheckBoxButton ()
 Creates an uninitialized CheckBoxButton; this can be initialized with CheckBoxButton::New(). Calling member functions with an uninitialized Dali::Object is not allowed.
 CheckBoxButton (const CheckBoxButton &checkBox)
 Copy constructor.
CheckBoxButtonoperator= (const CheckBoxButton &checkBox)
 Assignment operator.
 ~CheckBoxButton ()
 Destructor.

Static Public Member Functions

static CheckBoxButton New ()
 Creates an initialized CheckBoxButton.
static CheckBoxButton DownCast (BaseHandle handle)
 Downcasts a handle to CheckBoxButton handle.

Detailed Description

CheckBoxButton provides a check box button which user can check or uncheck.

By default, a CheckBoxButton emits a Button::ClickedSignal() signal when the button changes its state to selected or unselected.

The button's appearance could be modified by Button::SetUnselectedImage, Button::SetBackgroundImage, Button::SetSelectedImage, Button::SetSelectedBackgroundImage, Button::SetDisabledBackgroundImage, Button::SetDisabledImage, and Button::SetDisabledSelectedImage.

When the button is not disabled, if it's not selected it only shows the background image. The selected image is shown over the background image when the box is selected (background image is not replaced by selected image).

When the button is disabled, background image and selected image are replaced by disabled images.

Usage example: -

 // in Creating a DALi Application
 void HelloWorldExample::Create( Application& application )
 {
   CheckBoxButton button = CheckBoxButton::New();
   button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
   button.SetProperty( Button::Property::LABEL, "Check" );
   button.SetSize( 200, 40 );
   button.SetBackgroundColor( Color::WHITE );
   Stage::GetCurrent().Add( button );

   // Connect to a button signal emitted by the button
   button.StateChangedSignal().Connect( this, &HelloWorldExample::OnButtonStateChanged );
 }

 bool HelloWorldExample::OnButtonStateChanged( Button button )
 {
   // Do something when the button state is changed
   // You can get the state using button.IsSelected() call
   return true;
 }
Since:
3.0, DALi version 1.0.0

Constructor & Destructor Documentation

Creates an uninitialized CheckBoxButton; this can be initialized with CheckBoxButton::New(). Calling member functions with an uninitialized Dali::Object is not allowed.

Since:
3.0, DALi version 1.0.0

Copy constructor.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]checkBoxHandle to an object

Destructor.

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

Since:
3.0, DALi version 1.0.0

Member Function Documentation

Downcasts a handle to CheckBoxButton handle.

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

Since:
3.0, DALi version 1.0.0
Parameters:
[in]handleHandle to an object
Returns:
Handle to a CheckBoxButton or an uninitialized handle

Reimplemented from Dali::Toolkit::Button.

Creates an initialized CheckBoxButton.

Since:
3.0, DALi version 1.0.0
Returns:
A handle to a newly allocated Dali resource

Reimplemented from Dali::Toolkit::Control.

CheckBoxButton& Dali::Toolkit::CheckBoxButton::operator= ( const CheckBoxButton checkBox)

Assignment operator.

Since:
3.0, DALi version 1.0.0
Parameters:
[in]checkBoxHandle to an object
Returns:
A reference to this