From 938ea2d2a1a42930cf12c743d839aded892949ea Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Mon, 1 Aug 2016 16:09:34 +0900 Subject: [PATCH 1/1] Add descriptions and example codes Change-Id: Ic36766645c41ca1831bfd0cfa817ca54df8957f3 Signed-off-by: Seoyeon Kim --- .../public-api/controls/buttons/check-box-button.h | 24 +++++++++++++++ .../public-api/controls/buttons/push-button.h | 36 ++++++++++++++++++++++ doc/dali-toolkit-doc.h | 8 ++--- 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/dali-toolkit/public-api/controls/buttons/check-box-button.h b/dali-toolkit/public-api/controls/buttons/check-box-button.h index 91f0157..ca5c288 100644 --- a/dali-toolkit/public-api/controls/buttons/check-box-button.h +++ b/dali-toolkit/public-api/controls/buttons/check-box-button.h @@ -52,6 +52,30 @@ class CheckBoxButton; * * When the button is disabled, \e background image and \e selected image are replaced by \e disabled images. * + * Usage example: - + * + * @code + * // in Creating a DALi Application + * void HelloWorldExample::Create( Application& application ) + * { + * CheckBoxButton button = CheckBoxButton::New(); + * button.SetParentOrigin( ParentOrigin::CENTER ); + * button.SetLabelText( "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; + * } + * @endcode * @SINCE_1_0.0 */ class DALI_IMPORT_API CheckBoxButton : public Button 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 */ diff --git a/doc/dali-toolkit-doc.h b/doc/dali-toolkit-doc.h index 41cf322..b2bd746 100644 --- a/doc/dali-toolkit-doc.h +++ b/doc/dali-toolkit-doc.h @@ -90,11 +90,11 @@ * * * @ref dali_toolkit_controls_scroll_bar - * ScrollBar control. + * ScrollBar is a component that can be linked to the scrollable objects. * * * @ref dali_toolkit_controls_scrollable - * Scrollable container controls. + * Scrollable contains scrolled controls. * * * @ref dali_toolkit_controls_item_view @@ -165,10 +165,10 @@ * @brief ImageView is a control displying an image. * @defgroup dali_toolkit_controls_scroll_bar Scroll Bar - * @brief ScrollBar control. + * @brief ScrollBar is a component that can be linked to the scrollable objects. * @defgroup dali_toolkit_controls_scrollable Scrollable - * @brief Scrollable container controls. + * @brief Scrollable contains scrolled controls. * @{ * @defgroup dali_toolkit_controls_item_view Item View -- 2.7.4