return point;
}
-static float ANIMATION_TIME( 0.5f );
-
} // namespace
int UtcDaliButtonConstructorP(void)
DALI_TEST_EQUALS( isSelected, SELECTED , TEST_LOCATION );
tet_infoline("Set button to DISABLED = false whilst disabled and then set to unselected\n");
- button.SetProperty( Button::Property::DISABLED, false );
+ button.SetProperty( Button::Property::DISABLED, false);
button.SetProperty( Button::Property::SELECTED, !SELECTED );
isSelected = button.GetProperty<bool>( Button::Property::SELECTED );
Button button = PushButton::New();
- button.SetDisabled( true );
+ button.SetProperty( Button::Property::DISABLED, true);
- DALI_TEST_CHECK( button.IsDisabled() );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::DISABLED ), true, TEST_LOCATION );
- button.SetDisabled( false );
+ button.SetProperty( Button::Property::DISABLED, false);
- DALI_TEST_CHECK( !button.IsDisabled() );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::DISABLED ), false, TEST_LOCATION );
END_TEST;
}
DALI_TEST_EQUALS( button.GetProperty<bool>( button.GetPropertyIndex("autoRepeating")), true, TEST_LOCATION );
- button.SetAutoRepeating( false );
-
- DALI_TEST_CHECK( !button.IsAutoRepeating() );
END_TEST;
}
Button button = PushButton::New();
- button.SetAutoRepeating( true );
+ button.SetProperty( Button::Property::AUTO_REPEATING, true);
- DALI_TEST_CHECK( button.IsAutoRepeating() );
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::AUTO_REPEATING ), true, TEST_LOCATION );
- button.SetAutoRepeating( false );
+ button.SetProperty( Button::Property::AUTO_REPEATING, false);
+
+ DALI_TEST_EQUALS( button.GetProperty<bool>( Button::Property::AUTO_REPEATING ), false, TEST_LOCATION );
- DALI_TEST_CHECK( !button.IsAutoRepeating() );
END_TEST;
}
END_TEST;
}
-int UtcDaliButtonSetAnimationTimeP(void)
-{
- ToolkitTestApplication application;
- tet_infoline(" UtcDaliButtonSetAnimationTimeP");
-
- Button button = PushButton::New();
-
- button.SetAnimationTime( ANIMATION_TIME );
-
- DALI_TEST_EQUALS( button.GetAnimationTime(), ANIMATION_TIME, TEST_LOCATION );
- END_TEST;
-}
-
int UtcDaliButtonSetLabelStringWithPropertyMapP(void)
{
ToolkitTestApplication application;
END_TEST;
}
-// Deprecated API Tests
-
-int UtcDaliButtonSetDisabledP(void)
-{
- ToolkitTestApplication application;
-
- Button button = PushButton::New();
-
- button.SetDisabled( true );
-
- DALI_TEST_CHECK( button.IsDisabled() );
-
- button.SetDisabled( false );
-
- DALI_TEST_CHECK( !button.IsDisabled() );
-
- button.SetDisabled( true );
-
- DALI_TEST_CHECK( button.IsDisabled() );
-
- button.SetDisabled( false );
-
- DALI_TEST_CHECK( !button.IsDisabled() );
- END_TEST;
-}
-
-int UtcDaliButtonSetAutoRepeatingP(void)
-{
- ToolkitTestApplication application;
-
- Button button = PushButton::New();
-
- button.SetAutoRepeating( true );
-
- DALI_TEST_CHECK( button.IsAutoRepeating() );
-
- button.SetAutoRepeating( false );
-
- DALI_TEST_CHECK( !button.IsAutoRepeating() );
-
- button.SetAutoRepeating( true );
-
- DALI_TEST_CHECK( button.IsAutoRepeating() );
-
- button.SetAutoRepeating( false );
-
- DALI_TEST_CHECK( !button.IsAutoRepeating() );
- END_TEST;
-}
-
-int UtcDaliButtonSetInitialAutoRepeatingDelayP(void)
-{
- ToolkitTestApplication application;
-
- Button button = PushButton::New();
-
- button.SetInitialAutoRepeatingDelay( 0.5f );
-
- DALI_TEST_EQUALS( button.GetInitialAutoRepeatingDelay(), 0.5f, TEST_LOCATION );
-
- button.SetInitialAutoRepeatingDelay( 0.2f );
-
- DALI_TEST_EQUALS( button.GetInitialAutoRepeatingDelay(), 0.2f, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliButtonSetNextAutoRepeatingDelayP(void)
-{
- ToolkitTestApplication application;
-
- Button button = PushButton::New();
-
- button.SetNextAutoRepeatingDelay( 0.5f );
-
- DALI_TEST_EQUALS( button.GetNextAutoRepeatingDelay(), 0.5f, TEST_LOCATION );
-
- button.SetProperty( Button::Property::NEXT_AUTO_REPEATING_DELAY, 0.2f );
-
- DALI_TEST_EQUALS( button.GetNextAutoRepeatingDelay(), 0.2f, TEST_LOCATION );
- END_TEST;
-}
-
-int UtcDaliButtonSetTogglableButtonP(void)
-{
- ToolkitTestApplication application;
-
- Button button = PushButton::New();
-
- button.SetTogglableButton( true );
-
- DALI_TEST_CHECK( button.IsTogglableButton() );
-
- button.SetTogglableButton( false );
-
- DALI_TEST_CHECK( !button.IsTogglableButton() );
- END_TEST;
-}
-
-int UtcDaliButtonSetSelectedP(void)
-{
- ToolkitTestApplication application;
-
- Button button = PushButton::New();
- button.SetTogglableButton( true );
-
- button.SetSelected( true );
-
- DALI_TEST_CHECK( button.IsSelected() );
-
- button.SetSelected( false );
-
- DALI_TEST_CHECK( !button.IsSelected() );
- END_TEST;
-}
-
int UtcDaliButtonEventConsumption(void)
{
/**
.Add( Toolkit::TextVisual::Property::TEXT, "activate" )
.Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f );
- checkBox.SetProperty( Toolkit::DevelButton::Property::LABEL, propertyMap );
+ checkBox.SetProperty( Toolkit::Button::Property::LABEL, propertyMap );
application.SendNotification();
application.Render();
.Add( Toolkit::TextVisual::Property::TEXT, "activate" )
.Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f );
- checkBox.SetProperty( Toolkit::DevelButton::Property::LABEL, propertyMap );
+ checkBox.SetProperty( Toolkit::Button::Property::LABEL, propertyMap );
checkBox.SetProperty( Toolkit::DevelButton::Property::LABEL_PADDING, Vector4( 5.0f, 5.0f, 5.0f, 5.0f ) );
application.SendNotification();
TestPlatformAbstraction& platform = application.GetPlatform();
platform.SetClosestImageSize( TEST_IMAGE_SIZE );
- checkBox.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, TEST_IMAGE_ONE );
- checkBox.SetProperty( Toolkit::DevelButton::Property::SELECTED_VISUAL, TEST_IMAGE_ONE );
+ checkBox.SetProperty( Toolkit::Button::Property::UNSELECTED_VISUAL, TEST_IMAGE_ONE );
+ checkBox.SetProperty( Toolkit::Button::Property::SELECTED_VISUAL, TEST_IMAGE_ONE );
application.SendNotification();
// global var used to check if CheckBoxButtonClicked is called;
gCheckBoxButtonState = false;
- checkBoxButton.SetSelected( true );
+ checkBoxButton.SetProperty( Button::Property::SELECTED, true );
- DALI_TEST_CHECK( checkBoxButton.IsSelected() );
+ DALI_TEST_EQUALS( checkBoxButton.GetProperty( Button::Property::SELECTED ).Get<bool>(), true, TEST_LOCATION );
DALI_TEST_CHECK( gCheckBoxButtonState );
- checkBoxButton.SetSelected( false );
+ checkBoxButton.SetProperty( Button::Property::SELECTED, false );
- DALI_TEST_CHECK( !checkBoxButton.IsSelected() );
+ DALI_TEST_EQUALS( checkBoxButton.GetProperty( Button::Property::SELECTED ).Get<bool>(), false, TEST_LOCATION );
DALI_TEST_CHECK( !gCheckBoxButtonState );
- checkBoxButton.SetSelected( true );
+ checkBoxButton.SetProperty( Button::Property::SELECTED, true );
- DALI_TEST_CHECK( checkBoxButton.IsSelected() );
+ DALI_TEST_EQUALS( checkBoxButton.GetProperty( Button::Property::SELECTED ).Get<bool>(), true, TEST_LOCATION );
DALI_TEST_CHECK( gCheckBoxButtonState );
END_TEST;
}
Stage::GetCurrent().Add( checkBox );
checkBox.SetSize( Vector2( 20.0f, 20.0f ) );
- checkBox.SetDisabledBackgroundImage( "Image.jpg" );
+ checkBox.SetProperty(Button::Property::DISABLED_UNSELECTED_VISUAL, "Image.jpg" );
application.SendNotification();
application.Render();
checkBox.SetProperty( checkBox.GetPropertyIndex("label"), propertyMap );
DALI_TEST_CHECK( checkBox.GetProperty<bool>(checkBox.GetPropertyIndex("disabled")) );
- DALI_TEST_EQUALS( checkBox.GetLabelText(), "activate", TEST_LOCATION );
+ DALI_TEST_EQUALS( GetButtonText(checkBox), "activate", TEST_LOCATION );
END_TEST;
}
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
ToolkitTestApplication application;
Control control = Control::New();
- DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
+ DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
- control.SetBackgroundColor( Color::RED );
+ control.SetProperty( Control::Property::BACKGROUND, Color::RED );
Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
Property::Map* resultMap = propValue.GetMap();
DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR ) );
DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>() == Color::RED );
- DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::RED, TEST_LOCATION );
-
- control.SetBackgroundColor( Color::YELLOW );
+ control.SetProperty( Control::Property::BACKGROUND, Color::YELLOW );
propValue = control.GetProperty( Control::Property::BACKGROUND );
resultMap = propValue.GetMap();
DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR ) );
DALI_TEST_CHECK( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>() == Color::YELLOW );
- DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::YELLOW, TEST_LOCATION );
-
END_TEST;
}
ToolkitTestApplication application;
Control control = Control::New();
- DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
-
- Image image = ResourceImage::New("TestImage");
- control.SetBackgroundImage( image );
+ tet_infoline( "Set first background image" );
+ control.SetProperty( Control::Property::BACKGROUND, "TestImage" );
Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
Property::Map* resultMap = propValue.GetMap();
DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL ) );
DALI_TEST_CHECK( resultMap->Find( ImageVisual::Property::URL )->Get<std::string>() == "TestImage" );
- image = ResourceImage::New("TestImage2");
- control.SetBackgroundImage( image );
+ tet_infoline( "Set replacement background image" );
+ control.SetProperty( Control::Property::BACKGROUND, "TestImage2" );
propValue = control.GetProperty( Control::Property::BACKGROUND );
resultMap = propValue.GetMap();
ToolkitTestApplication application;
Control control = Control::New();
- DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
Property::Map imageMap;
DALI_TEST_EQUALS( resultMap->Find( Toolkit::Visual::Property::TYPE )->Get<int>(), (int)Visual::COLOR, TEST_LOCATION );
DALI_TEST_EQUALS( resultMap->Find( ColorVisual::Property::MIX_COLOR )->Get<Vector4>(), Color::RED, TEST_LOCATION );
- // Deprecated Properties
- control.SetProperty( Control::Property::BACKGROUND_COLOR, Color::YELLOW );
- DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), Color::YELLOW, TEST_LOCATION );
- DALI_TEST_EQUALS( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >(), control.GetBackgroundColor(), TEST_LOCATION );
-
- control.ClearBackground();
-
- Property::Map deprecatedImageMap;
- deprecatedImageMap[ "filename" ] = "TestImage";
- control.SetProperty( Control::Property::BACKGROUND_IMAGE, deprecatedImageMap );
- propValue = control.GetProperty( Control::Property::BACKGROUND_IMAGE );
- resultMap = propValue.GetMap();
- DALI_TEST_EQUALS( resultMap->Find( ImageVisual::Property::URL )->Get< std::string >(), "TestImage" , TEST_LOCATION );
-
- control.SetProperty( Control::Property::BACKGROUND_IMAGE, emptyMap );
- DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND_IMAGE ).Get< Property::Map >().Empty() );
-
END_TEST;
}
int width = 100;
int height = 200;
- Image image = CreateBufferImage( width, height, Vector4(1.f, 1.f, 1.f, 1.f) );
ImageView imageView = ImageView::New();
- imageView.SetBackgroundImage( image );
+
+ imageView.SetProperty( Control::Property::BACKGROUND,
+ {
+ { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE },
+ { Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg" },
+ { ImageVisual::Property::DESIRED_WIDTH, width },
+ { ImageVisual::Property::DESIRED_HEIGHT, height },
+ }
+ );
Stage::GetCurrent().Add( imageView );
application.SendNotification();
int heightBackground = 200;
int width = 300;
int height = 400;
- Image imageBackground = CreateBufferImage( widthBackground, heightBackground, Vector4(1.f, 1.f, 1.f, 1.f) );
Image image = CreateBufferImage( width, height, Vector4(1.f, 1.f, 1.f, 1.f) );
ImageView imageView = ImageView::New();
- imageView.SetBackgroundImage( imageBackground );
+
+ imageView.SetProperty( Control::Property::BACKGROUND,
+ {
+ { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE },
+ { Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg" },
+ { ImageVisual::Property::DESIRED_WIDTH, widthBackground },
+ { ImageVisual::Property::DESIRED_HEIGHT, heightBackground },
+ }
+ );
+
imageView.SetImage( image );
Stage::GetCurrent().Add( imageView );
int widthBackground = 100;
int heightBackground = 200;
- Image imageBackground = CreateBufferImage( widthBackground, heightBackground, Vector4(1.f, 1.f, 1.f, 1.f) );
ImageView imageView = ImageView::New();
- imageView.SetBackgroundImage( imageBackground );
+
+ imageView.SetProperty( Control::Property::BACKGROUND,
+ {
+ { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE },
+ { Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg" },
+ { ImageVisual::Property::DESIRED_WIDTH, widthBackground },
+ { ImageVisual::Property::DESIRED_HEIGHT, heightBackground }
+ }
+ );
Stage::GetCurrent().Add( imageView );
application.SendNotification();
int heightBackground = 200;
int width = 300;
int height = 400;
- Image imageBackground = CreateBufferImage( widthBackground, heightBackground, Vector4(1.f, 1.f, 1.f, 1.f) );
+
Image image = CreateBufferImage( width, height, Vector4(1.f, 1.f, 1.f, 1.f) );
ImageView imageView = ImageView::New();
- imageView.SetBackgroundImage( imageBackground );
+
+ imageView.SetProperty( Control::Property::BACKGROUND,
+ {
+ { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE },
+ { Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg" },
+ { ImageVisual::Property::DESIRED_WIDTH, widthBackground },
+ { ImageVisual::Property::DESIRED_HEIGHT, heightBackground }
+ }
+ );
+
imageView.SetImage( image );
Stage::GetCurrent().Add( imageView );
gResourceReadySignalFired = false;
-
- int width = 100;
- int height = 200;
- Image image = CreateBufferImage( width, height, Vector4(1.f, 1.f, 1.f, 1.f) );
-
// Check ImageView with background and main image, to ensure both visuals are marked as loaded
ImageView imageView = ImageView::New( TEST_GIF_FILE_NAME );
- imageView.SetBackgroundImage( image );
+ imageView.SetProperty( Control::Property::BACKGROUND,
+ {
+ { Toolkit::Visual::Property::TYPE, Toolkit::Visual::IMAGE },
+ { Toolkit::ImageVisual::Property::URL, TEST_RESOURCE_DIR "/gallery-small-1.jpg" },
+ { ImageVisual::Property::DESIRED_WIDTH, 100 },
+ { ImageVisual::Property::DESIRED_HEIGHT, 200 }
+ }
+ );
DALI_TEST_EQUALS( imageView.IsResourceReady(), false, TEST_LOCATION );
Stage::GetCurrent().Add( imageView );
+ // loading started, this waits for the loader thread
+ DALI_TEST_EQUALS( Test::WaitForEventThreadTrigger( 1 ), true, TEST_LOCATION );
+
application.SendNotification();
application.Render(16);
-
DALI_TEST_EQUALS( imageView.IsResourceReady(), true, TEST_LOCATION );
DALI_TEST_EQUALS( gResourceReadySignalFired, true, TEST_LOCATION );
ToolkitTestApplication application;
ImageView imageView = ImageView::New();
- DALI_TEST_CHECK( imageView.GetProperty( ImageView::Property::RESOURCE_URL ).Get< std::string >().empty() );
+ DALI_TEST_CHECK( imageView.GetProperty( ImageView::Property::IMAGE ).Get< std::string >().empty() );
- imageView.SetProperty( ImageView::Property::RESOURCE_URL, "TestString" );
- DALI_TEST_EQUALS( imageView.GetProperty( ImageView::Property::RESOURCE_URL ).Get< std::string >(), "TestString", TEST_LOCATION );
+ imageView.SetProperty( ImageView::Property::IMAGE, "TestString" );
+ DALI_TEST_EQUALS( imageView.GetProperty( ImageView::Property::IMAGE ).Get< std::string >(), "TestString", TEST_LOCATION );
END_TEST;
}
namespace
{
static const char* TEST_IMAGE_ONE = TEST_RESOURCE_DIR "/gallery-small-1.jpg";
-static const char* TEST_IMAGE_TWO = TEST_RESOURCE_DIR "/icon-delete.jpg";
static const Vector2 INSIDE_TOUCH_POINT_POSITON = Vector2( 240, 400 );
static const Vector3 BUTTON_POSITON_TO_GET_INSIDE_TOUCH_EVENTS = Vector3( 200, 360, 0 );
const Vector2 TEST_IMAGE_SIZE = Vector2( BUTTON_SIZE_TO_GET_INSIDE_TOUCH_EVENTS );
TestPlatformAbstraction& platform = application.GetPlatform();
platform.SetClosestImageSize( TEST_IMAGE_SIZE );
- button.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE );
- button.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE );
+ button.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE );
+ button.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE );
}
}
propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
propertyMap.Insert(ColorVisual::Property::MIX_COLOR, Color::BLUE);
- pushButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, propertyMap );
+ pushButton.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, propertyMap );
tet_infoline(" UNSELECTED_VISUAL Added to button\n");
Property::Map propertyMap2;
propertyMap2.Insert(Visual::Property::TYPE, Visual::COLOR);
propertyMap2.Insert(ColorVisual::Property::MIX_COLOR, Color::RED);
- pushButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, propertyMap2 );
+ pushButton.SetProperty( Toolkit::Button::Property::UNSELECTED_VISUAL, propertyMap2 );
tet_printf("Added UNSELECTED_VISUAL and add button back to Stage\n");
colorMap.Insert(Visual::Property::TYPE, BROKEN_VISUAL_TYPE);
colorMap.Insert(BorderVisual::Property::COLOR, Color::BLUE);
colorMap.Insert(BorderVisual::Property::SIZE, 5.f);
- pushButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, colorMap );
+ pushButton.SetProperty( Toolkit::Button::Property::UNSELECTED_VISUAL, colorMap );
Stage::GetCurrent().Add( pushButton );
application.SendNotification();
END_TEST;
}
-int UtcDaliPushButtonSetButtonImageP(void)
-{
- ToolkitTestApplication application;
-
- PushButton button = PushButton::New();
- Stage::GetCurrent().Add( button );
-
- try
- {
- button.SetButtonImage( ImageView::New() );
- DALI_TEST_CHECK( true );
- }
- catch(...)
- {
- DALI_TEST_CHECK( false );
- }
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetBackgroundImageP(void)
-{
- ToolkitTestApplication application;
-
- PushButton button = PushButton::New();
- Stage::GetCurrent().Add( button );
-
- try
- {
- button.SetBackgroundImage( ImageView::New() );
- DALI_TEST_CHECK( true );
- }
- catch(...)
- {
- DALI_TEST_CHECK( false );
- }
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetSelectedImageP(void)
-{
- ToolkitTestApplication application;
-
- PushButton button = PushButton::New();
- Stage::GetCurrent().Add( button );
-
- try
- {
- button.SetSelectedImage( ImageView::New() );
- DALI_TEST_CHECK( true );
- }
- catch(...)
- {
- DALI_TEST_CHECK( false );
- }
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetSelectedBackgroundImageP(void)
-{
- ToolkitTestApplication application;
-
- PushButton button = PushButton::New();
- Stage::GetCurrent().Add( button );
-
- try
- {
- button.SetSelectedBackgroundImage( ImageView::New() );
- DALI_TEST_CHECK( true );
- }
- catch(...)
- {
- DALI_TEST_CHECK( false );
- }
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetDisabledBackgroundImageP(void)
-{
- ToolkitTestApplication application;
-
- PushButton button = PushButton::New();
- Stage::GetCurrent().Add( button );
-
- try
- {
- button.SetDisabledBackgroundImage( ImageView::New() );
- DALI_TEST_CHECK( true );
- }
- catch(...)
- {
- DALI_TEST_CHECK( false );
- }
-
- END_TEST;
-}
-
-
-int UtcDaliPushButtonSetDisabledImageP(void)
-{
- ToolkitTestApplication application;
-
- PushButton button = PushButton::New();
- Stage::GetCurrent().Add( button );
-
- try
- {
- button.SetDisabledImage( ImageView::New() );
- DALI_TEST_CHECK( true );
- }
- catch(...)
- {
- DALI_TEST_CHECK( false );
- }
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetDisabledSelectedImageP(void)
-{
- ToolkitTestApplication application;
-
- PushButton button = PushButton::New();
- Stage::GetCurrent().Add( button );
-
- try
- {
- button.SetDisabledSelectedImage( ImageView::New() );
- DALI_TEST_CHECK( true );
- }
- catch(...)
- {
- DALI_TEST_CHECK( false );
- }
-
- END_TEST;
-}
-
int UtcDaliPushButtonToggleSignalP(void)
{
ToolkitTestApplication application;
PushButton pushButton = PushButton::New();
- pushButton.SetAutoRepeating( true );
+ pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
- DALI_TEST_CHECK( pushButton.IsAutoRepeating() );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::AUTO_REPEATING ), true, TEST_LOCATION );
- pushButton.SetAutoRepeating( false );
+ pushButton.SetProperty( Button::Property::AUTO_REPEATING, false );
- DALI_TEST_CHECK( !pushButton.IsAutoRepeating() );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::AUTO_REPEATING ), false, TEST_LOCATION );
- pushButton.SetAutoRepeating( true );
+ pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
- DALI_TEST_CHECK( pushButton.IsAutoRepeating() );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::AUTO_REPEATING ), true, TEST_LOCATION );
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetTogglableButton( true );
+ pushButton.SetProperty( Button::Property::TOGGLABLE, true );
- DALI_TEST_CHECK( pushButton.IsTogglableButton() );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::TOGGLABLE ), true, TEST_LOCATION );
- pushButton.SetTogglableButton( false );
+ pushButton.SetProperty( Button::Property::TOGGLABLE, false );
- DALI_TEST_CHECK( !pushButton.IsTogglableButton() );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::TOGGLABLE ), false, TEST_LOCATION );
- pushButton.SetTogglableButton( true );
+ pushButton.SetProperty( Button::Property::TOGGLABLE, true );
- DALI_TEST_CHECK( pushButton.IsTogglableButton() );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::TOGGLABLE ), true, TEST_LOCATION );
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetAutoRepeating( true );
- pushButton.SetTogglableButton( true );
+ pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
+ pushButton.SetProperty( Button::Property::TOGGLABLE, true);
- DALI_TEST_CHECK( pushButton.IsTogglableButton() );
- DALI_TEST_CHECK( !pushButton.IsAutoRepeating() );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::TOGGLABLE ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::AUTO_REPEATING ), false, TEST_LOCATION );
+
+ pushButton.SetProperty( Button::Property::TOGGLABLE, true);
+ pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
- pushButton.SetTogglableButton( true );
- pushButton.SetAutoRepeating( true );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::AUTO_REPEATING ), true, TEST_LOCATION );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::TOGGLABLE ), false, TEST_LOCATION );
- DALI_TEST_CHECK( pushButton.IsAutoRepeating() );
- DALI_TEST_CHECK( !pushButton.IsTogglableButton() );
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetTogglableButton( true );
+ pushButton.SetProperty( Button::Property::TOGGLABLE, true);
pushButton.StateChangedSignal().Connect( &PushButtonSelected );
gPushButtonSelectedState = false;
- pushButton.SetSelected( true );
+ pushButton.SetProperty( Button::Property::SELECTED, true );
- DALI_TEST_CHECK( pushButton.IsSelected() );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED), true, TEST_LOCATION );
DALI_TEST_CHECK( gPushButtonSelectedState );
- pushButton.SetSelected( false );
+ pushButton.SetProperty( Button::Property::SELECTED, false );
- DALI_TEST_CHECK( !pushButton.IsSelected() );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED), false, TEST_LOCATION );
DALI_TEST_CHECK( !gPushButtonSelectedState );
- pushButton.SetSelected( true );
+ pushButton.SetProperty( Button::Property::SELECTED, true );
- DALI_TEST_CHECK( pushButton.IsSelected() );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED), true, TEST_LOCATION );
DALI_TEST_CHECK( gPushButtonSelectedState );
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetTogglableButton( false );
+ tet_infoline(" Set Toggle feature off");
+ pushButton.SetProperty( Button::Property::TOGGLABLE, false);
pushButton.StateChangedSignal().Connect( &PushButtonSelected );
gPushButtonSelectedState = false;
- pushButton.SetSelected( true );
+ tet_infoline(" Try to set to selected, expecting failure as not a toggle button");
+ pushButton.SetProperty( Button::Property::SELECTED, true );
- DALI_TEST_CHECK( !pushButton.IsSelected() );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED), false, TEST_LOCATION );
DALI_TEST_CHECK( !gPushButtonSelectedState );
- pushButton.SetSelected( false );
+ pushButton.SetProperty( Button::Property::SELECTED, false );
- DALI_TEST_CHECK( !pushButton.IsSelected() );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED), false, TEST_LOCATION );
DALI_TEST_CHECK( !gPushButtonSelectedState );
- pushButton.SetSelected( true );
+ pushButton.SetProperty( Button::Property::SELECTED, true );
- DALI_TEST_CHECK( !pushButton.IsSelected() );
+ DALI_TEST_EQUALS( pushButton.GetProperty<bool>( Button::Property::SELECTED ), false, TEST_LOCATION );
DALI_TEST_CHECK( !gPushButtonSelectedState );
+
END_TEST;
}
PushButton pushButton = PushButton::New();
- pushButton.SetAutoRepeating( true );
+ pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
+
+ pushButton.SetProperty( Button::Property::INITIAL_AUTO_REPEATING_DELAY, 1.f);
+ DALI_TEST_EQUALS( pushButton.GetProperty<float>( Button::Property::INITIAL_AUTO_REPEATING_DELAY ), 1.f, TEST_LOCATION );
- pushButton.SetInitialAutoRepeatingDelay( 1.f );
- DALI_TEST_EQUALS( pushButton.GetInitialAutoRepeatingDelay(), 1.f, TEST_LOCATION );
+ pushButton.SetProperty( Button::Property::NEXT_AUTO_REPEATING_DELAY, 1.f);
- pushButton.SetNextAutoRepeatingDelay( 1.f );
- DALI_TEST_EQUALS( pushButton.GetNextAutoRepeatingDelay(), 1.f, TEST_LOCATION );
+ DALI_TEST_EQUALS( pushButton.GetProperty<float>( Button::Property::NEXT_AUTO_REPEATING_DELAY ), 1.f, TEST_LOCATION );
END_TEST;
}
bool assert1( false );
bool assert2( false );
- pushButton.SetAutoRepeating( true );
+ pushButton.SetProperty( Button::Property::AUTO_REPEATING, true );
try
{
- pushButton.SetInitialAutoRepeatingDelay( -1.f );
+ pushButton.SetProperty( Button::Property::INITIAL_AUTO_REPEATING_DELAY, -1.f );
}
catch( Dali::DaliException& e )
{
try
{
- pushButton.SetNextAutoRepeatingDelay( -1.f );
+ pushButton.SetProperty( Button::Property::NEXT_AUTO_REPEATING_DELAY, -1.f );
}
catch( Dali::DaliException& e )
{
application.SendNotification();
application.Render();
- pushButton.SetLabelText( STR );
-
- DALI_TEST_EQUALS( pushButton.GetLabelText(), STR, TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetButtonImageDeprecatedP(void)
-{
- ToolkitTestApplication application;
- Image setButtonImage = ResourceImage::New( TEST_IMAGE_ONE);
- PushButton pushButton = PushButton::New();
- pushButton.SetButtonImage( setButtonImage );
- Image retreivedButtonImage = ImageView::DownCast(pushButton.GetButtonImage()).GetImage();
- DALI_TEST_EQUALS( retreivedButtonImage, setButtonImage , TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetSelectedImageDeprecatedP(void)
-{
- ToolkitTestApplication application;
- Image setButtonImage = ResourceImage::New( TEST_IMAGE_ONE);
- PushButton pushButton = PushButton::New();
- pushButton.SetSelectedImage( setButtonImage );
- Image retreivedButtonImage = ImageView::DownCast(pushButton.GetSelectedImage()).GetImage();
- DALI_TEST_EQUALS( retreivedButtonImage, setButtonImage , TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonGetButtonImageURLDeprecatedP(void)
-{
- tet_infoline(" UtcDaliPushButtonGetButtonImageURLDeprecatedP Testing mix use of API");
-
- ToolkitTestApplication application;
-
- PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE );
-
- ImageView retreivedButtonImageView = ImageView::DownCast(pushButton.GetButtonImage());
- Image retreivedButtonImage = retreivedButtonImageView.GetImage();
- ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
-
- DALI_TEST_EQUALS( resourceImage.GetUrl(), TEST_IMAGE_ONE , TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonGetSelectedImageURLDeprecatedP(void)
-{
- tet_infoline(" UtcDaliPushButtonGetSelectedImageURLDeprecatedP Testing mix use of API");
-
- ToolkitTestApplication application;
-
- PushButton pushButton = PushButton::New();
-
- pushButton.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, TEST_IMAGE_ONE );
-
- Image retreivedButtonImage = ImageView::DownCast(pushButton.GetSelectedImage()).GetImage();
- ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
- DALI_TEST_EQUALS( resourceImage.GetUrl(), TEST_IMAGE_ONE , TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetSelectedImageWithActorDeprecatedP(void)
-{
- tet_infoline(" UtcDaliPushButton SetSelectedImage With ImageView (Actor)");
-
- ToolkitTestApplication application;
-
- Image image = ResourceImage::New( TEST_IMAGE_ONE );
-
- DALI_TEST_CHECK( image );
-
- ImageView imgViewSet = ImageView::New(image);
-
- DALI_TEST_CHECK(imgViewSet );
-
- PushButton pushButton = PushButton::New();
-
- DALI_TEST_CHECK( pushButton );
-
- pushButton.SetSelectedImage( imgViewSet );
-
- ImageView imageView = ImageView::DownCast( pushButton.GetSelectedImage());
-
- DALI_TEST_CHECK( imageView );
-
- Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
- Property::Map map;
- value.Get( map );
- DALI_TEST_CHECK( !map.Empty() );
- DALI_TEST_EQUALS( map[ "filename" ].Get<std::string>(), TEST_IMAGE_ONE , TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetButtonImageWithActorDeprecatedP(void)
-{
- tet_infoline(" UtcDaliPushButton SetButtonImage With ImageView (Actor)");
-
- ToolkitTestApplication application;
-
- Image image = ResourceImage::New( TEST_IMAGE_ONE );
-
- DALI_TEST_CHECK( image );
-
- ImageView imgViewSet = ImageView::New(image);
-
- DALI_TEST_CHECK(imgViewSet );
-
- PushButton pushButton = PushButton::New();
-
- DALI_TEST_CHECK( pushButton );
-
- pushButton.SetButtonImage( imgViewSet );
-
- ImageView imageView = ImageView::DownCast( pushButton.GetButtonImage());
-
- DALI_TEST_CHECK( imageView );
-
- Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
- Property::Map map;
- value.Get( map );
- DALI_TEST_CHECK( !map.Empty() );
- DALI_TEST_EQUALS( map[ "filename" ].Get<std::string>(), TEST_IMAGE_ONE , TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetBackgroundImageWithActorDeprecatedP(void)
-{
- tet_infoline(" UtcDaliPushButton SetBackgroundImage With ImageView (Actor)");
-
- ToolkitTestApplication application;
-
- Image image = ResourceImage::New( TEST_IMAGE_ONE );
-
- DALI_TEST_CHECK( image );
-
- ImageView imgViewSet = ImageView::New(image);
-
- DALI_TEST_CHECK(imgViewSet );
-
- PushButton pushButton = PushButton::New();
-
- DALI_TEST_CHECK( pushButton );
-
- pushButton.SetBackgroundImage( imgViewSet );
-
- ImageView imageView = ImageView::DownCast( pushButton.GetButtonImage());
-
- DALI_TEST_CHECK( imageView );
-
- Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
- Property::Map map;
- value.Get( map );
- DALI_TEST_CHECK( !map.Empty() );
- DALI_TEST_EQUALS( map[ "filename" ].Get<std::string>(), TEST_IMAGE_ONE , TEST_LOCATION );
-
- END_TEST;
-}
-
-
-int UtcDaliPushButtonSetSelectedBackgroundImageWithActorDeprecatedP(void)
-{
- tet_infoline(" UtcDaliPushButton SetSelectedBackgroundImage With ImageView (Actor)");
-
- ToolkitTestApplication application;
-
- Image image = ResourceImage::New( TEST_IMAGE_ONE );
-
- DALI_TEST_CHECK( image );
-
- ImageView imgViewSet = ImageView::New(image);
-
- DALI_TEST_CHECK(imgViewSet );
-
- PushButton pushButton = PushButton::New();
-
- DALI_TEST_CHECK( pushButton );
-
- pushButton.SetSelectedBackgroundImage( imgViewSet );
-
- ImageView imageView = ImageView::DownCast( pushButton.GetSelectedImage());
-
- DALI_TEST_CHECK( imageView );
-
- Property::Value value = imageView.GetProperty( imageView.GetPropertyIndex( "image" ) );
- Property::Map map;
- value.Get( map );
- DALI_TEST_CHECK( !map.Empty() );
- DALI_TEST_EQUALS( map[ "filename" ].Get<std::string>(), TEST_IMAGE_ONE , TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetDisabledBackgroundImageWithActorDeprecatedP(void)
-{
- tet_infoline(" UtcDaliPushButton SetDisabledBackgroundImage With ImageView (Actor)");
-
- ToolkitTestApplication application;
-
- Image image = ResourceImage::New( TEST_IMAGE_ONE );
-
- DALI_TEST_CHECK( image );
-
- ImageView imgViewSet = ImageView::New(image);
-
- DALI_TEST_CHECK(imgViewSet );
-
- PushButton pushButton = PushButton::New();
-
- DALI_TEST_CHECK( pushButton );
-
- pushButton.SetDisabledBackgroundImage( imgViewSet );
-
- Property::Value value = pushButton.GetProperty( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL );
- Property::Map map;
- value.Get( map );
-
- Property::Value* urlValue = map.Find( ImageVisual::Property::URL );
-
- std::string urlString;
- urlValue->Get( urlString );
- DALI_TEST_EQUALS( urlString , TEST_IMAGE_ONE , TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetDisabledImageWithActorDeprecatedP(void)
-{
- tet_infoline(" UtcDaliPushButton SetDisabledImage With ImageView (Actor)");
-
- ToolkitTestApplication application;
-
- Image image = ResourceImage::New( TEST_IMAGE_ONE );
-
- DALI_TEST_CHECK( image );
-
- ImageView imgViewSet = ImageView::New(image);
-
- DALI_TEST_CHECK(imgViewSet );
-
- PushButton pushButton = PushButton::New();
-
- DALI_TEST_CHECK( pushButton );
-
- pushButton.SetDisabledImage( imgViewSet );
-
- Property::Value value = pushButton.GetProperty( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL );
-
- Property::Map map;
- value.Get( map );
-
- Property::Value* urlValue = map.Find( ImageVisual::Property::URL );
-
- std::string urlString;
- urlValue->Get( urlString );
- DALI_TEST_EQUALS( urlString , TEST_IMAGE_ONE , TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonSetDisabledSelectedImageWithActorDeprecatedP(void)
-{
- tet_infoline(" UtcDaliPushButton SetDisabledSelectedImage With ImageView (Actor)");
-
- ToolkitTestApplication application;
-
- Image image = ResourceImage::New( TEST_IMAGE_ONE );
-
- DALI_TEST_CHECK( image );
-
- ImageView imgViewSet = ImageView::New(image);
-
- DALI_TEST_CHECK(imgViewSet );
-
- PushButton pushButton = PushButton::New();
-
- DALI_TEST_CHECK( pushButton );
-
- pushButton.SetDisabledSelectedImage( imgViewSet );
-
- Property::Value value = pushButton.GetProperty( Toolkit::DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL );
-
- Property::Map map;
- value.Get( map );
-
- Property::Value* urlValue = map.Find( ImageVisual::Property::URL );
-
- std::string urlString;
- urlValue->Get( urlString );
- DALI_TEST_EQUALS( urlString , TEST_IMAGE_ONE , TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliPushButtonReplaceButtonImageP2(void)
-{
- tet_infoline("Set button image then replace with new image and query url");
-
- ToolkitTestApplication application;
-
- ResourceImage setImage = ResourceImage::New( TEST_IMAGE_ONE );
- DALI_TEST_CHECK(setImage);
-
- Actor imgActorSet = ImageView::New(setImage);
- DALI_TEST_CHECK(imgActorSet);
-
- PushButton pushButton = PushButton::New();
- pushButton.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, TEST_IMAGE_TWO );
-
-
- Stage::GetCurrent().Add( pushButton );
-
- pushButton.SetButtonImage( imgActorSet );
- application.SendNotification();
- application.Render();
-
- tet_infoline("Get button image before it has been able to load");
-
- ImageView imageView = ImageView::DownCast(pushButton.GetButtonImage());
+ pushButton.SetProperty( Button::Property::LABEL, STR );
- ResourceImage getImage = ResourceImage::DownCast( imageView.GetImage() );
-
- tet_infoline("Check if url matches last assignment even if not loaded yet");
- DALI_TEST_EQUALS( getImage.GetUrl(), setImage.GetUrl() , TEST_LOCATION );
+ DALI_TEST_EQUALS(GetButtonText( pushButton ), STR, TEST_LOCATION);
END_TEST;
-}
+}
\ No newline at end of file
}
END_TEST;
-}
-
-
-// Deprecated API Tests
-
-int UtcDaliRadioButtonLabelActor(void)
-{
- ToolkitTestApplication application;
-
- std::string labelText = "test actor 1";
-
- RadioButton radioButton = RadioButton::New();
-
- radioButton.SetProperty( Toolkit::Button::Property::LABEL,
- Property::Map().Add( Toolkit::Visual::Property::TYPE, Toolkit::Visual::TEXT )
- .Add( Toolkit::TextVisual::Property::POINT_SIZE, 15.0f )
- );
-
- radioButton.SetLabelText( labelText );
-
- DALI_TEST_EQUALS( radioButton.GetLabelText(), labelText, TEST_LOCATION );
-
- std::string labelText2 = "test actor 2";
- radioButton.SetLabelText( labelText2 );
- DALI_TEST_EQUALS( radioButton.GetLabelText(), labelText2, TEST_LOCATION );
-
- END_TEST;
-}
-
-int UtcDaliRadioButtonSelected(void)
-{
- ToolkitTestApplication application;
-
- RadioButton radioButton = RadioButton::New();
-
- // Default selected
- DALI_TEST_CHECK( radioButton.IsSelected() == false );
-
- // False
- radioButton.SetSelected( false );
- DALI_TEST_CHECK( radioButton.IsSelected() == false );
-
- // True
- radioButton.SetSelected( true );
- DALI_TEST_CHECK( radioButton.IsSelected() == true );
-
- // False
- radioButton.SetSelected( false );
- DALI_TEST_CHECK( radioButton.IsSelected() == false );
-
- END_TEST;
-}
-
+}
\ No newline at end of file
namespace DevelButton
{
-/**
- *
- * @section ButtonProperties Properties
- * |%Property enum |String name |Type |Writable|Animatable|
- * |-------------------------------------------------------|----------------------------------------|--------------|--------|----------|
- * | Property::DISABLED | disabled | BOOLEAN | Y | N |
- * | Property::AUTO_REPEATING | autoRepeating | BOOLEAN | Y | N |
- * | Property::INITIAL_AUTO_REPEATING_DELAY | initialAutoRepeatingDelay | FLOAT | Y | N |
- * | Property::NEXT_AUTO_REPEATING_DELAY | nextAutoRepeatingDelay | FLOAT | Y | N |
- * | Property::TOGGLABLE | togglable | BOOLEAN | Y | N |
- * | Property::SELECTED | selected | BOOLEAN | Y | N |
- * | Property::LABEL | label | MAP | Y | N |
- * | Property::UNSELECTED_STATE_VISUAL | unselectedVisual | MAP | Y | N |
- * | Property::SELECTED_VISUAL | selectedVisual | MAP | Y | N |
- * | Property::DISABLED_SELECTED_VISUAL | disabledSelectedVisual | MAP | Y | N |
- * | Property::DISABLED_UNSELECTED_VISUAL | disabledUnselectedVisual | MAP | Y | N |
- * | Property::UNSELECTED_BACKGROUND_VISUAL | unselectedBackgroundVisual | MAP | Y | N |
- * | Property::SELECTED_BACKGROUND_VISUAL | selectedBackgroundVisual | MAP | Y | N |
- * | Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL | disabledUnselectedBackgroundVisual | MAP | Y | N |
- * | Property::DISABLED_SELECTED_BACKGROUND_VISUAL | disabledSelectedBackgroundVisual | MAP | Y | N |
- * | Property::LABEL_RELATIVE_ALIGNMENT | labelRelativeAlignment | STRING | Y | N |
- * -------------------------------------------------------------------------------------------------------------------------------------
- *
- *
- */
-
namespace Property
{
enum Type
{
- DISABLED = Dali::Toolkit::Button::Property::DISABLED,
- AUTO_REPEATING = Dali::Toolkit::Button::Property::AUTO_REPEATING,
- INITIAL_AUTO_REPEATING_DELAY = Dali::Toolkit::Button::Property::INITIAL_AUTO_REPEATING_DELAY,
- NEXT_AUTO_REPEATING_DELAY = Dali::Toolkit::Button::Property:: NEXT_AUTO_REPEATING_DELAY,
- TOGGLABLE = Dali::Toolkit::Button::Property::TOGGLABLE,
- SELECTED = Dali::Toolkit::Button::Property::SELECTED,
- UNSELECTED_STATE_IMAGE = Dali::Toolkit::Button::Property::UNSELECTED_STATE_IMAGE,
- SELECTED_STATE_IMAGE = Dali::Toolkit::Button::Property::SELECTED_STATE_IMAGE,
- DISABLED_STATE_IMAGE = Dali::Toolkit::Button::Property::DISABLED_STATE_IMAGE,
- UNSELECTED_COLOR = Dali::Toolkit::Button::Property::UNSELECTED_COLOR,
- SELECTED_COLOR = Dali::Toolkit::Button::Property::SELECTED_COLOR,
- LABEL = Dali::Toolkit::Button::Property::LABEL,
- LABEL_TEXT = Dali::Toolkit::Button::Property::LABEL_TEXT,
-
- /**
- * @brief name "unselectedVisual", type string if it is a url, map otherwise
- * @details Sets the unselected button foreground/icon visual
- */
- UNSELECTED_VISUAL = LABEL_TEXT + 1,
-
- /**
- * @brief name "selectedImage", type string if it is a url, map otherwise
- * @details Sets the selected button foreground/icon visual
- * @SINCE_1_2.18
- */
- SELECTED_VISUAL,
-
- /**
- * @brief name "disabledSelectedVisual", type string if it is a url, map otherwise
- * @details Sets the disabled selected state foreground/icon button visual
- */
- DISABLED_SELECTED_VISUAL,
-
- /**
- * @brief name "disabledUnSelectedVisual", type string if it is a url, map otherwise
- * @details Sets the disabled unselected state foreground/icon visual
- */
- DISABLED_UNSELECTED_VISUAL,
-
- /**
- * @brief name "unselectedBackgroundVisual", type string if it is a url, map otherwise
- * @details Sets the disabled in the unselected state background, button visual
- */
- UNSELECTED_BACKGROUND_VISUAL,
-
- /**
- * @brief name "selectedBackgroundVisual", type string if it is a url, map otherwise
- * @details Sets the selected background button visual
- */
- SELECTED_BACKGROUND_VISUAL,
-
- /**
- * @brief name "disabledUnselectedBackgroundVisual", type string if it is a url, map otherwise
- * @details Sets the disabled while unselected background button visual
- */
- DISABLED_UNSELECTED_BACKGROUND_VISUAL,
-
- /**
- * @brief name "disabledSelectedBackgroundVisual", type string if it is a url, map otherwise
- * @details Sets the disabled while selected background button visual
- */
- DISABLED_SELECTED_BACKGROUND_VISUAL,
-
/**
* @brief name "labelRelativeAlignment", type STRING
* @details Sets the position of the the label in relation to the foreground/icon if both present
*/
- LABEL_RELATIVE_ALIGNMENT,
+ LABEL_RELATIVE_ALIGNMENT = Dali::Toolkit::Button::Property::DISABLED_SELECTED_BACKGROUND_VISUAL + 1,
/**
* @brief name "labelPadding", type Vector4
enum
{
- STYLE_NAME = Control::Property::STYLE_NAME,
- BACKGROUND_COLOR = Control::Property::BACKGROUND_COLOR,
- BACKGROUND_IMAGE = Control::Property::BACKGROUND_IMAGE,
- KEY_INPUT_FOCUS = Control::Property::KEY_INPUT_FOCUS,
- BACKGROUND = Control::Property::BACKGROUND,
- MARGIN = Control::Property::MARGIN,
- PADDING = Control::Property::PADDING,
+ STYLE_NAME = Control::Property::STYLE_NAME,
+ RESERVED_PROPERTY_01 = Control::Property::RESERVED_PROPERTY_01,
+ RESERVED_PROPERTY_02 = Control::Property::RESERVED_PROPERTY_02,
+ KEY_INPUT_FOCUS = Control::Property::KEY_INPUT_FOCUS,
+ BACKGROUND = Control::Property::BACKGROUND,
+ MARGIN = Control::Property::MARGIN,
+ PADDING = Control::Property::PADDING,
/**
* @brief Displays a tooltip when the control is hovered over.
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
DALI_PROPERTY_REGISTRATION( Toolkit, Button, "nextAutoRepeatingDelay", FLOAT, NEXT_AUTO_REPEATING_DELAY )
DALI_PROPERTY_REGISTRATION( Toolkit, Button, "togglable", BOOLEAN, TOGGLABLE )
DALI_PROPERTY_REGISTRATION( Toolkit, Button, "selected", BOOLEAN, SELECTED )
-DALI_PROPERTY_REGISTRATION( Toolkit, Button, "unselectedStateImage", MAP, UNSELECTED_STATE_IMAGE ) // Deprecated property
-DALI_PROPERTY_REGISTRATION( Toolkit, Button, "selectedStateImage", MAP, SELECTED_STATE_IMAGE ) // Deprecated property
-DALI_PROPERTY_REGISTRATION( Toolkit, Button, "disabledStateImage", MAP, DISABLED_STATE_IMAGE ) // Deprecated property
-DALI_PROPERTY_REGISTRATION( Toolkit, Button, "unselectedColor", VECTOR4, UNSELECTED_COLOR ) // Deprecated property
-DALI_PROPERTY_REGISTRATION( Toolkit, Button, "selectedColor", VECTOR4, SELECTED_COLOR ) // Deprecated property
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "unselectedVisual", MAP, UNSELECTED_VISUAL )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "selectedVisual", MAP, SELECTED_VISUAL )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "disabledSelectedVisual", MAP, DISABLED_SELECTED_VISUAL )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "disabledUnselectedVisual", MAP, DISABLED_UNSELECTED_VISUAL )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "unselectedBackgroundVisual", MAP, UNSELECTED_BACKGROUND_VISUAL )
DALI_PROPERTY_REGISTRATION( Toolkit, Button, "label", MAP, LABEL )
-DALI_PROPERTY_REGISTRATION( Toolkit, Button, "labelText", STRING, LABEL_TEXT ) // Deprecated property
-DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "unselectedVisual", MAP, UNSELECTED_VISUAL )
-DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "selectedVisual", MAP, SELECTED_VISUAL )
-DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "disabledSelectedVisual", MAP, DISABLED_SELECTED_VISUAL )
-DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "disabledUnselectedVisual", MAP, DISABLED_UNSELECTED_VISUAL )
-DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "unselectedBackgroundVisual", MAP, UNSELECTED_BACKGROUND_VISUAL )
-DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "selectedBackgroundVisual", MAP, SELECTED_BACKGROUND_VISUAL )
-DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "disabledUnselectedBackgroundVisual", MAP, DISABLED_UNSELECTED_BACKGROUND_VISUAL )
-DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "disabledSelectedBackgroundVisual", MAP, DISABLED_SELECTED_BACKGROUND_VISUAL )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "selectedBackgroundVisual", MAP, SELECTED_BACKGROUND_VISUAL )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "disabledUnselectedBackgroundVisual", MAP, DISABLED_UNSELECTED_BACKGROUND_VISUAL )
+DALI_PROPERTY_REGISTRATION( Toolkit, Button, "disabledSelectedBackgroundVisual", MAP, DISABLED_SELECTED_BACKGROUND_VISUAL )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "labelRelativeAlignment", STRING, LABEL_RELATIVE_ALIGNMENT )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "labelPadding", VECTOR4, LABEL_PADDING )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, Button, "visualPadding", VECTOR4, VISUAL_PADDING )
const Property::Index VISUAL_INDEX_FOR_STATE[][Button::STATE_COUNT] =
{
- { Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, Toolkit::DevelButton::Property::UNSELECTED_VISUAL },
- { Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, Toolkit::DevelButton::Property::SELECTED_VISUAL },
- { Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL },
- { Toolkit::DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL, Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL }
+ { Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, Toolkit::Button::Property::UNSELECTED_VISUAL },
+ { Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, Toolkit::Button::Property::SELECTED_VISUAL },
+ { Toolkit::Button::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL },
+ { Toolkit::Button::Property::DISABLED_SELECTED_BACKGROUND_VISUAL, Toolkit::Button::Property::DISABLED_SELECTED_VISUAL }
};
/**
}
}
-bool Button::IsAutoRepeating() const
-{
- return mAutoRepeating;
-}
-
void Button::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
{
DALI_ASSERT_DEBUG( initialAutoRepeatingDelay > 0.f );
mInitialAutoRepeatingDelay = initialAutoRepeatingDelay;
}
-float Button::GetInitialAutoRepeatingDelay() const
-{
- return mInitialAutoRepeatingDelay;
-}
-
void Button::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay )
{
DALI_ASSERT_DEBUG( nextAutoRepeatingDelay > 0.f );
mNextAutoRepeatingDelay = nextAutoRepeatingDelay;
}
-float Button::GetNextAutoRepeatingDelay() const
-{
- return mNextAutoRepeatingDelay;
-}
-
void Button::SetTogglableButton( bool togglable )
{
mTogglableButton = togglable;
}
}
-bool Button::IsTogglableButton() const
-{
- return mTogglableButton;
-}
-
void Button::SetSelected( bool selected )
{
if( mTogglableButton )
return mTogglableButton && selected;
}
-void Button::SetLabelText( const std::string& label )
-{
- Self().SetProperty( Toolkit::Button::Property::LABEL, label );
-}
-
-std::string Button::GetLabelText() const
-{
- Property::Value value = Self().GetProperty( Toolkit::Button::Property::LABEL );
-
- Property::Map *labelProperty = value.GetMap();
-
- std::string textLabel;
-
- if ( labelProperty )
- {
- Property::Value* value = labelProperty->Find( Toolkit::TextVisual::Property::TEXT );
- if( value )
- {
- value->Get( textLabel );
- }
- }
-
- return textLabel;
-}
-
void Button::MergeWithExistingLabelProperties( const Property::Map& inMap, Property::Map& outMap )
{
DALI_LOG_INFO( gLogButtonFilter, Debug::Verbose, "MergeLabelProperties with %d properties\n", inMap.Count() );
break;
}
- case Toolkit::Button::Property::UNSELECTED_STATE_IMAGE: // Legacy Tizen 3.0
- {
- GetImplementation( button ).CreateVisualsForComponent( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, value, DepthIndex::BACKGROUND );
- break;
- }
- case Toolkit::Button::Property::DISABLED_STATE_IMAGE: // Legacy Tizen 3.0
- {
- GetImplementation( button ).CreateVisualsForComponent( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, value, DepthIndex::BACKGROUND );
- break;
- }
- case Toolkit::Button::Property::SELECTED_STATE_IMAGE: // Legacy Tizen 3.0
- {
- GetImplementation( button ).CreateVisualsForComponent( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, value, DepthIndex::BACKGROUND );
- break;
- }
- case Toolkit::DevelButton::Property::UNSELECTED_VISUAL:
- case Toolkit::DevelButton::Property::SELECTED_VISUAL:
- case Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL:
- case Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL:
+ case Toolkit::Button::Property::UNSELECTED_VISUAL:
+ case Toolkit::Button::Property::SELECTED_VISUAL:
+ case Toolkit::Button::Property::DISABLED_SELECTED_VISUAL:
+ case Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL:
{
GetImplementation( button ).CreateVisualsForComponent( index, value, DepthIndex::CONTENT );
break;
}
- case Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL:
- case Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL:
- case Toolkit::DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL:
- case Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL:
+ case Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL:
+ case Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL:
+ case Toolkit::Button::Property::DISABLED_SELECTED_BACKGROUND_VISUAL:
+ case Toolkit::Button::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL:
{
GetImplementation( button ).CreateVisualsForComponent( index , value, DepthIndex::BACKGROUND);
break;
}
- case Toolkit::Button::Property::UNSELECTED_COLOR:
- {
- DALI_LOG_WARNING("[%s] Using deprecated Property Button::Property::UNSELECTED_COLOR instead use Button::Property::UNSELECTED_BACKGROUND_VISUAL\n", __FUNCTION__);
- GetImplementation( button ).SetColor( value.Get< Vector4 >(), Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL );
- break;
- }
-
- case Toolkit::Button::Property::SELECTED_COLOR:
- {
- DALI_LOG_WARNING("[%s] Using deprecated Property Button::Property::SELECTED_COLOR instead use Button::Property::SELECTED_BACKGROUND_VISUAL\n", __FUNCTION__);
- GetImplementation( button ).SetColor( value.Get< Vector4 >(), Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL );
- break;
- }
-
- case Toolkit::Button::Property::LABEL_TEXT:
- {
- DALI_LOG_WARNING("[%s] Using deprecated Property Button::Property::LABEL_TEXT instead use Button::Property::LABEL\n", __FUNCTION__);
- GetImplementation( button ).SetLabelText(value.Get< std::string >() );
- break;
- }
-
case Toolkit::Button::Property::LABEL:
{
Property::Map outTextVisualProperties;
break;
}
- case Toolkit::Button::Property::UNSELECTED_STATE_IMAGE:
- {
- value = GetImplementation( button ).GetUrlForImageVisual( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL );
- break;
- }
-
- case Toolkit::Button::Property::SELECTED_STATE_IMAGE:
- {
- value = GetImplementation( button ).GetUrlForImageVisual( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL );
- break;
- }
-
- case Toolkit::Button::Property::DISABLED_STATE_IMAGE:
- {
- value = GetImplementation( button ).GetUrlForImageVisual( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL );
- break;
- }
-
- case Toolkit::DevelButton::Property::UNSELECTED_VISUAL:
- case Toolkit::DevelButton::Property::SELECTED_VISUAL:
- case Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL:
- case Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL:
- case Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL:
- case Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL:
- case Toolkit::DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL:
- case Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL:
+ case Toolkit::Button::Property::UNSELECTED_VISUAL:
+ case Toolkit::Button::Property::SELECTED_VISUAL:
+ case Toolkit::Button::Property::DISABLED_SELECTED_VISUAL:
+ case Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL:
+ case Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL:
+ case Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL:
+ case Toolkit::Button::Property::DISABLED_SELECTED_BACKGROUND_VISUAL:
+ case Toolkit::Button::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL:
case Toolkit::Button::Property::LABEL:
{
Property::Map visualProperty;
break;
}
- case Toolkit::Button::Property::UNSELECTED_COLOR:
- {
- value = GetImplementation( button ).GetUnselectedColor();
- break;
- }
-
- case Toolkit::Button::Property::SELECTED_COLOR:
- {
- value = GetImplementation( button ).GetSelectedColor();
- break;
- }
-
- case Toolkit::Button::Property::LABEL_TEXT:
- {
- value = GetImplementation( button ).GetLabelText();
- break;
- }
-
case Toolkit::DevelButton::Property::LABEL_RELATIVE_ALIGNMENT:
{
const char* alignment = Scripting::GetEnumerationName< Button::Align >( GetImplementation( button ).GetLabelAlignment(),
return mForegroundPadding;
}
-////////////////////////////////////////////////////////////////////////
-// Legacy functions from Tizen 2.4 and 3.0
-
-// Legacy code needed whilst Color can be set by direct Property setting ( deprecated ) instead of setting a Visual
-void Button::SetColor( const Vector4& color, Property::Index visualIndex )
-{
- if ( visualIndex == Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL )
- {
- mSelectedColor = color;
- }
- else
- {
- mUnselectedColor = color;
- }
-
- Property::Map map;
- map[ Toolkit::Visual::Property::TYPE ] = Toolkit::Visual::COLOR;
- map[ Toolkit::ColorVisual::Property::MIX_COLOR ] = color;
-
- CreateVisualsForComponent( visualIndex, map, DepthIndex::BACKGROUND );
-}
-
-const Vector4 Button::GetUnselectedColor() const
-{
- return mUnselectedColor;
-}
-
-const Vector4 Button::GetSelectedColor() const
-{
- return mSelectedColor;
-}
-
-void Button::SetAnimationTime( float animationTime )
-{
- // Used by deprecated API
- mAnimationTime = animationTime;
-}
-
-float Button::GetAnimationTime() const
-{
- // Used by deprecated API
- return mAnimationTime;
-}
-
-void Button::SetLabel( Actor label )
-{
- if ( label )
- {
- Property::Value value ="";
- value = label.GetProperty(Toolkit::TextLabel::Property::TEXT);
-
- SetLabelText( value.Get<std::string>() );
- }
-}
-
-void Button::SetUnselectedImage( const std::string& filename )
-{
- SetBackgroundImage( filename );
-}
-
-void Button::SetBackgroundImage( const std::string& filename )
-{
- if( !filename.empty() )
- {
- CreateVisualsForComponent( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, filename, DepthIndex::BACKGROUND );
- }
- else
- {
- DevelControl::UnregisterVisual( *this, Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL );
- }
-}
-
-void Button::SetSelectedImage( const std::string& filename )
-{
- SetSelectedBackgroundImage( filename );
-}
-
-void Button::SetSelectedBackgroundImage( const std::string& filename )
-{
- if( !filename.empty() )
- {
- CreateVisualsForComponent( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, filename, DepthIndex::BACKGROUND );
- }
- else
- {
- DevelControl::UnregisterVisual( *this, Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL );
- }
-}
-
-void Button::SetDisabledBackgroundImage( const std::string& filename )
-{
- if( !filename.empty() )
- {
- CreateVisualsForComponent( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, filename, DepthIndex::BACKGROUND );
- }
-}
-
-void Button::SetDisabledImage( const std::string& filename )
-{
- if( !filename.empty() )
- {
- CreateVisualsForComponent( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL, filename, DepthIndex::CONTENT );
- }
-}
-
-void Button::SetDisabledSelectedImage( const std::string& filename )
-{
- if( !filename.empty() )
- {
- CreateVisualsForComponent( Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL, filename, DepthIndex::CONTENT );
- }
-}
-
-// Used by Deprecated Properties which don't use the Visual Property maps for setting and getting
-std::string Button::GetUrlForImageVisual( const Property::Index index ) const
-{
- Toolkit::Visual::Base visual = DevelControl::GetVisual( *this, index );
- std::string result;
-
- if ( visual )
- {
- Dali::Property::Map retreivedMap;
- visual.CreatePropertyMap( retreivedMap );
- Property::Value* value = retreivedMap.Find( Toolkit::ImageVisual::Property::URL, Property::STRING );
- if ( value )
- {
- result = value->Get<std::string>();
- }
- }
-
- return result;
-}
-
-// Below functions DEPRECATED_1_0.50 - Return empty Actors
-
-namespace
-{
-std::string GetUrlFromImage( Image& image )
-{
- ResourceImage resourceImage = ResourceImage::DownCast( image );
-
- std::string imageUrl;
-
- if ( resourceImage )
- {
- imageUrl = resourceImage.GetUrl();
- }
- return imageUrl;
-}
-
-} // namespace
-
-
-void Button::SetButtonImage( Image image )
-{
- DALI_LOG_WARNING("Button::SetButtonImage @DEPRECATED_1_0.50\n");
- SetUnselectedImage( GetUrlFromImage( image ) );
- mSetButtonImage = image;
-}
-
-void Button::SetSelectedImage( Image image )
-{
- DALI_LOG_WARNING("Button::SetSelectedImage @DEPRECATED_1_0.50\n");
- SetSelectedImage( GetUrlFromImage( image ) );
- mSetSelectedImage = image;
-}
-
-Actor Button::GetButtonImage() const
-{
- // When deprecated ImageView API removed then this button API can be removed too.
- DALI_LOG_WARNING("Button::GetButtonImage @DEPRECATED_1_0.50\n");
-
- Actor imageView;
-
- if ( mSetButtonImage )
- {
- imageView = Toolkit::ImageView::New( mSetButtonImage );
- }
- else
- {
- ResourceImage image = ResourceImage::New( GetUrlForImageVisual( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL ) );
- imageView = Toolkit::ImageView::New( image );
- }
-
- return imageView;
-}
-
-Actor Button::GetSelectedImage() const
-{
- // When deprecated ImageView API removed then this button API can be removed too.
- DALI_LOG_WARNING("Button::GetSelectedImage @DEPRECATED_1_0.50\n");
-
- Actor imageView;
-
- if ( mSetSelectedImage )
- {
- imageView = Toolkit::ImageView::New( mSetSelectedImage );
- }
- else
- {
- ResourceImage image = ResourceImage::New( GetUrlForImageVisual( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL ) );
- imageView = Toolkit::ImageView::New( image );
- }
- return imageView;
-}
-
} // namespace Internal
} // namespace Toolkit
#define DALI_TOOLKIT_INTERNAL_BUTTON_H
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
public:
/**
- * @copydoc Dali::Toolkit::Button::SetDisabled
+ * @brief Sets the button as \e disabled.
+ * @param[in] disabled Disabled property
*/
void SetDisabled( bool disabled );
/**
- * @copydoc Dali::Toolkit::Button::IsDisabled
+ * @brief Returns if the button is disabled.
+ * @return \e true if the button is \e disabled
*/
bool IsDisabled() const;
/**
- * @copydoc Dali::Toolkit::Button::SetAutoRepeating
+ * @brief Sets the \e autorepeating property.
+ * @param[in] autoRepeating \e autorepeating property
*/
void SetAutoRepeating( bool autoRepeating );
/**
- * @copydoc Dali::Toolkit::Button::IsAutoRepeating
- */
- bool IsAutoRepeating() const;
-
- /**
- * @copydoc Dali::Toolkit::Button::SetInitialAutoRepeatingDelay
+ * @brief Sets the initial autorepeating delay.
+ * @param[in] initialAutoRepeatingDelay in seconds
*/
void SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay );
/**
- * @copydoc Dali::Toolkit::Button::GetInitialAutoRepeatingDelay
- */
- float GetInitialAutoRepeatingDelay() const;
-
- /**
- * @copydoc Dali::Toolkit::Button::SetNextAutoRepeatingDelay
+ * @brief Sets the next autorepeating delay.
+ * @param[in] nextAutoRepeatingDelay in seconds
*/
void SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay );
/**
- * @copydoc Dali::Toolkit::Button::GetNextAutoRepeatingDelay
- */
- float GetNextAutoRepeatingDelay() const;
-
- /**
- * @copydoc Dali::Toolkit::Button::SetTogglableButton
+ * @brief Sets the \e togglable property.
+ * @param[in] togglable Togglable property
*/
void SetTogglableButton( bool togglable );
/**
- * @copydoc Dali::Toolkit::Button::IsTogglableButton
- */
- bool IsTogglableButton() const;
-
- /**
- * @copydoc Dali::Toolkit::Button::SetSelected
+ * @brief Sets the button as selected or unselected.
+ * @param[in] selected Selected property
*/
void SetSelected( bool selected );
/**
- * @copydoc Dali::Toolkit::Button::IsSelected
+ * @brief Returns if the selected property is set and the button is togglable.
+ * @return \e true if the button is \e selected
*/
bool IsSelected() const;
/**
- * @copydoc Dali::Toolkit::Button::SetAnimationTime
- */
- void SetAnimationTime( float animationTime );
-
- /**
- * @copydoc Dali::Toolkit::Button::GetAnimationTime
- */
- float GetAnimationTime() const;
-
- /**
- * @copydoc Dali::Toolkit::Button::SetLabelText
- */
- void SetLabelText( const std::string& label );
-
- /**
- * @copydoc Dali::Toolkit::Button::GetLabelText
- */
- std::string GetLabelText() const;
-
- /**
* @brief Produces a Property::Map of Text properties to create a Text Visual, merging existing properties with supplied map
* If the label does not exist yet, it is created.
* The derived buttons are notified if any properties are changed.
*/
static bool DoAction( BaseObject* object, const std::string& actionName, const Property::Map& attributes );
-public: // Deprecated API
-
- /**
- * @copydoc Dali::Toolkit::Button::SetLabel( Actor label )
- */
- void SetLabel( Actor label );
-
- /**
- * @deprecated Sets the unselected image with an url.
- * @param[in] image The Actor to use.
- */
- void SetUnselectedImage( const std::string& filename );
-
- /**
- * @deprecated Sets the selected image with an url.
- * @param[in] filename The url of the image to use to use.
- */
- void SetSelectedImage( const std::string& filename );
-
- /**
- * @deprecated Sets the selected background image with an url.
- * @param[in] filename The url of the image to use to use.
- */
- void SetSelectedBackgroundImage( const std::string& filename );
-
- /**
- * @deprecated Sets the background image with an url.
- * @param[in] filename The url of the image to use to use.
- */
- void SetBackgroundImage( const std::string& filename );
-
- /**
- * @deprecated Sets the disabled unselected background image with an url.
- * @param[in] filename The url of the image to use to use.
- */
- void SetDisabledBackgroundImage( const std::string& filename );
-
- /**
- * @deprecated Sets the disabled unselected image with an url.
- * @param[in] filename The url of the image to use to use.
- */
- void SetDisabledImage( const std::string& filename );
-
- /**
- * @deprecated Sets the disabled selected image with an url.
- * @param[in] filename The url of the image to use to use.
- */
- void SetDisabledSelectedImage( const std::string& filename );
-
- /**
- * @deprecated Sets the unselected image with an Actor.
- * @param[in] image The Image to use.
- */
- void SetButtonImage( Image image );
-
- /**
- * @deprecated Sets the selected image with an Actor.
- * @param[in] image The Image to use.
- */
- void SetSelectedImage( Image image );
-
- /**
- * @Gets url of a image visual, used by GetProperty but for deprecated Properties
- * @param[in] index Visual index of url required
- * @return filename for the corresponding visual
- */
- std::string GetUrlForImageVisual( const Property::Index index ) const;
-
- /**
- * @copydoc Dali::Toolkit::Button::GetButtonImage
- */
- Actor GetButtonImage() const;
-
- /**
- * @copydoc Dali::Toolkit::Button::GetSelectedImage
- */
- Actor GetSelectedImage() const;
-
public:
/**
void ChangeState( State requestedState );
/**
- * @brief Get unselected button color
- * @return color as vector4
- */
- const Vector4 GetUnselectedColor() const;
-
- /**
- * @brief Get selected button color
- * @return color as vector4
- */
- const Vector4 GetSelectedColor() const;
-
- /**
- * Sets the color of button in selected or unselected state, if image also supplied this color will be appplied to it.
- * If no visual exists, it is created.
- * @param[in] color The color to use.
- * @param[in] visualIndex The Visual to apply the color
- */
- void SetColor( const Vector4& color, Property::Index visualIndex );
-
- /**
* This method is called when the button is released.
*/
void Released();
TapGestureDetector mTapDetector;
- Vector4 mUnselectedColor;
- Vector4 mSelectedColor;
-
bool mAutoRepeating; ///< Stores the autorepeating property.
bool mTogglableButton; ///< Stores the togglable property as a flag.
bool mTextStringSetFlag; ///< Stores if text has been set. Required in relayout but don't want to calculate there.
// Actions
bool mClickActionPerforming; ///< Used to manage signal emissions during action
-
- // Deprecated API support
- Image mSetButtonImage; ///< Store set image if deprecated SetButtonImage used.
- Image mSetSelectedImage; ///< Store set image if deprecated SetSelectedImage used.
-
};
} // namespace Internal
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
#include <dali-toolkit/public-api/controls/text-controls/text-label.h>
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
#if defined(DEBUG_ENABLED)
extern Debug::Filter* gLogButtonFilter;
{
case Toolkit::PushButton::Property::UNSELECTED_ICON:
{
- pushButtonImpl.CreateVisualsForComponent( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, value, DepthIndex::CONTENT );
+ pushButtonImpl.CreateVisualsForComponent( Toolkit::Button::Property::UNSELECTED_VISUAL, value, DepthIndex::CONTENT );
break;
}
case Toolkit::PushButton::Property::SELECTED_ICON:
{
- pushButtonImpl.CreateVisualsForComponent( Toolkit::DevelButton::Property::SELECTED_VISUAL, value, DepthIndex::CONTENT );
+ pushButtonImpl.CreateVisualsForComponent( Toolkit::Button::Property::SELECTED_VISUAL, value, DepthIndex::CONTENT );
break;
}
case Toolkit::PushButton::Property::ICON_ALIGNMENT:
return value;
}
-// Deprecated API using Actor to set images
-
-void PushButton::SetButtonImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetButtonImage() is deprecated and will be removed from next release. Use Button.SetProperty UNSELECTED_STATE_IMAGE or Styling file instead.\n" );
-
- Image retreivedButtonImage = Toolkit::ImageView::DownCast( image ).GetImage();
- if ( retreivedButtonImage )
- {
- ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
-
- if ( resourceImage )
- {
- Self().SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, resourceImage.GetUrl() );
-
- }
- }
-}
-
-void PushButton::SetBackgroundImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release.\n" );
-
- SetButtonImage( image );
-
-}
-
-void PushButton::SetSelectedImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedImage() is deprecated and will be removed from next release. Use Button.SetProperty SELECTED_STATE_IMAGE or Styling file instead.\n" );
-
- Image retreivedButtonImage = Toolkit::ImageView::DownCast( image ).GetImage();
- if ( retreivedButtonImage )
- {
- ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
-
- if ( resourceImage )
- {
- Self().SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, resourceImage.GetUrl() );
- }
- }
-}
-
-void PushButton::SetSelectedBackgroundImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedBackgroundImage() is deprecated and will be removed from next release.\n" );
-
- SetSelectedImage( image );
-}
-
-void PushButton::SetDisabledBackgroundImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledBackgroundImage() is deprecated and will be removed from next release.\n" );
-
- Image retreivedButtonImage = Toolkit::ImageView::DownCast( image ).GetImage();
- if ( retreivedButtonImage )
- {
- ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
-
- if ( resourceImage )
- {
- Self().SetProperty( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, resourceImage.GetUrl() );
- }
- }
-}
-
-void PushButton::SetDisabledImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledImage() is deprecated and will be removed from next release. Use Button.SetProperty DISABLED_STATE_IMAGE or Styling file instead.\n" );
-
- Image retreivedButtonImage = Toolkit::ImageView::DownCast( image ).GetImage();
- if ( retreivedButtonImage )
- {
- ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
-
- if ( resourceImage )
- {
- Self().SetProperty( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_BACKGROUND_VISUAL, resourceImage.GetUrl() );
- }
- }
-}
-
-void PushButton::SetDisabledSelectedImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledSelectedImage() is deprecated and will be removed from next release.\n" );
-
- Image retreivedButtonImage = Toolkit::ImageView::DownCast( image ).GetImage();
- if ( retreivedButtonImage )
- {
- ResourceImage resourceImage = ResourceImage::DownCast( retreivedButtonImage );
-
- if ( resourceImage )
- {
- Self().SetProperty( Toolkit::DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL, resourceImage.GetUrl() );
- }
- }
-}
-
} // namespace Internal
} // namespace Toolkit
*/
static Property::Value GetProperty( BaseObject* object, Property::Index propertyIndex );
- /**
- * Deprecated API for Setting Pushbutton image using an Actor
- * @param[in] image, Image Actor that has a url which can be used to create an image visual
- */
- void SetButtonImage( Actor image );
-
- /**
- * Deprecated API for Setting Pushbutton image using an Actor
- * @param[in] image, Image Actor that has a url which can be used to create an image visual
- */
- void SetBackgroundImage( Actor image );
-
- /**
- * Deprecated API for Setting Pushbutton image using an Actor
- * @param[in] image, Image Actor that has a url which can be used to create an image visual
- */
- void SetSelectedImage( Actor image );
-
- /**
- * Deprecated API for Setting Pushbutton image using an Actor
- * @param[in] image, Image Actor that has a url which can be used to create an image visual
- */
- void SetSelectedBackgroundImage( Actor image );
-
- /**
- * Deprecated API for Setting Pushbutton image using an Actor
- * @param[in] image, Image Actor that has a url which can be used to create an image visual
- */
- void SetDisabledBackgroundImage( Actor image );
-
- /**
- * Deprecated API for Setting Pushbutton image using an Actor
- * @param[in] image, Image Actor that has a url which can be used to create an image visual
- */
- void SetDisabledImage( Actor image );
-
- /**
- * Deprecated API for Setting Pushbutton image using an Actor
- * @param[in] image, Image Actor that has a url which can be used to create an image visual
- */
- void SetDisabledSelectedImage( Actor image );
-
private: // From Button
/**
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
#include <dali-toolkit/public-api/controls/image-view/image-view.h>
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
#include <dali-toolkit/public-api/visuals/visual-properties.h>
#include <dali-toolkit/public-api/align-enumerations.h>
DALI_LOG_INFO( gLogButtonFilter, Debug::General, "ToggleButton::Began to register visual.\n" );
- PrepareVisual( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, mToggleVisuals[mCurrentToggleIndex] );
- PrepareVisual( Toolkit::DevelButton::Property::SELECTED_VISUAL, mToggleSelectedVisuals[mCurrentToggleIndex] );
- PrepareVisual( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL, mToggleDisabledVisuals[mCurrentToggleIndex] );
- PrepareVisual( Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL, mToggleDisabledSelectedVisuals[mCurrentToggleIndex] );
+ PrepareVisual( Toolkit::Button::Property::UNSELECTED_VISUAL, mToggleVisuals[mCurrentToggleIndex] );
+ PrepareVisual( Toolkit::Button::Property::SELECTED_VISUAL, mToggleSelectedVisuals[mCurrentToggleIndex] );
+ PrepareVisual( Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL, mToggleDisabledVisuals[mCurrentToggleIndex] );
+ PrepareVisual( Toolkit::Button::Property::DISABLED_SELECTED_VISUAL, mToggleDisabledSelectedVisuals[mCurrentToggleIndex] );
RelayoutRequest();
}
{
DALI_LOG_INFO( gLogButtonFilter, Debug::General, "ToggleButton::OnRelayout targetSize(%f,%f) ptr(%p)\n", size.width, size.height, this );
- RelayoutVisual( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, size );
- RelayoutVisual( Toolkit::DevelButton::Property::SELECTED_VISUAL, size );
- RelayoutVisual( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL, size );
- RelayoutVisual( Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL, size );
+ RelayoutVisual( Toolkit::Button::Property::UNSELECTED_VISUAL, size );
+ RelayoutVisual( Toolkit::Button::Property::SELECTED_VISUAL, size );
+ RelayoutVisual( Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL, size );
+ RelayoutVisual( Toolkit::Button::Property::DISABLED_SELECTED_VISUAL, size );
}
void ToggleButton::OnPressed()
mCurrentToggleIndex = ( mCurrentToggleIndex + 1 ) % mToggleVisuals.size();
// Both create SelectedVisual and UnselectedVisual
- PrepareVisual( Toolkit::DevelButton::Property::UNSELECTED_VISUAL, mToggleVisuals[mCurrentToggleIndex] );
- PrepareVisual( Toolkit::DevelButton::Property::SELECTED_VISUAL, mToggleSelectedVisuals[mCurrentToggleIndex] );
- PrepareVisual( Toolkit::DevelButton::Property::DISABLED_UNSELECTED_VISUAL, mToggleDisabledVisuals[mCurrentToggleIndex] );
- PrepareVisual( Toolkit::DevelButton::Property::DISABLED_SELECTED_VISUAL, mToggleDisabledSelectedVisuals[mCurrentToggleIndex] );
+ PrepareVisual( Toolkit::Button::Property::UNSELECTED_VISUAL, mToggleVisuals[mCurrentToggleIndex] );
+ PrepareVisual( Toolkit::Button::Property::SELECTED_VISUAL, mToggleSelectedVisuals[mCurrentToggleIndex] );
+ PrepareVisual( Toolkit::Button::Property::DISABLED_UNSELECTED_VISUAL, mToggleDisabledVisuals[mCurrentToggleIndex] );
+ PrepareVisual( Toolkit::Button::Property::DISABLED_SELECTED_VISUAL, mToggleDisabledSelectedVisuals[mCurrentToggleIndex] );
//Need to check mCurrentToggleIndex, it must less than the size of mToggleTooltips.
if ( !mToggleTooltips.empty() && ( mCurrentToggleIndex < mToggleTooltips.size() ) )
// Properties registered without macro to use specific member variables.
const PropertyRegistration Control::Impl::PROPERTY_1( typeRegistration, "styleName", Toolkit::Control::Property::STYLE_NAME, Property::STRING, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-const PropertyRegistration Control::Impl::PROPERTY_2( typeRegistration, "backgroundColor", Toolkit::Control::Property::BACKGROUND_COLOR, Property::VECTOR4, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
-const PropertyRegistration Control::Impl::PROPERTY_3( typeRegistration, "backgroundImage", Toolkit::Control::Property::BACKGROUND_IMAGE, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_2( typeRegistration, "reservedProperty01", Toolkit::Control::Property::RESERVED_PROPERTY_01, Property::VECTOR4, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
+const PropertyRegistration Control::Impl::PROPERTY_3( typeRegistration, "reservedProperty02", Toolkit::Control::Property::RESERVED_PROPERTY_02, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
const PropertyRegistration Control::Impl::PROPERTY_4( typeRegistration, "keyInputFocus", Toolkit::Control::Property::KEY_INPUT_FOCUS, Property::BOOLEAN, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
const PropertyRegistration Control::Impl::PROPERTY_5( typeRegistration, "background", Toolkit::Control::Property::BACKGROUND, Property::MAP, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
const PropertyRegistration Control::Impl::PROPERTY_6( typeRegistration, "margin", Toolkit::Control::Property::MARGIN, Property::EXTENTS, &Control::Impl::SetProperty, &Control::Impl::GetProperty );
}
break;
- case Toolkit::Control::Property::BACKGROUND_COLOR:
- {
- DALI_LOG_WARNING( "BACKGROUND_COLOR property is deprecated. Use BACKGROUND property instead\n" );
- controlImpl.SetBackgroundColor( value.Get< Vector4 >() );
- break;
- }
-
- case Toolkit::Control::Property::BACKGROUND_IMAGE:
- {
- DALI_LOG_WARNING( "BACKGROUND_IMAGE property is deprecated. Use BACKGROUND property instead\n" );
- Image image = Scripting::NewImage( value );
- if ( image )
- {
- controlImpl.SetBackgroundImage( image );
- }
- else
- {
- // An empty image means the background is no longer required
- controlImpl.ClearBackground();
- }
- break;
- }
-
case Toolkit::Control::Property::KEY_INPUT_FOCUS:
{
if ( value.Get< bool >() )
break;
}
- case Toolkit::Control::Property::BACKGROUND_COLOR:
- {
- DALI_LOG_WARNING( "BACKGROUND_COLOR property is deprecated. Use BACKGROUND property instead\n" );
- value = controlImpl.GetBackgroundColor();
- break;
- }
-
- case Toolkit::Control::Property::BACKGROUND_IMAGE:
- {
- DALI_LOG_WARNING( "BACKGROUND_IMAGE property is deprecated. Use BACKGROUND property instead\n" );
- Property::Map map;
- Toolkit::Visual::Base visual = controlImpl.mImpl->GetVisual( Toolkit::Control::Property::BACKGROUND );
- if( visual )
- {
- visual.CreatePropertyMap( map );
- }
- value = map;
- break;
- }
-
case Toolkit::Control::Property::KEY_INPUT_FOCUS:
{
value = controlImpl.HasKeyInputFocus();
// Setup properties, signals and actions using the type-registry.
DALI_TYPE_REGISTRATION_BEGIN( Toolkit::ImageView, Toolkit::Control, Create );
-DALI_PROPERTY_REGISTRATION( Toolkit, ImageView, "resourceUrl", STRING, RESOURCE_URL )
+DALI_PROPERTY_REGISTRATION( Toolkit, ImageView, "reservedProperty01", STRING, RESERVED_PROPERTY_01 )
DALI_PROPERTY_REGISTRATION( Toolkit, ImageView, "image", MAP, IMAGE )
DALI_PROPERTY_REGISTRATION( Toolkit, ImageView, "preMultipliedAlpha", BOOLEAN, PRE_MULTIPLIED_ALPHA )
ImageView& impl = GetImpl( imageView );
switch ( index )
{
- case Toolkit::ImageView::Property::RESOURCE_URL:
- {
- std::string imageUrl;
- if( value.Get( imageUrl ) )
- {
- impl.SetImage( imageUrl, ImageDimensions() );
- }
- break;
- }
-
case Toolkit::ImageView::Property::IMAGE:
{
std::string imageUrl;
ImageView& impl = GetImpl( imageview );
switch ( propertyIndex )
{
- case Toolkit::ImageView::Property::RESOURCE_URL:
- {
- if ( !impl.mUrl.empty() )
- {
- value = impl.mUrl;
- }
- break;
- }
-
case Toolkit::ImageView::Property::IMAGE:
{
if ( !impl.mUrl.empty() )
/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
// INTERNAL INCLUDES
#include <dali-toolkit/public-api/controls/text-controls/text-label.h>
-#include <dali-toolkit/devel-api/controls/buttons/button-devel.h>
#include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
#include <dali-toolkit/devel-api/controls/control-devel.h>
#include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
+#include <dali-toolkit/public-api/visuals/color-visual-properties.h>
#include <dali-toolkit/public-api/visuals/text-visual-properties.h>
#include <dali-toolkit/public-api/visuals/visual-properties.h>
#include <dali-toolkit/internal/helpers/color-conversion.h>
}
// 3. Set the normal option image (blank / Transparent).
- option.SetProperty( Toolkit::DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL, "" );
+ option.SetProperty( Toolkit::Button::Property::UNSELECTED_BACKGROUND_VISUAL, "" );
// 4. Set the pressed option image.
- // The image can be blank, the color can be used regardless.
- option.SetProperty( Toolkit::DevelButton::Property::SELECTED_BACKGROUND_VISUAL, mPressedImage );
- option.SetProperty( Toolkit::Button::Property::SELECTED_COLOR, mPressedColor );
+ Property::Value selectedBackgroundValue( mPressedImage );
+ if( mPressedImage.empty() )
+ {
+ // The image can be blank, the color can be used in that case.
+ selectedBackgroundValue = Property::Value{ { Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR },
+ { Toolkit::ColorVisual::Property::MIX_COLOR, mPressedColor } };
+ }
+ option.SetProperty( Toolkit::Button::Property::SELECTED_BACKGROUND_VISUAL, selectedBackgroundValue );
option.SetProperty( Toolkit::Control::Property::STYLE_NAME, TEXT_SELECTION_POPUP_BUTTON_STYLE_NAME );
// 5 Add option to tool bar
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
return Control::DownCast<Button, Internal::Button>(handle);
}
-void Button::SetDisabled( bool disabled )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabled() is deprecated and will be removed from next release. Use SetProperty DISABLED or Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetDisabled( disabled );
-}
-
-bool Button::IsDisabled() const
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsDisabled() is deprecated and will be removed from next release. Use GetProperty DISABLED instead.\n" );
-
- return Dali::Toolkit::GetImplementation( *this ).IsDisabled();
-}
-
-void Button::SetAutoRepeating( bool autoRepeating )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetAutoRepeating() is deprecated and will be removed from next release. Use SetProperty AUTO_REPEATING or Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetAutoRepeating( autoRepeating );
-}
-
-bool Button::IsAutoRepeating() const
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsAutoRepeating() is deprecated and will be removed from next release. Use GetProperty AUTO_REPEATING instead.\n" );
-
- return Dali::Toolkit::GetImplementation( *this ).IsAutoRepeating();
-}
-
-void Button::SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetInitialAutoRepeatingDelay() is deprecated and will be removed from next release. Use SetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetInitialAutoRepeatingDelay( initialAutoRepeatingDelay );
-}
-
-float Button::GetInitialAutoRepeatingDelay() const
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetInitialAutoRepeatingDelay() is deprecated and will be removed from next release. Use GetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file instead.\n" );
-
- return Dali::Toolkit::GetImplementation( *this ).GetInitialAutoRepeatingDelay();
-}
-
-void Button::SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetNextAutoRepeatingDelay() is deprecated and will be removed from next release. Use SetProperty NEXT_AUTO_REPEATING_DELAY or Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetNextAutoRepeatingDelay( nextAutoRepeatingDelay );
-}
-
-float Button::GetNextAutoRepeatingDelay() const
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetNextAutoRepeatingDelay() is deprecated and will be removed from next release. Use GetProperty NEXT_AUTO_REPEATING_DELAY instead.\n" );
-
- return Dali::Toolkit::GetImplementation( *this ).GetNextAutoRepeatingDelay();
-}
-
-void Button::SetTogglableButton( bool togglable )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetTogglableButton() is deprecated and will be removed from next release. Use SetProperty TOGGLABLE or Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetTogglableButton( togglable );
-}
-
-bool Button::IsTogglableButton() const
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsTogglableButton() is deprecated and will be removed from next release. Use GetProperty TOGGLABLE instead.\n" );
-
- return Dali::Toolkit::GetImplementation( *this ).IsTogglableButton();
-}
-
-void Button::SetSelected( bool selected )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelected() is deprecated and will be removed from next release. Use SetProperty SELECTED instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetSelected( selected );
-}
-
-bool Button::IsSelected() const
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: IsSelected() is deprecated and will be removed from next release. Use GetProperty SELECTED instead.\n" );
-
- return Dali::Toolkit::GetImplementation( *this ).IsSelected();
-}
-
-void Button::SetAnimationTime( float animationTime )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetAnimationTime() is deprecated and will be removed from next release. Use Styling file to set animation instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetAnimationTime( animationTime );
-}
-
-float Button::GetAnimationTime() const
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetAnimationTime() is deprecated and will be removed from next release.\n" );
-
- return Dali::Toolkit::GetImplementation( *this ).GetAnimationTime();
-}
-
-void Button::SetLabelText( const std::string& label )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetLabelText() is deprecated and will be removed from next release. Use SetProperty LABEL or Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetLabelText( label );
-}
-
-std::string Button::GetLabelText() const
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetLabelText() is deprecated and will be removed from next release. Use GetProperty LABEL instead.\n" );
-
- return Dali::Toolkit::GetImplementation( *this ).GetLabelText();
-}
-
-void Button::SetUnselectedImage( const std::string& filename )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetUnselectedImage() is deprecated and will be removed from next release. Use SetProperty UNSELECTED_STATE_IMAGE or Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetUnselectedImage( filename );
-}
-
-void Button::SetBackgroundImage( const std::string& filename )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( filename );
-}
-
-void Button::SetSelectedImage( const std::string& filename )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedImage() is deprecated and will be removed from next release. Use SetProperty SELECTED_STATE_IMAGE or Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( filename );
-}
-
-void Button::SetSelectedBackgroundImage( const std::string& filename )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedBackgroundImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( filename );
-}
-
-void Button::SetDisabledBackgroundImage( const std::string& filename )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledBackgroundImage() is deprecated and will be removed from next release. Use SetProperty DISABLED_STATE_IMAGE or Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( filename );
-}
-
-void Button::SetDisabledImage( const std::string& filename )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( filename );
-}
-
-void Button::SetDisabledSelectedImage( const std::string& filename )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledSelectedImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( filename );
-}
-
Button::ButtonSignalType& Button::PressedSignal()
{
return Dali::Toolkit::GetImplementation( *this ).PressedSignal();
return Dali::Toolkit::GetImplementation( *this ).StateChangedSignal();
}
-// Deprecated API
-
-void Button::SetLabel( Actor label )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetLabel() is deprecated and will be removed from next release. Use SetProperty LABEL instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetLabel( label );
-}
-
-void Button::SetButtonImage( Image image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetButtonImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
-}
-
-void Button::SetSelectedImage( Image image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedImage() is deprecated and will be removed from next release. Use Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
-}
-
-Actor Button::GetButtonImage() const
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetButtonImage() is deprecated and will be removed from next release.\n" );
-
- return Dali::Toolkit::GetImplementation( *this ).GetButtonImage();
-}
-
-Actor Button::GetSelectedImage() const
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetSelectedImage() is deprecated and will be removed from next release.\n" );
-
- return Dali::Toolkit::GetImplementation( *this ).GetSelectedImage();
-}
-
Button::Button( Internal::Button& implementation )
: Control( implementation )
{
SELECTED,
/**
- * @DEPRECATED_1_1.XX Use UNSELECTED_VISUAL
- * @brief name "unselectedStateImage", type string if it is a url, map otherwise
- * @details Sets the unselected button foreground image
- * @SINCE_1_0.0
+ * @brief name "unselectedVisual", type string if it is a url, map otherwise.
+ * @details Sets the unselected button foreground/icon visual
+ * @SINCE_1_4.32
*/
- UNSELECTED_STATE_IMAGE,
+ UNSELECTED_VISUAL,
/**
- * @DEPRECATED_1_1.XX Use SELECTED_VISUAL
- * @brief name "selectedStateImage", type string if it is a url, map otherwise
- * @details Sets the selected button foreground image
- * @SINCE_1_0.0
+ * @brief name "selectedImage", type string if it is a url, map otherwise
+ * @details Sets the selected button foreground/icon visual
+ * @SINCE_1_4.32
*/
- SELECTED_STATE_IMAGE,
+ SELECTED_VISUAL,
/**
- * @DEPRECATED_1_1.XX Use DISABLED_UNSELECTED_VISUAL
- * @brief name "disabledStateImage", type string if it is a url, map otherwise
- * @details Sets the disabled whilst unselected foreground button visual
- * @SINCE_1_0.0
+ * @brief name "disabledSelectedVisual", type string if it is a url, map otherwise
+ * @details Sets the disabled selected state foreground/icon button visual
+ * @SINCE_1_4.32
*/
- DISABLED_STATE_IMAGE,
+ DISABLED_SELECTED_VISUAL,
/**
- * @DEPRECATED_1_1.XX Use UNSELECTED_BACKGROUND_VISUAL
- * @brief name "unselectedColor", type Vector4
- * @SINCE_1_0.0
+ * @brief name "disabledUnselectedVisual", type string if it is a url, map otherwise
+ * @details Sets the disabled unselected state foreground/icon visual
+ * @SINCE_1_4.32
*/
- UNSELECTED_COLOR,
+ DISABLED_UNSELECTED_VISUAL,
/**
- * @DEPRECATED_1_1.XX Use SELECTED_BACKGROUND_VISUAL
- * @brief name "selectedColor", type Vector4
- * @SINCE_1_0.0
+ * @brief name "unselectedBackgroundVisual", type string if it is a url, map otherwise
+ * @details Sets the disabled in the unselected state background, button visual
+ * @SINCE_1_4.32
*/
- SELECTED_COLOR,
+ UNSELECTED_BACKGROUND_VISUAL,
/**
* @brief name "label", type Property::Map or std::string
LABEL,
/**
- * @DEPRECATED_1_1.32 Use LABEL
- * @brief name "labelText", type std::string
- * @SINCE_1_0.0
+ * @brief name "selectedBackgroundVisual", type string if it is a url, map otherwise
+ * @details Sets the selected background button visual
+ * @SINCE_1_4.32
+ */
+ SELECTED_BACKGROUND_VISUAL,
+
+ /**
+ * @brief name "disabledUnselectedBackgroundVisual", type string if it is a url, map otherwise
+ * @details Sets the disabled while unselected background button visual
+ * @SINCE_1_4.32
+ */
+ DISABLED_UNSELECTED_BACKGROUND_VISUAL,
+
+ /**
+ * @brief name "disabledSelectedBackgroundVisual", type string if it is a url, map otherwise
+ * @details Sets the disabled while selected background button visual
+ * @SINCE_1_4.32
*/
- LABEL_TEXT
+ DISABLED_SELECTED_BACKGROUND_VISUAL,
};
};
*/
~Button();
- // Deprecated API
-
- /**
- * @DEPRECATED_1_1.32 Use SetProperty DISABLED or Styling file
- *
- * @brief Sets the button as \e disabled.
- *
- * No signals are emitted when the \e disabled property is set.
- *
- * @SINCE_1_0.0
- * @param[in] disabled Disabled property
- */
- void SetDisabled( bool disabled ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 Use GetProperty DISABLED
- *
- * @brief Returns if the button is disabled.
- * @SINCE_1_0.0
- * @return \e true if the button is \e disabled
- */
- bool IsDisabled() const DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 SetProperty AUTO_REPEATING or Styling file
- *
- * @brief Sets the \e autorepeating property.
- *
- * If the \e autorepeating property is set to \e true, then the \e togglable property is set to false
- * but no signal is emitted.
- *
- * @SINCE_1_0.0
- * @param[in] autoRepeating \e autorepeating property
- */
- void SetAutoRepeating( bool autoRepeating ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 GetProperty AUTO_REPEATING
- *
- * @brief Returns if the autorepeating property is set.
- * @SINCE_1_0.0
- * @return \e true if the \e autorepeating property is set
- */
- bool IsAutoRepeating() const DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 SetProperty INITIAL_AUTO_REPEATING_DELAY or Styling file
- *
- * @brief Sets the initial autorepeating delay.
- *
- * By default, this value is set to 0.15 seconds.
- *
- * @SINCE_1_0.0
- * @param[in] initialAutoRepeatingDelay in seconds
- * @pre initialAutoRepeatingDelay must be greater than zero.
- */
- void SetInitialAutoRepeatingDelay( float initialAutoRepeatingDelay ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 GetProperty INITIAL_AUTO_REPEATING_DELAY
- *
- * @brief Gets the initial autorepeating delay in seconds.
- * @SINCE_1_0.0
- * @return The initial autorepeating delay in seconds
- */
- float GetInitialAutoRepeatingDelay() const DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 SetProperty NEXT_AUTO_REPEATING_DELAY or Styling file
- *
- * @brief Sets the next autorepeating delay.
- *
- * By default, this value is set to 0.05 seconds.
- *
- * @SINCE_1_0.0
- * @param[in] nextAutoRepeatingDelay in seconds
- * @pre nextAutoRepeatingDelay must be greater than zero.
- */
- void SetNextAutoRepeatingDelay( float nextAutoRepeatingDelay ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 GetProperty NEXT_AUTO_REPEATING_DELAY
- *
- * @brief Gets the next autorepeating delay in seconds.
- * @SINCE_1_0.0
- * @return The next autorepeating delay in seconds
- */
- float GetNextAutoRepeatingDelay() const DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 SetProperty TOGGLABLE or Styling file
- *
- * @brief Sets the \e togglable property.
- *
- * If the \e togglable property is set to \e true, then the \e autorepeating property is set to false.
- *
- * @SINCE_1_0.0
- * @param[in] togglable Togglable property
- */
- void SetTogglableButton( bool togglable ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 GetProperty TOGGLABLE
- *
- * @brief Returns if the togglable property is set.
- * @SINCE_1_0.0
- * @return \e true if the \e togglable property is set
- */
- bool IsTogglableButton() const DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 SetProperty SELECTED
- *
- * @brief Sets the button as selected or unselected.
- *
- * \e togglable property must be set to \e true.
- *
- * Emits a Button::StateChangedSignal() signal.
- *
- * @SINCE_1_0.0
- * @param[in] selected Selected property
- */
- void SetSelected( bool selected ) DALI_DEPRECATED_API;
-
- /**
- * DEPRECATED_1_1.32 GetProperty SELECTED
- *
- * @brief Returns if the selected property is set and the button is togglable.
- * @SINCE_1_0.0
- * @return \e true if the button is \e selected
- */
- bool IsSelected() const DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 Use Styling file to set animation
- *
- * @brief Sets the animation time.
- *
- * @SINCE_1_0.0
- * @param[in] animationTime The animation time in seconds
- */
- void SetAnimationTime( float animationTime ) DALI_DEPRECATED_API;
-
- /**
- * DEPRECATED_1_1.32 Use Styling file to set animation
- *
- * @brief Retrieves button's animation time.
- *
- * @SINCE_1_0.0
- * @return The animation time in seconds
- */
- float GetAnimationTime() const DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 SetProperty Property::LABEL or Styling file
- *
- * @brief Sets the button's label.
- *
- * @SINCE_1_0.0
- * @param[in] label The label text
- */
- void SetLabelText( const std::string& label ) DALI_DEPRECATED_API;
-
- /**
- * DEPRECATED_1_1.32 GetProperty LABEL
- *
- * @brief Gets the label.
- *
- * @SINCE_1_0.0
- * @return The label text
- */
- std::string GetLabelText() const DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 Use Styling file Property::UNSELECTED_STATE_IMAGE
- *
- * @brief Sets the unselected button image.
- *
- * @SINCE_1_0.0
- * @param[in] filename The button image
- */
- void SetUnselectedImage( const std::string& filename ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 Use styling Set Control::Property::BACKGROUND which is same as un-selected background
- * Or use DevelButton::Property::UNSELECTED_BACKGROUND_VISUAL
- *
- * @brief Sets the background image.
- *
- * @SINCE_1_0.0
- * @param[in] filename The background image
- */
- void SetBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 Use styling file, Property::SELECTED_STATE_IMAGE
- *
- * @brief Sets the selected image.
- *
- * @SINCE_1_0.0
- * @param[in] filename The selected image
- */
- void SetSelectedImage( const std::string& filename ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 Set Control::Property::BACKGROUND which is same as un-selected background
- * Or use DevelButton::Property::SELECTED_BACKGROUND_VISUAL
- *
- * @brief Sets the selected background image.
- *
- * @SINCE_1_0.0
- * @param[in] filename The selected background image
- */
- void SetSelectedBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 Only able to set Property::DISABLED_STATE_IMAGE
- * Or use DevelButton::Property::DISABLED_SELECTED_BACKGROUND_VISUAL
- *
- * @brief Sets the disabled background image.
- *
- * @SINCE_1_0.0
- * @param[in] filename The disabled background image
- */
- void SetDisabledBackgroundImage( const std::string& filename ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 Use styling file Property::DISABLED_STATE_IMAGE
- *
- * @brief Sets the disabled button image.
- *
- * @SINCE_1_0.0
- * @param[in] filename The disabled button image
- */
- void SetDisabledImage( const std::string& filename ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_1.32 Use Property::DISABLED_STATE_IMAGE which provides same disabled image for un/selected
- * Or DevelButton::Property::DISABLED_SELECTED_VISUAL to disable selected visual.
- *
- * @brief Sets the disabled selected button image.
- *
- * @SINCE_1_0.0
- * @param[in] filename The disabled selected button image
- */
- void SetDisabledSelectedImage( const std::string& filename ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_0.50. Instead, use SetLabelText
- *
- * @brief Sets the label with an actor.
- *
- * @SINCE_1_0.0
- * @param[in] label The actor to use as a label
- */
- void SetLabel( Actor label ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_0.50. Instead, use SetUnselectedImage.
- *
- * @brief Sets the button image.
- *
- * @SINCE_1_0.0
- * @param[in] image The button image
- */
- void SetButtonImage( Image image ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_0.50. Instead, use SetSelectedImage( const std::string& filename ).
- *
- * @brief Sets the selected image.
- *
- * @SINCE_1_0.0
- * @param[in] image The selected image
- */
- void SetSelectedImage( Image image ) DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_0.50
- *
- * @brief Gets the button image.
- *
- * @SINCE_1_0.0
- * @remarks Avoid using this method as it's a legacy code.
- * @return An actor with the button image
- */
- Actor GetButtonImage() const DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_0.50
- *
- * @brief Gets the selected image.
- *
- * @SINCE_1_0.0
- * @remarks Avoid using this method as it's a legacy code.
- * @return An actor with the selected image
- */
- Actor GetSelectedImage() const DALI_DEPRECATED_API;
-
public: //Signals
/**
/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
return Control::DownCast<PushButton, Internal::PushButton>(handle);
}
-// Deprecated API
-
-void PushButton::SetButtonImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetButtonImage() is deprecated and will be removed from next release. Use Button.SetProperty UNSELECTED_STATE_IMAGE or Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetButtonImage( image );
-}
-
-void PushButton::SetBackgroundImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetBackgroundImage( image );
-}
-
-void PushButton::SetSelectedImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedImage() is deprecated and will be removed from next release. Use Button.SetProperty SELECTED_STATE_IMAGE or Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( image );
-}
-
-void PushButton::SetSelectedBackgroundImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetSelectedBackgroundImage() is deprecated and will be removed from next release.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetSelectedBackgroundImage( image );
-}
-
-void PushButton::SetDisabledBackgroundImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledBackgroundImage() is deprecated and will be removed from next release.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetDisabledBackgroundImage( image );
-}
-
-void PushButton::SetDisabledImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledImage() is deprecated and will be removed from next release. Use Button.SetProperty DISABLED_STATE_IMAGE or Styling file instead.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetDisabledImage( image );
-}
-
-void PushButton::SetDisabledSelectedImage( Actor image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetDisabledSelectedImage() is deprecated and will be removed from next release.\n" );
-
- Dali::Toolkit::GetImplementation( *this ).SetDisabledSelectedImage( image );
-}
-
} // namespace Toolkit
} // namespace Dali
*/
static PushButton DownCast( BaseHandle handle );
- ///////////////////////////////////////////////////////////////////////////
- // Deprecated API
-
- using Button::SetButtonImage;
-
- /**
- * @DEPRECATED_1_0.50. Instead, use Button::SetUnselectedImage.
- *
- * @brief Sets the unselected image with an Actor.
- *
- * @SINCE_1_0.0
- * @param[in] image The Actor to use
- */
- void SetButtonImage( Actor image ) DALI_DEPRECATED_API;
-
- using Button::SetBackgroundImage;
-
- /**
- * @DEPRECATED_1_0.50. Instead, use Button::SetBackgroundImage.
- *
- * @brief Sets the background image with an Actor.
- *
- * @SINCE_1_0.0
- * @param[in] image The Actor to use
- */
- void SetBackgroundImage( Actor image ) DALI_DEPRECATED_API;
-
- using Button::SetSelectedImage;
-
- /**
- * @DEPRECATED_1_0.50. Instead, use Button::SetSelectedImage( const std::string& filename ).
- *
- * @brief Sets the selected image with an Actor.
- *
- * @SINCE_1_0.0
- * @param[in] image The Actor to use
- */
- void SetSelectedImage( Actor image ) DALI_DEPRECATED_API;
-
- using Button::SetSelectedBackgroundImage;
-
- /**
- * @DEPRECATED_1_0.50. Instead, use Button::SetSelectedBackgroundImage.
- *
- * @brief Sets the selected background image with an Actor.
- *
- * @SINCE_1_0.0
- * @param[in] image The Actor to use
- */
- void SetSelectedBackgroundImage( Actor image ) DALI_DEPRECATED_API;
-
- using Button::SetDisabledBackgroundImage;
-
- /**
- * @DEPRECATED_1_0.50. Instead, use Button::SetDisabledBackgroundImage.
- *
- * @brief Sets the disabled background image with an Actor.
- *
- * @SINCE_1_0.0
- * @param[in] image The Actor to use
- */
- void SetDisabledBackgroundImage( Actor image ) DALI_DEPRECATED_API;
-
- using Button::SetDisabledImage;
-
- /**
- * @DEPRECATED_1_0.50. Instead, use Button::SetDisabledImage.
- *
- * @brief Sets the disabled image with an Actor.
- *
- * @SINCE_1_0.0
- * @param[in] image The Actor to use
- */
- void SetDisabledImage( Actor image ) DALI_DEPRECATED_API;
-
- using Button::SetDisabledSelectedImage;
-
- /**
- * @DEPRECATED_1_0.50. Instead, use Button::SetDisabledSelectedImage.
- *
- * @brief Sets the disabled selected image with an Actor.
- *
- * @SINCE_1_0.0
- * @param[in] image The Actor to use
- */
- void SetDisabledSelectedImage( Actor image ) DALI_DEPRECATED_API;
-
-
public: // Not intended for application developers
/// @cond internal
SetBackground( map );
}
-Vector4 Control::GetBackgroundColor() const
-{
- return mImpl->mBackgroundColor;
-}
-
void Control::SetBackground( const Property::Map& map )
{
Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( map );
}
}
-void Control::SetBackgroundImage( Image image )
-{
- Toolkit::Visual::Base visual = Toolkit::VisualFactory::Get().CreateVisual( image );
- if( visual )
- {
- mImpl->RegisterVisual( Toolkit::Control::Property::BACKGROUND, visual, DepthIndex::BACKGROUND );
- }
-}
-
void Control::ClearBackground()
{
mImpl->UnregisterVisual( Toolkit::Control::Property::BACKGROUND );
void SetBackgroundColor( const Vector4& color );
/**
- * @copydoc Dali::Toolkit::Control::GetBackgroundColor
- */
- Vector4 GetBackgroundColor() const;
-
- /**
- * @copydoc Dali::Toolkit::Control::SetBackgroundImage
- */
- void SetBackgroundImage( Image image );
-
- /**
* @brief Sets the background with a property map.
*
* @SINCE_1_0.0
/*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
Internal::GetImplementation(*this).SetBackgroundColor( color );
}
-Vector4 Control::GetBackgroundColor() const
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: GetBackgroundColor() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" );
-
- return Internal::GetImplementation(*this).GetBackgroundColor();
-}
-
-void Control::SetBackgroundImage( Image image )
-{
- DALI_LOG_WARNING_NOFN("DEPRECATION WARNING: SetBackgroundImage() is deprecated and will be removed from next release. use Property::BACKGROUND instead.\n" );
-
- Internal::GetImplementation(*this).SetBackgroundImage( image );
-}
-
void Control::ClearBackground()
{
Internal::GetImplementation(*this).ClearBackground();
*/
STYLE_NAME = PROPERTY_START_INDEX,
- /**
- * @DEPRECATED_1_1.3
- * @brief The background color of the control.
- *
- * Mutually exclusive with BACKGROUND_IMAGE & BACKGROUND.
- * @details Name "backgroundColor", type Property::VECTOR4.
- * @see Toolkit::Control::SetStyleName()
- * @SINCE_1_0.0
- */
- BACKGROUND_COLOR,
-
- /**
- * @DEPRECATED_1_1.3
- * @brief The background image of the control.
- *
- * Mutually exclusive with BACKGROUND_COLOR & BACKGROUND.
- * @details Name "backgroundImage", type Property::MAP.
- * @SINCE_1_0.0
- */
- BACKGROUND_IMAGE,
+ RESERVED_PROPERTY_01, ///< Reserved index for a removed property.
+ RESERVED_PROPERTY_02, ///< Reserved index for a removed property.
/**
* @brief Receives key events to the control.
/**
* @brief The background of the control.
*
- * Mutually exclusive with BACKGROUND_COLOR & BACKGROUND_IMAGE.
* @details Name "background", type Property::MAP or std::string for URL or Property::VECTOR4 for Color.
* @SINCE_1_1.3
*/
void SetBackgroundColor( const Vector4& color );
/**
- * @DEPRECATED_1_1.3
- *
- * @brief Retrieves the background color of the control.
- *
- * @SINCE_1_0.0
- * @return The background color of the control
- */
- Vector4 GetBackgroundColor() const DALI_DEPRECATED_API;
-
- /**
- * @DEPRECATED_1_2_8, use Property::BACKGROUND instead
- *
- * @brief Sets an image as the background of the control.
- *
- * @SINCE_1_0.0
- * @param[in] image The image to set as the background
- */
- void SetBackgroundImage( Image image ) DALI_DEPRECATED_API;
-
- /**
* @brief Clears the background.
* @SINCE_1_0.0
*/
{
// Event side properties
- /**
- * @DEPRECATED_1_1.16. Use IMAGE instead.
- * @brief name "resourceUrl", type string.
- * @SINCE_1_0.0
- */
- RESOURCE_URL = PROPERTY_START_INDEX,
+ RESERVED_PROPERTY_01 = PROPERTY_START_INDEX, ///< Reserved index for a removed property.
/**
* @brief name "image", type string if it is a url, map otherwise.