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.cpp;h=d9e395ee160c94eb9a2edb2c67c3f038bb12a268;hp=7133c0378f4a4d39f5482e4017e1191715b7495d;hb=ded71874c72f72de672b8df770b4983a5d846944;hpb=57869973578f6a0b0f836d396c7232ddb8302c6b diff --git a/dali-toolkit/public-api/controls/buttons/push-button.cpp b/dali-toolkit/public-api/controls/buttons/push-button.cpp index 7133c03..d9e395e 100644 --- a/dali-toolkit/public-api/controls/buttons/push-button.cpp +++ b/dali-toolkit/public-api/controls/buttons/push-button.cpp @@ -22,6 +22,7 @@ // INTERNAL INCLUDES #include +#include namespace Dali { @@ -29,11 +30,6 @@ namespace Dali namespace Toolkit { -const char* const PushButton::SIGNAL_PRESSED = "pressed"; -const char* const PushButton::SIGNAL_RELEASED = "released"; - -const char* const PushButton::ACTION_PUSH_BUTTON_CLICK = "push-button-click"; - PushButton::PushButton() : Button() { @@ -78,59 +74,11 @@ PushButton PushButton::DownCast( BaseHandle handle ) return Control::DownCast(handle); } -void PushButton::SetAutoRepeating( bool autoRepeating ) -{ - Dali::Toolkit::GetImplementation( *this ).SetAutoRepeating( autoRepeating ); -} - -bool PushButton::IsAutoRepeating() const -{ - return Dali::Toolkit::GetImplementation( *this ).IsAutoRepeating(); -} - -void PushButton::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay ) -{ - Dali::Toolkit::GetImplementation( *this ).SetInitialAutoRepeatingDelay( initialAutoRepeatingDelay ); -} - -float PushButton::GetInitialAutoRepeatingDelay() const -{ - return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay(); -} - -void PushButton::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay ) -{ - Dali::Toolkit::GetImplementation( *this ).SetNextAutoRepeatingDelay( nextAutoRepeatingDelay ); -} - -float PushButton::GetNextAutoRepeatingDelay() const -{ - return Dali::Toolkit::GetImplementation( *this ).GetNextAutoRepeatingDelay(); -} - -void PushButton::SetToggleButton( bool toggle ) -{ - Dali::Toolkit::GetImplementation( *this ).SetToggleButton( toggle ); -} - -bool PushButton::IsToggleButton() const -{ - return Dali::Toolkit::GetImplementation( *this ).IsToggleButton(); -} - -void PushButton::SetToggled( bool toggle ) -{ - Dali::Toolkit::GetImplementation( *this ).SetToggled( toggle ); -} - -bool PushButton::IsToggled() const -{ - return Dali::Toolkit::GetImplementation( *this ).IsToggled(); -} - void PushButton::SetButtonImage( Image image ) { - Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image ); + Actor imageActor = ImageActor::New( image ); + imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageActor ); } void PushButton::SetButtonImage( Actor image ) @@ -145,7 +93,9 @@ Actor PushButton::GetButtonImage() const void PushButton::SetBackgroundImage( Image image ) { - Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image ); + Actor imageActor = ImageActor::New( image ); + imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( imageActor ); } void PushButton::SetBackgroundImage( Actor image ) @@ -160,7 +110,9 @@ Actor PushButton::GetBackgroundImage() const void PushButton::SetSelectedImage( Image image ) { - Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image ); + Actor imageActor = ImageActor::New( image ); + imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( imageActor ); } void PushButton::SetSelectedImage( Actor image ) @@ -173,9 +125,26 @@ Actor PushButton::GetSelectedImage() const return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage(); } +void PushButton::SetSelectedBackgroundImage( Image image ) +{ + Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( ImageActor::New( image ) ); +} + +void PushButton::SetSelectedBackgroundImage( Actor image ) +{ + Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( image ); +} + +Actor PushButton::GetSelectedBackgroundImage() const +{ + return Dali::Toolkit::GetImplementation( *this ).GetSelectedBackgroundImage(); +} + void PushButton::SetDisabledBackgroundImage( Image image ) { - Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image ); + Actor imageActor = ImageActor::New( image ); + imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( imageActor ); } void PushButton::SetDisabledBackgroundImage( Actor image ) @@ -190,7 +159,9 @@ Actor PushButton::GetDisabledBackgroundImage() const void PushButton::SetDisabledImage( Image image ) { - Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image ); + Actor imageActor = ImageActor::New( image ); + imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( imageActor ); } void PushButton::SetDisabledImage( Actor image ) @@ -203,31 +174,6 @@ Actor PushButton::GetDisabledImage() const return Dali::Toolkit::GetImplementation( *this ).GetDisabledImage(); } -void PushButton::SetLabel( const std::string& label ) -{ - Dali::Toolkit::GetImplementation( *this ).SetLabel( label ); -} - -void PushButton::SetLabel( Actor label ) -{ - Dali::Toolkit::GetImplementation( *this ).SetLabel( label ); -} - -Actor PushButton::GetLabel() const -{ - return Dali::Toolkit::GetImplementation( *this ).GetLabel(); -} - -PushButton::PressedSignalType& PushButton::PressedSignal() -{ - return Dali::Toolkit::GetImplementation( *this ).PressedSignal(); -} - -PushButton::ReleasedSignalType& PushButton::ReleasedSignal() -{ - return Dali::Toolkit::GetImplementation( *this ).ReleasedSignal(); -} - } // namespace Toolkit } // namespace Dali