}
-const Dali::TouchPoint pointDownInside( 0, TouchPoint::Down, 240, 400 );
-const Dali::TouchPoint pointUpInside( 0, TouchPoint::Up, 240, 400 );
-const Dali::TouchPoint pointLeave( 0, TouchPoint::Leave, 240, 400 );
-const Dali::TouchPoint pointEnter( 0, TouchPoint::Motion, 240, 400 );
-const Dali::TouchPoint pointMotionOut( 0, TouchPoint::Motion, 10, 10 );
-const Dali::TouchPoint pointDownOutside( 0, TouchPoint::Down, 10, 10 );
-const Dali::TouchPoint pointUpOutside( 0, TouchPoint::Up, 10, 10 );
+Dali::Integration::Point GetPointDownInside()
+{
+ Dali::Integration::Point point;
+ point.SetState( PointState::DOWN );
+ point.SetScreenPosition( Vector2( 240, 400 ) );
+ return point;
+}
+
+Dali::Integration::Point GetPointUpInside()
+{
+ Dali::Integration::Point point;
+ point.SetState( PointState::UP );
+ point.SetScreenPosition( Vector2( 240, 400 ) );
+ return point;
+}
+
+Dali::Integration::Point GetPointMotionOut()
+{
+ Dali::Integration::Point point;
+ point.SetState( PointState::MOTION );
+ point.SetScreenPosition( Vector2( 10, 10 ) );
+ return point;
+}
+
+Dali::Integration::Point GetPointUpOutside()
+{
+ Dali::Integration::Point point;
+ point.SetState( PointState::UP );
+ point.SetScreenPosition( Vector2( 10, 10 ) );
+ return point;
+}
+
} // namespace
Test mTest;
};
-static bool TestCallback(Actor actor, const TouchEvent& event)
+static bool TestCallback(Actor actor, const TouchData& event)
{
return true;
}
//////////////////////////////////////////////////////////
+int UtcDaliPushButtonDownCast(void)
+{
+ ToolkitTestApplication application;
+ tet_infoline(" UtcDaliPushButtonDownCast");
+
+ TETButton tetButton= Toolkit::TETButton::New();
+
+ BaseHandle object(tetButton);
+
+ TETButton tetButton2 = TETButton::DownCast( object );
+ DALI_TEST_CHECK(tetButton2);
+
+ TETButton tetButton3 = DownCast< TETButton >(object);
+ DALI_TEST_CHECK(tetButton3);
+ END_TEST;
+}
int UtcDaliPushButtonInterruptEventWhenInsensitive(void)
{
// * Actor's touch event is connected to a callback function
// and this callback function consumes the event.
- actor.TouchedSignal().Connect( &TestCallback );
+ actor.TouchSignal().Connect( &TestCallback );
// * Button's pressed signal is connected to a callback function
// which also consumes the event.
// A down event is sent inside the button's boundary.
event = Dali::Integration::TouchEvent();
- event.AddPoint( pointDownInside );
+ event.AddPoint( GetPointDownInside() );
// flush the queue and render once
application.SendNotification();
// An up event is sent outside the button's boundary but inside the actor's one.
event = Dali::Integration::TouchEvent();
- event.AddPoint( pointUpOutside );
+ event.AddPoint( GetPointUpOutside() );
// flush the queue and render once
application.SendNotification();
// A down event is sent inside the button's boundary.
event = Dali::Integration::TouchEvent();
- event.AddPoint( pointDownInside );
+ event.AddPoint( GetPointDownInside() );
// flush the queue and render once
application.SendNotification();
// A motion event is sent outside the button's boundary but inside the actor's one.
event = Dali::Integration::TouchEvent();
- event.AddPoint( pointMotionOut );
+ event.AddPoint( GetPointMotionOut() );
// flush the queue and render once
application.SendNotification();
// A down event is sent inside the button's boundary.
event = Dali::Integration::TouchEvent();
- event.AddPoint( pointDownInside );
+ event.AddPoint( GetPointDownInside() );
// flush the queue and render once
application.SendNotification();
// An up event is sent inside the button's boundary.
event = Dali::Integration::TouchEvent();
- event.AddPoint( pointUpInside );
+ event.AddPoint( GetPointUpInside() );
// flush the queue and render once
application.SendNotification();
// * Actor's touch event is connected to a callback function
// and this callback function consumes the event.
- actor.TouchedSignal().Connect( &TestCallback );
+ actor.TouchSignal().Connect( &TestCallback );
// * Button's pressed signal is connected to a callback function
// which also consumes the event.
// A down event is sent inside the button's boundary.
event = Dali::Integration::TouchEvent();
- event.AddPoint( pointDownInside );
+ event.AddPoint( GetPointDownInside() );
// flush the queue and render once
application.SendNotification();
// An up event is sent outside the button's boundary but inside the actor's one.
event = Dali::Integration::TouchEvent();
- event.AddPoint( pointUpOutside );
+ event.AddPoint( GetPointUpOutside() );
// flush the queue and render once
application.SendNotification();
// A down event is sent inside the button's boundary.
event = Dali::Integration::TouchEvent();
- event.AddPoint( pointDownInside );
+ event.AddPoint( GetPointDownInside() );
// flush the queue and render once
application.SendNotification();
// A motion event is sent outside the button's boundary but inside the actor's one.
event = Dali::Integration::TouchEvent();
- event.AddPoint( pointMotionOut );
+ event.AddPoint( GetPointMotionOut() );
// flush the queue and render once
application.SendNotification();
// A down event is sent inside the button's boundary.
event = Dali::Integration::TouchEvent();
- event.AddPoint( pointDownInside );
+ event.AddPoint( GetPointDownInside() );
// flush the queue and render once
application.SendNotification();
// An up event is sent inside the button's boundary.
event = Dali::Integration::TouchEvent();
- event.AddPoint( pointUpInside );
+ event.AddPoint( GetPointUpInside() );
// flush the queue and render once
application.SendNotification();
DALI_TEST_CHECK( button.IsSelected() ) ;
DALI_TEST_CHECK( button.GetProperty< bool >( Button::Property::SELECTED ) );
- // Button::PROPERTY_NORMAL_STATE_ACTOR
- {
- button.SetButtonImage( ResourceImage::New( "IMAGE_PATH_1") );
- DALI_TEST_EQUALS( "IMAGE_PATH_1", button.GetProperty( Button::Property::NORMAL_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
-
- Property::Map map;
- map[ "type" ] = "ImageActor";
-
- button.SetProperty( Button::Property::NORMAL_STATE_ACTOR, map );
- DALI_TEST_EQUALS( "ImageActor", button.GetProperty( Button::Property::NORMAL_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
- }
-
- // Button::PROPERTY_SELECTED_STATE_ACTOR
- {
- button.SetSelectedImage( ResourceImage::New( "IMAGE_PATH_2") );
- DALI_TEST_EQUALS( "IMAGE_PATH_2", button.GetProperty( Button::Property::SELECTED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
-
- Property::Map map;
- map[ "type" ] = "Actor";
-
- button.SetProperty( Button::Property::SELECTED_STATE_ACTOR, map );
- DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::Property::SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
- DALI_TEST_CHECK( "ImageActor" != button.GetProperty( Button::Property::SELECTED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >() );
- }
-
- // Button::PROPERTY_DISABLED_STATE_ACTOR
- {
- button.SetDisabledImage( ResourceImage::New( "IMAGE_PATH_3") );
- DALI_TEST_EQUALS( "IMAGE_PATH_3", button.GetProperty( Button::Property::DISABLED_STATE_ACTOR ).GetValue( "image" ).GetValue( "filename" ).Get< std::string >(), TEST_LOCATION );
-
- Property::Map map;
- map[ "type" ] = "Actor";
-
- button.SetProperty( Button::Property::DISABLED_STATE_ACTOR, map );
- DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::Property::DISABLED_STATE_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
- }
-
- // Button::PROPERTY_LABEL_ACTOR
- {
- button.SetLabel( "LABEL_TEXT_CUSTOM" );
- DALI_TEST_EQUALS( "TextView", button.GetProperty( Button::Property::LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
-
- Property::Map map;
- map[ "type" ] = "Actor";
-
- button.SetProperty( Button::Property::LABEL_ACTOR, map );
- DALI_TEST_EQUALS( "Actor", button.GetProperty( Button::Property::LABEL_ACTOR ).GetValue( "type" ).Get< std::string >(), TEST_LOCATION );
- }
END_TEST;
}