X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fbuttons%2Fpush-button.h;h=603601d6a8d9d1ee67a95dfa6f8735ea6f0735cb;hp=4beab969497fb8f7bb3fc51dab3e51e2dde138d0;hb=938ea2d2a1a42930cf12c743d839aded892949ea;hpb=2cf32ac170f397aacce527efd34909b3fd62efda diff --git a/dali-toolkit/public-api/controls/buttons/push-button.h b/dali-toolkit/public-api/controls/buttons/push-button.h index 4beab96..603601d 100644 --- a/dali-toolkit/public-api/controls/buttons/push-button.h +++ b/dali-toolkit/public-api/controls/buttons/push-button.h @@ -46,6 +46,42 @@ class PushButton; * By default a PushButton emits a Button::PressedSignal() signal when the button is pressed, a Button::ClickedSignal() signal when it's clicked * and a Button::ReleasedSignal() signal when it's released or having pressed it, the touch point leaves the boundary of the button. * + * Usage example: - + * + * @code + * // in Creating a DALi Application + * void HelloWorldExample::Create( Application& application ) + * { + * PushButton button = PushButton::New(); + * button.SetParentOrigin( ParentOrigin::CENTER ); + * button.SetLabelText( "Press" ); + * Stage::GetCurrent().Add( button ); + * + * // Connect to button signals emitted by the button + * button.ClickedSignal().Connect( this, &HelloWorldExample::OnButtonClicked ); + * button.PressedSignal().Connect( this, &HelloWorldExample::OnButtonPressed ); + * button.ReleasedSignal().Connect( this, &HelloWorldExample::OnButtonReleased ); + * } + * + * bool HelloWorldExample::OnButtonClicked( Button button ) + * { + * // Do something when the button is clicked + * return true; + * } + * + * bool HelloWorldExample::OnButtonPressed( Button button ) + * { + * // Do something when the button is pressed + * return true; + * } + * + * bool HelloWorldExample::OnButtonReleased( Button button ) + * { + * // Do something when the button is released + * return true; + * } + * @endcode + * * See Button for more detail on signals and modifying appearance via properties. * @SINCE_1_0.0 */