/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2020 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/dali.h>
#include <dali-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
#include "shared/view.h"
#include <sstream>
// The Init signal is received once (only) during the Application lifetime
void Create( Application& application )
{
- // Hide the indicator bar
- application.GetWindow().ShowIndicator( Dali::Window::INVISIBLE );
+ Window window = mApplication.GetWindow();
+ window.KeyEventSignal().Connect( this, &BezierCurveExample::OnKeyEvent );
- Stage stage = Stage::GetCurrent();
- stage.KeyEventSignal().Connect( this, &BezierCurveExample::OnKeyEvent );
-
- CreateBackground(stage);
+ CreateBackground(window);
mControlPointScale = 0.5f;
mControlPointZoomScale = mControlPointScale * 2.0f;
mContentLayer.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
mContentLayer.TouchSignal().Connect(this, &BezierCurveExample::OnTouchLayer);
mContentLayer.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
- stage.Add( mContentLayer );
+ window.Add( mContentLayer );
// 6 rows: title, grid, coords, play, anim1, anim2
TableView contentLayout = TableView::New(5, 1);
UpdateCurve();
}
- void CreateBackground( Stage stage )
+ void CreateBackground( Window window )
{
Toolkit::Control background = Dali::Toolkit::Control::New();
background.SetProperty( Actor::Property::ANCHOR_POINT, Dali::AnchorPoint::CENTER );
map.Insert( Visual::Property::TYPE, Visual::COLOR );
map.Insert( ColorVisual::Property::MIX_COLOR, Vector4( 253/255.0f, 245/255.0f, 230/255.0f, 1.0f ) );
background.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map );
- stage.Add( background );
+ window.Add( background );
}
void CreateCubic(Actor parent)
Property::Map curveVertexFormat;
curveVertexFormat["aPosition"] = Property::VECTOR2;
- mCurveVertices = PropertyBuffer::New( curveVertexFormat );
+ mCurveVertices = VertexBuffer::New( curveVertexFormat );
Vector2 vertexData[2] = { Vector2(-0.5f, 0.5f), Vector2( 0.5f, -0.5f ) };
mCurveVertices.SetData( vertexData, 2 );
return actor;
}
- Actor CreateControlLine( PropertyBuffer vertexBuffer )
+ Actor CreateControlLine( VertexBuffer vertexBuffer )
{
Actor line = Actor::New();
line.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
Property::Map lineVertexFormat;
lineVertexFormat["aPosition"] = Property::VECTOR2;
- mLine1Vertices = PropertyBuffer::New( lineVertexFormat );
- mLine2Vertices = PropertyBuffer::New( lineVertexFormat );
+ mLine1Vertices = VertexBuffer::New( lineVertexFormat );
+ mLine2Vertices = VertexBuffer::New( lineVertexFormat );
mControlLine1 = CreateControlLine( mLine1Vertices );
mControlLine2 = CreateControlLine( mLine2Vertices );
}
}
- bool OnTouchControlPoint( Actor controlPoint, const TouchData& event )
+ bool OnTouchControlPoint( Actor controlPoint, const TouchEvent& event )
{
if( event.GetPointCount() > 0 )
{
return false; // Don't mark this as consumed - let the layer get the touch
}
- bool OnTouchLayer( Actor actor, const TouchData& event )
+ bool OnTouchLayer( Actor actor, const TouchEvent& event )
{
if( event.GetPointCount() > 0 )
{
void OnKeyEvent(const KeyEvent& event)
{
- if( event.state == KeyEvent::Down && (IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK )) )
+ if( event.GetState() == KeyEvent::DOWN && (IsKey( event, DALI_KEY_ESCAPE) || IsKey( event, DALI_KEY_BACK )) )
{
mApplication.Quit();
}
Timer mTimer;
Animation mDragAnimation;
Animation mBezierAnimation;
- PropertyBuffer mCurveVertices;
- PropertyBuffer mLine1Vertices;
- PropertyBuffer mLine2Vertices;
+ VertexBuffer mCurveVertices;
+ VertexBuffer mLine1Vertices;
+ VertexBuffer mLine2Vertices;
Vector2 mRelativeDragPoint;
Vector2 mLastControlPointPosition1;
Vector2 mLastControlPointPosition2;