/*
- * 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.
void Control::SetKeyInputFocus()
{
- if( Self().OnStage() )
+ if( Self().GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) )
{
Toolkit::KeyInputFocusManager::Get().SetFocus(Toolkit::Control::DownCast(Self()));
}
bool Control::HasKeyInputFocus()
{
bool result = false;
- if( Self().OnStage() )
+ if( Self().GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) )
{
Toolkit::Control control = Toolkit::KeyInputFocusManager::Get().GetCurrentFocusControl();
if( Self() == control )
void Control::ClearKeyInputFocus()
{
- if( Self().OnStage() )
+ if( Self().GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) )
{
Toolkit::KeyInputFocusManager::Get().RemoveFocus(Toolkit::Control::DownCast(Self()));
}
{
}
-void Control::OnControlChildAdd( Actor& child )
-{
-}
-
-void Control::OnControlChildRemove( Actor& child )
-{
-}
-
void Control::OnStyleChange( Toolkit::StyleManager styleManager, StyleChange::Type change )
{
// By default the control is only interested in theme (not font) changes
if( pinch.state == Gesture::Started )
{
- *( mImpl->mStartingPinchScale ) = Self().GetCurrentScale();
+ *( mImpl->mStartingPinchScale ) = Self().GetCurrentProperty< Vector3 >( Actor::Property::SCALE );
}
- Self().SetScale( *( mImpl->mStartingPinchScale ) * pinch.scale );
+ Self().SetProperty( Actor::Property::SCALE, *( mImpl->mStartingPinchScale ) * pinch.scale );
}
void Control::OnPan( const PanGesture& pan )
void Control::OnChildAdd(Actor& child)
{
- // Notify derived classes.
- OnControlChildAdd( child );
}
void Control::OnChildRemove(Actor& child)
{
- // Notify derived classes.
- OnControlChildRemove( child );
}
void Control::OnPropertySet( Property::Index index, Property::Value propertyValue )
{
// If the clipping mode has been set, we may need to create a renderer.
// Only do this if we are already on-stage as the OnStageConnection will handle the off-stage clipping controls.
- if( ( index == Actor::Property::CLIPPING_MODE ) && Self().OnStage() )
+ if( ( index == Actor::Property::CLIPPING_MODE ) && Self().GetProperty< bool >( Actor::Property::CONNECTED_TO_SCENE ) )
{
// Note: This method will handle whether creation of the renderer is required.
CreateClippingRenderer( *this );
childOffset.x += ( mImpl->mMargin.start + padding.start );
childOffset.y += ( mImpl->mMargin.top + padding.top );
- child.SetPosition( childOffset.x, childOffset.y );
+ child.SetProperty( Actor::Property::POSITION, Vector2( childOffset.x, childOffset.y ) );
}
container.Add( child, newChildSize );
}
Vector3 Control::GetNaturalSize()
{
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::GetNaturalSize for %s\n", Self().GetName().c_str() );
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Control::GetNaturalSize for %s\n", Self().GetProperty< std::string >( Dali::Actor::Property::NAME ).c_str() );
Toolkit::Visual::Base visual = mImpl->GetVisual( Toolkit::Control::Property::BACKGROUND );
if( visual )
{