X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Fpublic-api%2Fcontrols%2Fbuttons%2Fpush-button.h;h=f0d2e29d8eba1680c3cbdae132f0e1ec93f3f590;hb=cf58f2980b99438db9784a284e126d80893e6138;hp=4beab969497fb8f7bb3fc51dab3e51e2dde138d0;hpb=6b7c807d4a72e4fae1bbcc7aa64c024f5f84944d;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/public-api/controls/buttons/push-button.h b/dali-toolkit/public-api/controls/buttons/push-button.h index 4beab96..f0d2e29 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 */ @@ -69,11 +105,15 @@ public: */ struct Property { + /** + * @brief An enumeration of properties belonging to the PushButton class. + * @SINCE_1_0.0 + */ enum { - UNSELECTED_ICON = PROPERTY_START_INDEX, ///< Property, name "unselectedIcon", type std::string @SINCE_1_0.0 - SELECTED_ICON, ///< Property, name "selectedIcon", type std::string @SINCE_1_0.0 - ICON_ALIGNMENT, ///< Property, name "iconAlignment", type std::string @SINCE_1_0.0 + UNSELECTED_ICON = PROPERTY_START_INDEX, ///< Property, name "unselectedIcon", type std::string @SINCE_1_0.0 @DEPRECATED_1_2.XX Button::Property::UNSELECTED_VISUAL + SELECTED_ICON, ///< Property, name "selectedIcon", type std::string @SINCE_1_0.0 @DEPRECATED_1_2.XX Button::Property::SELECTED_VISUAL + ICON_ALIGNMENT, ///< Property, name "iconAlignment", type std::string @SINCE_1_0.0 @DEPRECATED_1_2.XX Use Button::Property::LABEL_RELATIVE_ALIGNMENT LABEL_PADDING, ///< Property, name "labelPadding", type Vector4 @SINCE_1_0.0 ICON_PADDING, ///< Property, name "iconPadding", type Vector4 @SINCE_1_0.0 }; @@ -92,12 +132,15 @@ public: /** * @brief Copy constructor. * @SINCE_1_0.0 + * @param[in] pushButton Handle to an object */ PushButton( const PushButton& pushButton ); /** * @brief Assignment operator. * @SINCE_1_0.0 + * @param[in] pushButton Handle to an object + * @return A reference to this */ PushButton& operator=( const PushButton& pushButton ); @@ -129,7 +172,7 @@ public: */ static PushButton DownCast( BaseHandle handle ); - + /////////////////////////////////////////////////////////////////////////// // Deprecated API using Button::SetButtonImage; @@ -142,7 +185,7 @@ public: * @SINCE_1_0.0 * @param[in] image The Actor to use. */ - void SetButtonImage( Actor image ); + void SetButtonImage( Actor image ) DALI_DEPRECATED_API; using Button::SetBackgroundImage; @@ -154,7 +197,7 @@ public: * @SINCE_1_0.0 * @param[in] image The Actor to use. */ - void SetBackgroundImage( Actor image ); + void SetBackgroundImage( Actor image ) DALI_DEPRECATED_API; using Button::SetSelectedImage; @@ -166,7 +209,7 @@ public: * @SINCE_1_0.0 * @param[in] image The Actor to use. */ - void SetSelectedImage( Actor image ); + void SetSelectedImage( Actor image ) DALI_DEPRECATED_API; using Button::SetSelectedBackgroundImage; @@ -178,7 +221,7 @@ public: * @SINCE_1_0.0 * @param[in] image The Actor to use. */ - void SetSelectedBackgroundImage( Actor image ); + void SetSelectedBackgroundImage( Actor image ) DALI_DEPRECATED_API; using Button::SetDisabledBackgroundImage; @@ -190,7 +233,7 @@ public: * @SINCE_1_0.0 * @param[in] image The Actor to use. */ - void SetDisabledBackgroundImage( Actor image ); + void SetDisabledBackgroundImage( Actor image ) DALI_DEPRECATED_API; using Button::SetDisabledImage; @@ -202,7 +245,7 @@ public: * @SINCE_1_0.0 * @param[in] image The Actor to use. */ - void SetDisabledImage( Actor image ); + void SetDisabledImage( Actor image ) DALI_DEPRECATED_API; using Button::SetDisabledSelectedImage; @@ -214,7 +257,7 @@ public: * @SINCE_1_0.0 * @param[in] image The Actor to use. */ - void SetDisabledSelectedImage( Actor image ); + void SetDisabledSelectedImage( Actor image ) DALI_DEPRECATED_API; public: // Not intended for application developers