// The Init signal is received once (only) during the Application lifetime
void Create( Application& application )
{
- // Get a handle to the stage
- Stage stage = Stage::GetCurrent();
- stage.KeyEventSignal().Connect(this, &GradientController::OnKeyEvent);
+ // Get a handle to the window
+ auto window = application.GetWindow();
+ window.KeyEventSignal().Connect(this, &GradientController::OnKeyEvent);
// Creates a default view with a default tool bar.
- // The view is added to the stage.
+ // The view is added to the window.
Toolkit::ToolBar toolBar;
Layer content = DemoHelper::CreateView( application,
mView,
DemoHelper::DEFAULT_MODE_SWITCH_PADDING );
mGradientControl = Control::New();
- mGradientControl.SetAnchorPoint( AnchorPoint::CENTER );
- mGradientControl.SetParentOrigin( ParentOrigin::CENTER );
+ mGradientControl.SetProperty( Actor::Property::ANCHOR_POINT, AnchorPoint::CENTER );
+ mGradientControl.SetProperty( Actor::Property::PARENT_ORIGIN, ParentOrigin::CENTER );
mGradientControl.SetResizePolicy( ResizePolicy::SIZE_RELATIVE_TO_PARENT, Dimension::ALL_DIMENSIONS );
Vector3 offset( 0.9f, 0.7f, 0.0f );
- mGradientControl.SetSizeModeFactor( offset );
+ mGradientControl.SetProperty( Actor::Property::SIZE_MODE_FACTOR, offset );
content.Add( mGradientControl );
// ---- Gradient for background
}
case 1: // linear gradient with units as userSpaceOnUse
{
- Vector2 halfStageSize = Stage::GetCurrent().GetSize()*0.5f;
- gradientMap.Insert( GradientVisual::Property::START_POSITION, halfStageSize );
- gradientMap.Insert( GradientVisual::Property::END_POSITION, -halfStageSize );
+ Vector2 halfWindowSize = Vector2(mApplication.GetWindow().GetSize())*0.5f;
+ gradientMap.Insert( GradientVisual::Property::START_POSITION, halfWindowSize );
+ gradientMap.Insert( GradientVisual::Property::END_POSITION, -halfWindowSize );
gradientMap.Insert( GradientVisual::Property::UNITS, GradientVisual::Units::USER_SPACE );
break;
}
}
default: // radial gradient with units as userSpaceOnUse
{
- Vector2 stageSize = Stage::GetCurrent().GetSize();
- gradientMap.Insert( GradientVisual::Property::CENTER, stageSize * 0.5f );
- gradientMap.Insert( GradientVisual::Property::RADIUS, stageSize.Length());
+ Vector2 windowSize = mApplication.GetWindow().GetSize();
+ gradientMap.Insert( GradientVisual::Property::CENTER, windowSize * 0.5f );
+ gradientMap.Insert( GradientVisual::Property::RADIUS, windowSize.Length());
gradientMap.Insert( GradientVisual::Property::UNITS, GradientVisual::Units::USER_SPACE );
break;
}
void OnKeyEvent(const KeyEvent& event)
{
- if(event.state == KeyEvent::Down)
+ if(event.GetState() == KeyEvent::Down)
{
if( IsKey( event, Dali::DALI_KEY_ESCAPE) || IsKey( event, Dali::DALI_KEY_BACK) )
{