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%2Fbutton.cpp;h=c7b7b89de40b8d2fd91964fb6c8d0b329c104e11;hp=ab953bf928dc8c85a6d1ad242ba9ba307280c1d7;hb=6c8eb158ad2fb68a20bdcfabf8e07dd017da0528;hpb=1db0a8becea3dbdebaa942d934d91824a92434e7 diff --git a/dali-toolkit/public-api/controls/buttons/button.cpp b/dali-toolkit/public-api/controls/buttons/button.cpp index ab953bf..c7b7b89 100644 --- a/dali-toolkit/public-api/controls/buttons/button.cpp +++ b/dali-toolkit/public-api/controls/buttons/button.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * Copyright (c) 2015 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,6 +23,9 @@ #include +// EXTERNAL INCLUDES +#include + namespace Dali { @@ -140,6 +143,51 @@ Actor Button::GetLabel() const return Dali::Toolkit::GetImplementation( *this ).GetLabel(); } +void Button::SetButtonImage( Image image ) +{ + Actor imageActor = ImageActor::New( image ); + Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageActor ); +} + +void Button::SetBackgroundImage( Image image ) +{ + Actor imageActor = ImageActor::New( image ); + Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( imageActor ); +} + +void Button::SetSelectedImage( Image image ) +{ + Actor imageActor = ImageActor::New( image ); + imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( imageActor ); +} + +void Button::SetSelectedBackgroundImage( Image image ) +{ + Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( ImageActor::New( image ) ); +} + +void Button::SetDisabledBackgroundImage( Image image ) +{ + Actor imageActor = ImageActor::New( image ); + imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( imageActor ); +} + +void Button::SetDisabledImage( Image image ) +{ + Actor imageActor = ImageActor::New( image ); + imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( imageActor ); +} + +void Button::SetDisabledSelectedImage( Image image ) +{ + Actor imageActor = ImageActor::New( image ); + imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS ); + Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( imageActor ); +} + Button::ButtonSignalType& Button::PressedSignal() { return Dali::Toolkit::GetImplementation( *this ).PressedSignal();