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;
}
const float AUTO_REPEATING_DELAY = 0.15f;
Button button = PushButton::New();
- button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- button.SetParentOrigin( ParentOrigin::TOP_LEFT );
- button.SetPosition( 240, 400 );
- button.SetSize( 100, 100 );
+ button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ button.SetProperty( Actor::Property::POSITION, Vector2( 240, 400 ));
+ button.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
Stage::GetCurrent().Add( button );
application.SendNotification();
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;
tet_infoline(" UtcDaliButtonPressedSignalP");
Button button = PushButton::New();
- button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- button.SetParentOrigin( ParentOrigin::TOP_LEFT );
- button.SetPosition( 240, 400 );
- button.SetSize( 100, 100 );
+ button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ button.SetProperty( Actor::Property::POSITION, Vector2( 240, 400 ));
+ button.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
Stage::GetCurrent().Add( button );
tet_infoline(" UtcDaliButtonClickedSignalP");
Button button = PushButton::New();
- button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- button.SetParentOrigin( ParentOrigin::TOP_LEFT );
- button.SetPosition( 240, 400 );
- button.SetSize( 100, 100 );
+ button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ button.SetProperty( Actor::Property::POSITION, Vector2( 240, 400 ));
+ button.SetProperty( Actor::Property::SIZE, Vector2( 100, 100 ) );
Stage::GetCurrent().Add( button );
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)
{
/**
ToolkitTestApplication application;
Button parentButton = PushButton::New();
- parentButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- parentButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- parentButton.SetSize( 20, 20 );
+ parentButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ parentButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ parentButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
Stage::GetCurrent().Add( parentButton );
Button childButton = PushButton::New();
- childButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- childButton.SetParentOrigin( ParentOrigin::BOTTOM_LEFT );
- childButton.SetSize( 20, 20 );
+ childButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ childButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::BOTTOM_LEFT );
+ childButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
parentButton.Add( childButton );
// Reset signal flags
ToolkitTestApplication application;
Button parentButton = PushButton::New();
- parentButton.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- parentButton.SetParentOrigin( ParentOrigin::TOP_LEFT );
- parentButton.SetSize( 20, 20 );
+ parentButton.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ parentButton.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ parentButton.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
Stage::GetCurrent().Add( parentButton );
parentButton.ReleasedSignal().Connect( &ButtonCallback );
Button button = PushButton::New();
button.SetProperty( Button::Property::TOGGLABLE, true);
- button.SetAnchorPoint( AnchorPoint::TOP_LEFT );
- button.SetParentOrigin( ParentOrigin::TOP_LEFT );
- button.SetSize( 20, 20 );
+ button.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT );
+ button.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::TOP_LEFT );
+ button.SetProperty( Actor::Property::SIZE, Vector2( 20, 20 ) );
Stage::GetCurrent().Add( button );
button.ReleasedSignal().Connect( &ButtonCallback );