/*
- * Copyright (c) 2017 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-toolkit/dali-toolkit.h>
+#include <dali-toolkit/devel-api/controls/table-view/table-view.h>
#include <dali/devel-api/actors/actor-devel.h>
#include <iostream>
/**
* @brief The Init signal is received once (only) during the Application lifetime.
*/
- void Create( Application& /* application */ )
+ void Create( Application& application )
{
- // Get a handle to the stage
- Stage stage = Stage::GetCurrent();
- stage.SetBackgroundColor( Color::WHITE );
- stage.KeyEventSignal().Connect( this, &PivotController::OnKeyEvent );
+ // Get a handle to the window
+ Window window = application.GetWindow();
+ window.SetBackgroundColor( Color::WHITE );
+ window.KeyEventSignal().Connect( this, &PivotController::OnKeyEvent );
// Create a table view.
TableView tableView = TableView::New( TABLE_VIEW_ROWS, TABLE_VIEW_COLUMNS );
tableView.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
tableView.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
tableView.SetProperty( Actor::Property::SIZE_MODE_FACTOR, TABLE_VIEW_SIZE_MODE_FACTOR );
- stage.Add( tableView );
+ window.Add( tableView );
// Create a tap detector - we are going to rotate an actor round our anchor-point (pivot) when one of our controls is tapped.
mTapDetector = TapGestureDetector::New();
Control control = Control::New();
control.SetBackgroundColor( Vector4( Random::Range( 0.0f, 1.0f ), Random::Range( 0.0f, 1.0f ), Random::Range( 0.0f, 1.0f ), 1.0f ) );
control.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
- control.SetProperty( DevelActor::Property::POSITION_USES_ANCHOR_POINT, false ); // Ensures the position always uses top-left for its calculations.
+ control.SetProperty( Actor::Property::POSITION_USES_ANCHOR_POINT, false ); // Ensures the position always uses top-left for its calculations.
control.SetProperty( Actor::Property::ANCHOR_POINT, anchorPoint ); // This anchor-point is used for the rotation and the scale.
// Add to the table-view