Tizen Native API  6.0

Button is a base class for different kinds of buttons. More...

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

Classes

struct  Property
 Enumeration for the instance of properties belonging to the Button class. More...

Public Types

enum  PropertyRange
 Enumeration for the start and end property ranges for this control. More...
typedef Signal< bool(Button) > ButtonSignalType
 Button signal type.

Public Member Functions

 Button ()
 Creates an uninitialized Button.
 Button (const Button &button)
 Copy constructor.
Buttonoperator= (const Button &button)
 Assignment operator.
 ~Button ()
 Destructor.
ButtonSignalTypePressedSignal ()
 This signal is emitted when the button is touched.
ButtonSignalTypeReleasedSignal ()
 This signal is emitted when the button is touched and the touch point leaves the boundary of the button.
ButtonSignalTypeClickedSignal ()
 This signal is emitted when the button is touched and the touch point doesn't leave the boundary of the button.
ButtonSignalTypeStateChangedSignal ()
 This signal is emitted when the button's state is changed.

Static Public Member Functions

static Button DownCast (BaseHandle handle)
 Downcasts a handle to Button handle.

Detailed Description

Button is a base class for different kinds of buttons.

This class provides the disabled property and the clicked signal.

A ClickedSignal() is emitted when the button is touched and the touch point doesn't leave the boundary of the button.

When the disabled property is set to true, no signal is emitted.

Button provides the following properties which modify the signals emitted:

  • autorepeating When autorepeating is set to true, a Button::PressedSignal(), Button::ReleasedSignal() and Button::ClickedSignal() signals are emitted at regular intervals while the button is touched. The intervals could be modified with the Button::SetInitialAutoRepeatingDelay and Button::SetNextAutoRepeatingDelay methods.

    A togglable button can't be autorepeating. If the autorepeating property is set to true, then the togglable property is set to false but no signal is emitted.

  • togglable When togglable is set to true, a Button::StateChangedSignal() signal is emitted, with the selected state.

'Visual' describes not just traditional images like png, bmp but refers to whatever is used to show the button, it could be a color, gradient or some other kind of renderer.

The button's appearance can be modified by setting properties for the various visuals/images.

It is not mandatory to set all visuals. A button could be defined only by setting its background visual or by setting its background and selected visuals.

The button visual is shown over the background visual. When pressed the unselected visuals are replaced by the selected visual. The text label is always placed on the top of all images.

When the button is disabled, background, button and selected visuals are replaced by their disabled visuals.

Signals | Signal Name | Method | |------------------|-----------------------------| | pressed | PressedSignal() | | released | ReleasedSignal() | | clicked | ClickedSignal() | | stateChanged | StateChangedSignal() |

Actions | Action Name | Attributes | Description | |------------------|-------------------------|-----------------------------------------------| | buttonClick | Doesn't have attributes | Simulates a button click. See DoAction() |

Since:
3.0, DALi version 1.0.0

Member Typedef Documentation

Button signal type.

Since:
3.0, DALi version 1.0.0

Member Enumeration Documentation

Enumeration for the start and end property ranges for this control.

Since:
3.0, DALi version 1.0.0
Enumerator:
PROPERTY_START_INDEX 
Since:
3.0, DALi version 1.0.0
PROPERTY_END_INDEX 

Reserve property indices.

Since:
3.0, DALi version 1.0.0

Reimplemented from Dali::Toolkit::Control.

Reimplemented in Dali::Toolkit::PushButton.


Constructor & Destructor Documentation

Creates an uninitialized Button.

Only derived versions can be instantiated. 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]buttonHandle 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

This signal is emitted when the button is touched and the touch point doesn't leave the boundary of the button.

A callback of the following type may be connected:

   bool YourCallbackName( Button button );
Since:
3.0, DALi version 1.0.0
Returns:
The signal to connect to
static Button Dali::Toolkit::Button::DownCast ( BaseHandle  handle) [static]

Downcasts a handle to Button handle.

If handle points to a Button, 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:
A handle to a Button or an uninitialized handle

Reimplemented from Dali::Toolkit::Control.

Reimplemented in Dali::Toolkit::PushButton, Dali::Toolkit::RadioButton, and Dali::Toolkit::CheckBoxButton.

Button& Dali::Toolkit::Button::operator= ( const Button button)

Assignment operator.

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

This signal is emitted when the button is touched.

A callback of the following type may be connected:

   bool YourCallbackName( Button button );
Since:
3.0, DALi version 1.0.0
Returns:
The signal to connect to

This signal is emitted when the button is touched and the touch point leaves the boundary of the button.

A callback of the following type may be connected:

   bool YourCallbackName( Button button );
Since:
3.0, DALi version 1.0.0
Returns:
The signal to connect to

This signal is emitted when the button's state is changed.

The application can get the state by calling IsSelected().

A callback of the following type may be connected:

   bool YourCallbackName( Button button );
Since:
3.0, DALi version 1.0.0
Returns:
The signal to connect to