return false;
}
+Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned int height )
+{
+ BufferImage imageData = BufferImage::New( width, height, Pixel::RGBA8888 );
+
+ // Create the image
+ PixelBuffer* pixbuf = imageData.GetBuffer();
+ unsigned int size = width * height;
+
+ for( size_t i = 0; i < size; i++ )
+ {
+ pixbuf[i*4+0] = 0xFF * color.r;
+ pixbuf[i*4+1] = 0xFF * color.g;
+ pixbuf[i*4+2] = 0xFF * color.b;
+ pixbuf[i*4+3] = 0xFF * color.a;
+ }
+
+ imageData.Update();
+
+ return imageData;
+}
+
const Dali::TouchPoint pointDownInside( 0, TouchPoint::Down, 240, 400 );
const Dali::TouchPoint pointUpInside( 0, TouchPoint::Up, 240, 400 );
const Dali::TouchPoint pointLeave( 0, TouchPoint::Leave, 240, 400 );
END_TEST;
}
+int UtcDaliButtonSetButtonImage(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliButtonSetButtonImage");
+
+ Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+
+ PushButton pushButton = PushButton::New();
+ Stage::GetCurrent().Add( pushButton );
+
+ application.SendNotification();
+ application.Render();
+
+ pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
+ pushButton.SetButtonImage( image );
+
+ application.SendNotification();
+ application.Render();
+
+ Vector3 size = pushButton.GetCurrentSize();
+
+ DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION );
+ DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION );
+
+ END_TEST;
+}
+
+int UtcDaliButtonSetSelectedImageP(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliButtonSetButtonImage");
+
+ Image image = CreateSolidColorImage( Color::RED, 10, 10 );
+
+ PushButton pushButton = PushButton::New();
+ Stage::GetCurrent().Add( pushButton );
+
+ application.SendNotification();
+ application.Render();
+
+ pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
+ pushButton.SetSelectedImage( image );
+
+ application.SendNotification();
+ application.Render();
+
+ Vector3 size = pushButton.GetCurrentSize();
+
+ DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION );
+ DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION );
+
+ END_TEST;
+}
+
int UtcDaliButtonPressedSignalP(void)
{
ToolkitTestApplication application;
return true;
}
-Image CreateSolidColorImage( const Vector4& color, unsigned int width, unsigned int height )
-{
- BufferImage imageData = BufferImage::New( width, height, Pixel::RGBA8888 );
-
- // Create the image
- PixelBuffer* pixbuf = imageData.GetBuffer();
- unsigned int size = width * height;
-
- for( size_t i = 0; i < size; i++ )
- {
- pixbuf[i*4+0] = 0xFF * color.r;
- pixbuf[i*4+1] = 0xFF * color.g;
- pixbuf[i*4+2] = 0xFF * color.b;
- pixbuf[i*4+3] = 0xFF * color.a;
- }
-
- imageData.Update();
-
- return imageData;
-}
-
} // namespace
void checkbox_button_startup(void)
END_TEST;
}
-int UtcDaliCheckBoxButtonSetBackgroundImageP(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliCheckBoxButtonSetBackgroundImageP");
-
- Image image = CreateSolidColorImage( Color::RED, 10, 10 );
- ImageActor imageActor = CreateSolidColorActor( Color::RED );
- imageActor.SetSize( 20, 20 );
-
- CheckBoxButton checkBoxButton = CheckBoxButton::New();
-
- checkBoxButton.SetBackgroundImage( image );
-
- DALI_TEST_CHECK( checkBoxButton.GetBackgroundImage() );
-
- checkBoxButton.SetBackgroundImage( imageActor );
-
- DALI_TEST_CHECK( checkBoxButton.GetBackgroundImage() );
-
- END_TEST;
-}
-
-int UtcDaliCheckBoxButtonSetSelectedImageP(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliCheckBoxButtonSetSelectedImageP");
-
- Image image = CreateSolidColorImage( Color::RED, 10, 10 );
- ImageActor imageActor = CreateSolidColorActor( Color::RED );
- imageActor.SetSize( 20, 20 );
-
- CheckBoxButton checkBoxButton = CheckBoxButton::New();
-
- checkBoxButton.SetSelectedImage( image );
-
- DALI_TEST_CHECK( checkBoxButton.GetSelectedImage() );
-
- checkBoxButton.SetSelectedImage( imageActor );
-
- DALI_TEST_CHECK( checkBoxButton.GetSelectedImage() );
-
- END_TEST;
-}
-
-int UtcDaliCheckBoxButtonSetDisabledBackgroundImageP(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliCheckBoxButtonSetDisabledBackgroundImageP");
-
- Image image = CreateSolidColorImage( Color::RED, 10, 10 );
- ImageActor imageActor = CreateSolidColorActor( Color::RED );
- imageActor.SetSize( 20, 20 );
-
- CheckBoxButton checkBoxButton = CheckBoxButton::New();
-
- checkBoxButton.SetDisabledBackgroundImage( image );
-
- DALI_TEST_CHECK( checkBoxButton.GetDisabledBackgroundImage() );
-
- checkBoxButton.SetDisabledBackgroundImage( imageActor );
-
- DALI_TEST_CHECK( checkBoxButton.GetDisabledBackgroundImage() );
-
- END_TEST;
-}
-
-int UtcDaliCheckBoxButtonSetDisabledSelectedImageP(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliCheckBoxButtonSetDisabledSelectedImageP");
-
- Image image = CreateSolidColorImage( Color::RED, 10, 10 );
- ImageActor imageActor = CreateSolidColorActor( Color::RED );
- imageActor.SetSize( 20, 20 );
-
- CheckBoxButton checkBoxButton = CheckBoxButton::New();
-
- checkBoxButton.SetDisabledSelectedImage( image );
-
- DALI_TEST_CHECK( checkBoxButton.GetDisabledSelectedImage() );
-
- checkBoxButton.SetDisabledSelectedImage( imageActor );
-
- DALI_TEST_CHECK( checkBoxButton.GetDisabledSelectedImage() );
-
- END_TEST;
-}
-
int UtcDaliCheckBoxButtonSetGetSelected(void)
{
ToolkitTestApplication application;
DALI_TEST_CHECK( gCheckBoxButtonState );
END_TEST;
}
-
-int UtcDaliCheckBoxButtonSetImages(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliCheckBoxButtonSetImages");
-
- Actor imageActor;
-
- Image image01 = CreateSolidColorImage( Color::RED, 10, 10 );
- ImageActor imageActor01 = CreateSolidColorActor( Color::RED );
- imageActor01.SetSize( 20, 20 );
-
- Image image02 = CreateSolidColorImage( Color::RED, 30, 30 );
- ImageActor imageActor02 = CreateSolidColorActor( Color::RED );
- imageActor02.SetSize( 40, 40 );
- imageActor02.SetName( "imageActor02" );
-
- Image image03 = CreateSolidColorImage( Color::RED, 50, 50 );
- ImageActor imageActor03 = CreateSolidColorActor( Color::RED );
- imageActor03.SetSize( 60, 60 );
-
- Image image04 = CreateSolidColorImage( Color::RED, 70, 70 );
- ImageActor imageActor04 = CreateSolidColorActor( Color::RED );
- imageActor04.SetSize( 80, 80 );
-
- Vector3 size;
- CheckBoxButton checkBoxButton = CheckBoxButton::New();
- checkBoxButton.SetName( "UtcDaliCheckBoxButtonSetImages" );
- Stage::GetCurrent().Add( checkBoxButton );
-
- application.SendNotification();
- application.Render();
-
- // Just check if check box button size changes when a bigger image is set.
-
- checkBoxButton.SetBackgroundImage( image01 );
-
- application.SendNotification();
- application.Render();
-
- size = checkBoxButton.GetCurrentSize();
-
- DALI_TEST_EQUALS( size.width, 10.f, TEST_LOCATION );
- DALI_TEST_EQUALS( size.height, 10.f, TEST_LOCATION );
-
- checkBoxButton.SetBackgroundImage( imageActor01 );
-
- END_TEST;
-}
END_TEST;
}
-int UtcDaliPushButtonSetButtonImage(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliPushButtonSetButtonImage");
-
- Image image = CreateSolidColorImage( Color::RED, 10, 10 );
- ImageActor imageActor = CreateSolidColorActor( Color::RED );
- imageActor.SetSize( 20, 20 );
-
- PushButton pushButton = PushButton::New();
- Stage::GetCurrent().Add( pushButton );
-
- application.SendNotification();
- application.Render();
-
- pushButton.SetSize( Vector2( 20.0f, 20.0f ) );
- pushButton.SetButtonImage( image );
-
- DALI_TEST_CHECK( pushButton.GetButtonImage() );
-
- application.SendNotification();
- application.Render();
-
- Vector3 size = pushButton.GetCurrentSize();
-
- DALI_TEST_EQUALS( size.width, 20.f, TEST_LOCATION );
- DALI_TEST_EQUALS( size.height, 20.f, TEST_LOCATION );
-
- pushButton.SetButtonImage( imageActor );
-
- DALI_TEST_CHECK( pushButton.GetButtonImage() );
- END_TEST;
-}
-
-int UtcDaliPushButtonSetBackgroundImageP(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliPushButtonSetBackgroundImageP");
-
- Image image = CreateSolidColorImage( Color::RED, 10, 10 );
- ImageActor imageActor = CreateSolidColorActor( Color::RED );
- imageActor.SetSize( 20, 20 );
-
- PushButton pushButton = PushButton::New();
-
- pushButton.SetBackgroundImage( image );
-
- DALI_TEST_CHECK( pushButton.GetBackgroundImage() );
-
- pushButton.SetBackgroundImage( imageActor );
-
- DALI_TEST_CHECK( pushButton.GetBackgroundImage() );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetSelectedImageP(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliPushButtonSetSelectedImageP");
-
- Image image = CreateSolidColorImage( Color::RED, 10, 10 );
- ImageActor imageActor = CreateSolidColorActor( Color::RED );
- imageActor.SetSize( 20, 20 );
-
- PushButton pushButton = PushButton::New();
-
- pushButton.SetSelectedImage( image );
-
- DALI_TEST_CHECK( pushButton.GetSelectedImage() );
-
- pushButton.SetSelectedImage( imageActor );
-
- DALI_TEST_CHECK( pushButton.GetSelectedImage() );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetSelectedBackgroundImageP(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliPushButtonSetSelectedBackgroundImageP");
-
- Image image = CreateSolidColorImage( Color::RED, 10, 10 );
- ImageActor imageActor = CreateSolidColorActor( Color::RED );
- imageActor.SetSize( 20, 20 );
-
- PushButton pushButton = PushButton::New();
-
- pushButton.SetSelectedBackgroundImage( image );
-
- DALI_TEST_CHECK( pushButton.GetSelectedBackgroundImage() );
-
- pushButton.SetSelectedBackgroundImage( imageActor );
-
- DALI_TEST_CHECK( pushButton.GetSelectedBackgroundImage() );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetDisabledBackgroundImageP(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliPushButtonSetDisabledBackgroundImageP");
-
- Image image = CreateSolidColorImage( Color::RED, 10, 10 );
- ImageActor imageActor = CreateSolidColorActor( Color::RED );
- imageActor.SetSize( 20, 20 );
-
- PushButton pushButton = PushButton::New();
-
- pushButton.SetDisabledBackgroundImage( image );
-
- DALI_TEST_CHECK( pushButton.GetDisabledBackgroundImage() );
-
- pushButton.SetDisabledBackgroundImage( imageActor );
-
- DALI_TEST_CHECK( pushButton.GetDisabledBackgroundImage() );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetDisabledImageP(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliPushButtonSetDisabledImageP");
-
- Image image = CreateSolidColorImage( Color::RED, 10, 10 );
- ImageActor imageActor = CreateSolidColorActor( Color::RED );
- imageActor.SetSize( 20, 20 );
-
- PushButton pushButton = PushButton::New();
-
- pushButton.SetDisabledImage( image );
-
- DALI_TEST_CHECK( pushButton.GetDisabledImage() );
-
- pushButton.SetDisabledImage( imageActor );
-
- DALI_TEST_CHECK( pushButton.GetDisabledImage() );
-
- END_TEST;
-}
-
int UtcDaliPushButtonSetGetAutoRepeating(void)
{
ToolkitTestApplication application;
TextField field = TextField::New();
DALI_TEST_CHECK( field );
- // Check defaults.
- DALI_TEST_EQUALS( field.GetProperty<int>( TextField::Property::RENDERING_BACKEND ), DEFAULT_RENDERING_BACKEND, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::TEXT ), std::string(""), TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::PLACEHOLDER_TEXT ), std::string(""), TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::PLACEHOLDER_TEXT_FOCUSED ), std::string(""), TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_FAMILY ), std::string(""), TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::FONT_STYLE ), std::string(""), TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::POINT_SIZE ), 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<int>( TextField::Property::MAX_LENGTH ), 50u, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<int>( TextField::Property::EXCEED_POLICY ), TextField::EXCEED_POLICY_CLIP, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::HORIZONTAL_ALIGNMENT ), "BEGIN", TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<std::string>( TextField::Property::VERTICAL_ALIGNMENT ), "TOP", TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::TEXT_COLOR ), Color::BLACK, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<Vector2>( TextField::Property::SHADOW_OFFSET ), Vector2::ZERO, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::PLACEHOLDER_TEXT_COLOR ), PLACEHOLDER_TEXT_COLOR, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::SHADOW_COLOR ), Color::BLACK, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::PRIMARY_CURSOR_COLOR ), Color::BLACK, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::SECONDARY_CURSOR_COLOR ), Color::BLACK, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<bool>( TextField::Property::ENABLE_CURSOR_BLINK ), true, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::CURSOR_BLINK_INTERVAL ), CURSOR_BLINK_INTERVAL * TO_SECONDS, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::CURSOR_BLINK_DURATION ), 0.f, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::SCROLL_THRESHOLD ), SCROLL_THRESHOLD, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<float>( TextField::Property::SCROLL_SPEED ), SCROLL_SPEED, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
- DALI_TEST_EQUALS( field.GetProperty<Vector4>( TextField::Property::SELECTION_HIGHLIGHT_COLOR ), LIGHT_BLUE, TEST_LOCATION );
+ // Note - we can't check the defaults since the stylesheets are platform-specific
// Check the render backend property.
field.SetProperty( TextField::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS );
// Checks if the right number of actors are created.
TextField field = TextField::New();
+ field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
DALI_TEST_CHECK( field );
Stage::GetCurrent().Add( field );
DALI_TEST_EQUALS( position2, position4, TEST_LOCATION ); // Should be in the same position2.
- // Try to tap at the end.
+ // Tap away from the start position.
application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 13.f, 25.0f ) ) );
application.ProcessEvent( GenerateTap( Gesture::Started, 1u, 1u, Vector2( 13.0f, 25.0f ) ) );
application.SendNotification();
application.Render();
- // Cursor position should be the same than position1.
Vector3 position5 = cursor.GetCurrentPosition();
- DALI_TEST_EQUALS( position1, position5, TEST_LOCATION ); // Should be in the same position1.
+ DALI_TEST_CHECK( position5.x > position4.x );
- // Remove some text.
+ // Remove all the text.
application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down ) );
application.ProcessEvent( GenerateKey( "", "", DALI_KEY_BACKSPACE, 0, 0, Integration::KeyEvent::Down ) );
+ field.SetProperty( TextField::Property::TEXT, "" );
// Render and notify
application.SendNotification();
Stage::GetCurrent().Add( field );
field.SetProperty( TextField::Property::TEXT, "This is a long text for the size of the text-field." );
+ field.SetProperty( TextField::Property::POINT_SIZE, 10.f );
field.SetSize( 30.f, 50.f );
field.SetParentOrigin( ParentOrigin::TOP_LEFT );
field.SetAnchorPoint( AnchorPoint::TOP_LEFT );
TextLabel label = TextLabel::New();
DALI_TEST_CHECK( label );
- // Check defaults
- DALI_TEST_EQUALS( label.GetProperty<int>( TextLabel::Property::RENDERING_BACKEND ), DEFAULT_RENDERING_BACKEND, TEST_LOCATION );
- DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::TEXT ), std::string(""), TEST_LOCATION );
- DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_FAMILY ), std::string(""), TEST_LOCATION );
- DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::FONT_STYLE ), std::string(""), TEST_LOCATION );
- DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::POINT_SIZE ), 0.f, Math::MACHINE_EPSILON_1000, TEST_LOCATION );
- DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::MULTI_LINE ), false, TEST_LOCATION );
- DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::HORIZONTAL_ALIGNMENT ), "BEGIN", TEST_LOCATION );
- DALI_TEST_EQUALS( label.GetProperty<std::string>( TextLabel::Property::VERTICAL_ALIGNMENT ), "TOP", TEST_LOCATION );
- DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::TEXT_COLOR ), Color::BLACK, TEST_LOCATION );
- DALI_TEST_EQUALS( label.GetProperty<Vector2>( TextLabel::Property::SHADOW_OFFSET ), Vector2::ZERO, TEST_LOCATION );
- DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::SHADOW_COLOR ), Color::BLACK, TEST_LOCATION );
- DALI_TEST_EQUALS( label.GetProperty<bool>( TextLabel::Property::UNDERLINE_ENABLED ), false, TEST_LOCATION );
- DALI_TEST_EQUALS( label.GetProperty<Vector4>( TextLabel::Property::UNDERLINE_COLOR ), Color::BLACK, TEST_LOCATION );
- DALI_TEST_EQUALS( label.GetProperty<float>( TextLabel::Property::UNDERLINE_HEIGHT ), 0.0f, TEST_LOCATION );
-
+ // Note - we can't check the defaults since the stylesheets are platform-specific
label.SetProperty( TextLabel::Property::RENDERING_BACKEND, Text::RENDERING_SHARED_ATLAS );
DALI_TEST_EQUALS( label.GetProperty<int>( TextLabel::Property::RENDERING_BACKEND ), Text::RENDERING_SHARED_ATLAS, TEST_LOCATION );
const Dali::Vector4 DEFAULT_OPTION_ICON( Dali::Vector4( 1.0f, 1.0f, 1.0f, 1.0f ) );
const Dali::Vector4 DEFAULT_OPTION_PRESSED_COLOR( Dali::Vector4( 0.24f, 0.72f, 0.8f, 0.11f ) );
-const float DEFAULT_CAPTION_POINT_SIZE = 8.0f; // todo This should be from the style sheet not fixed.
-
const std::string DEFAULT_POPUP_BACKGROUND_IMAGE( DALI_IMAGE_DIR "selection-popup-bg#.png" );
const std::string OPTION_ICON_CLIPBOARD( DALI_IMAGE_DIR "copy_paste_icon_clipboard.png" );
const std::string OPTION_ICON_COPY( DALI_IMAGE_DIR "copy_paste_icon_copy.png" );
Toolkit::TextLabel captionTextLabel = Toolkit::TextLabel::New();
captionTextLabel.SetStyleName( TEXT_SELECTION_POPUP_LABEL );
captionTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, caption );
- captionTextLabel.SetProperty( Toolkit::TextLabel::Property::POINT_SIZE, DEFAULT_CAPTION_POINT_SIZE );
captionTextLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
Toolkit::TextLabel pressedCaptionTextLabel = Toolkit::TextLabel::New();
pressedCaptionTextLabel.SetStyleName( TEXT_SELECTION_POPUP_LABEL );
pressedCaptionTextLabel.SetProperty( Toolkit::TextLabel::Property::TEXT, caption );
- pressedCaptionTextLabel.SetProperty( Toolkit::TextLabel::Property::POINT_SIZE, DEFAULT_CAPTION_POINT_SIZE );
pressedCaptionTextLabel.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
Padding padding;
void StyleManager::ApplyThemeStyle( Toolkit::Control control )
{
+ if( !mThemeBuilder )
+ {
+ RequestDefaultTheme();
+ }
+
if( mThemeBuilder )
{
ApplyStyle( mThemeBuilder, control );
#include <dali-toolkit/internal/controls/buttons/button-impl.h>
+// EXTERNAL INCLUDES
+#include <dali/public-api/actors/image-actor.h>
+
namespace Dali
{
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();
*/
Actor GetLabel() const;
+ /**
+ * @brief Sets the button image.
+ *
+ * @param[in] image The button image.
+ */
+ void SetButtonImage( Image image );
+
+ /**
+ * @brief Sets the background image.
+ *
+ * @param[in] image The background image.
+ */
+ void SetBackgroundImage( Image image );
+
+ /**
+ * @brief Sets the selected image.
+ *
+ * @param[in] image The selected image.
+ */
+ void SetSelectedImage( Image image );
+
+ /**
+ * @brief Sets the selected background image.
+ *
+ * @param[in] image The selected background image.
+ */
+ void SetSelectedBackgroundImage( Image image );
+
+ /**
+ * @brief Sets the disabled background image.
+ *
+ * @param[in] image The disabled background image.
+ */
+ void SetDisabledBackgroundImage( Image image );
+
+ /**
+ * @brief Sets the disabled button image.
+ *
+ * @param[in] image The disabled button image.
+ */
+ void SetDisabledImage( Image image );
+
+ /**
+ * @brief Sets the disabled selected button image.
+ *
+ * @param[in] image The disabled selected button image.
+ */
+ void SetDisabledSelectedImage( Image image );
+
public: //Signals
/**
// INTERNAL INCLUDES
#include <dali-toolkit/internal/controls/buttons/check-box-button-impl.h>
-#include <dali/public-api/actors/image-actor.h>
namespace Dali
{
return Control::DownCast<CheckBoxButton, Internal::CheckBoxButton>(handle);
}
-void CheckBoxButton::SetBackgroundImage( Image image )
-{
- Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( ImageActor::New( image ) );
-}
-
-void CheckBoxButton::SetBackgroundImage( Actor image )
-{
- Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
-}
-
-Actor CheckBoxButton::GetBackgroundImage() const
-{
- return Dali::Toolkit::GetImplementation( *this ).GetBackgroundImage();
-}
-
-void CheckBoxButton::SetSelectedImage( Image image )
-{
- Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( ImageActor::New( image ) );
-}
-
-void CheckBoxButton::SetSelectedImage( Actor image )
-{
- Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
-}
-
-Actor CheckBoxButton::GetSelectedImage() const
-{
- return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage();
-}
-
-void CheckBoxButton::SetDisabledBackgroundImage( Image image )
-{
- Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( ImageActor::New( image ) );
-}
-
-void CheckBoxButton::SetDisabledBackgroundImage( Actor image )
-{
- Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
-}
-
-Actor CheckBoxButton::GetDisabledBackgroundImage() const
-{
- return Dali::Toolkit::GetImplementation( *this ).GetDisabledBackgroundImage();
-}
-
-void CheckBoxButton::SetDisabledSelectedImage( Image image )
-{
- Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( ImageActor::New( image ) );
-}
-
-void CheckBoxButton::SetDisabledSelectedImage( Actor image )
-{
- Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( image );
-}
-
-Actor CheckBoxButton::GetDisabledSelectedImage() const
-{
- return Dali::Toolkit::GetImplementation( *this ).GetDisabledSelectedImage();
-}
-
CheckBoxButton::CheckBoxButton( Internal::CheckBoxButton& implementation )
: Button( implementation )
{
*/
static CheckBoxButton DownCast( BaseHandle handle );
- /**
- * Sets the background image.
- *
- * @param[in] image The background image.
- */
- void SetBackgroundImage( Image image );
-
- /**
- * @copydoc SetBackgroundImage( Image image )
- */
- void SetBackgroundImage( Actor image );
-
- /**
- * Gets the background image.
- * @return An actor with the background image.
- */
- Actor GetBackgroundImage() const;
-
- /**
- * Sets the selected image.
- *
- * @param[in] image The selected image.
- */
- void SetSelectedImage( Image image );
-
- /**
- * @copydoc SetSelectedImage( Image image )
- */
- void SetSelectedImage( Actor image );
-
- /**
- * Gets the selected image.
- * @return An actor with the selected image.
- */
- Actor GetSelectedImage() const;
-
- /**
- * Sets the disabled background image.
- *
- * @param[in] image The disabled background image.
- */
- void SetDisabledBackgroundImage( Image image );
-
- /**
- * @copydoc SetDisabledBackgroundImage( Image image )
- */
- void SetDisabledBackgroundImage( Actor image );
-
- /**
- * Gets the disabled background image.
- * @return An actor with the disabled background image.
- */
- Actor GetDisabledBackgroundImage() const;
-
- /**
- * Sets the disabled selected image.
- *
- * @param[in] image The disabled selected image.
- */
- void SetDisabledSelectedImage( Image image );
-
- /**
- * @copydoc SetDisabledSelectedImage( Image image )
- */
- void SetDisabledSelectedImage( Actor image );
-
- /**
- * Gets the disabled selected image.
- * @return An actor with the disabled selected image.
- */
- Actor GetDisabledSelectedImage() const;
-
public: // Not intended for application developers
/**
return Control::DownCast<PushButton, Internal::PushButton>(handle);
}
-void PushButton::SetButtonImage( Image image )
-{
- Actor imageActor = ImageActor::New( image );
- Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageActor );
-}
-
void PushButton::SetButtonImage( Actor image )
{
Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
return Dali::Toolkit::GetImplementation( *this ).GetButtonImage();
}
-void PushButton::SetBackgroundImage( Image image )
-{
- Actor imageActor = ImageActor::New( image );
- Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( imageActor );
-}
-
void PushButton::SetBackgroundImage( Actor image )
{
Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
return Dali::Toolkit::GetImplementation( *this ).GetBackgroundImage();
}
-void PushButton::SetSelectedImage( Image 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 )
{
Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
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 );
return Dali::Toolkit::GetImplementation( *this ).GetSelectedBackgroundImage();
}
-void PushButton::SetDisabledBackgroundImage( Image 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 )
{
Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
return Dali::Toolkit::GetImplementation( *this ).GetDisabledBackgroundImage();
}
-void PushButton::SetDisabledImage( Image 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 )
{
Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
*/
static PushButton DownCast( BaseHandle handle );
- /**
- * @brief Sets the button image.
- *
- * @param[in] image The button image.
- */
- void SetButtonImage( Image image );
+ using Button::SetButtonImage;
/**
* @brief SetButtonImage
*/
Actor GetButtonImage() const;
- /**
- * @brief Sets the background image.
- *
- * @param[in] image The background image.
- */
- void SetBackgroundImage( Image image );
+ using Button::SetBackgroundImage;
/**
* @brief SetBackgroundImage
*/
Actor GetBackgroundImage() const;
- /**
- * @brief Sets the selected image.
- *
- * @param[in] image The selected image.
- */
- void SetSelectedImage( Image image );
+ using Button::SetSelectedImage;
/**
* @copydoc SetSelectedImage( Image image )
*/
Actor GetSelectedImage() const;
- /**
- * @brief Sets the selected background image.
- *
- * @param[in] image The selected background image.
- */
- void SetSelectedBackgroundImage( Image image );
+ using Button::SetSelectedBackgroundImage;
/**
* @copydoc SetSelectedBackgroundImage( Image image )
*/
Actor GetSelectedBackgroundImage() const;
- /**
- * @brief Sets the disabled background image.
- *
- * @param[in] image The disabled background image.
- */
- void SetDisabledBackgroundImage( Image image );
+ using Button::SetDisabledBackgroundImage;
/**
* @copydoc SetDisabledBackgroundImage( Image image )
*/
Actor GetDisabledBackgroundImage() const;
- /**
- * @brief Sets the disabled button image.
- *
- * @param[in] image The disabled button image.
- */
- void SetDisabledImage( Image image );
+ using Button::SetDisabledImage;
/**
* @copydoc SetDisabledImage( Image image )