#include <cstring>
#include <dali/public-api/adaptor-framework/key.h>
#include <dali/devel-api/adaptor-framework/key-devel.h>
-#include <dali/public-api/common/stage.h>
+#include <dali/devel-api/adaptor-framework/window-devel.h>
+#include <dali/devel-api/common/stage.h>
#include <dali/devel-api/object/property-helper-devel.h>
#include <dali/devel-api/actors/actor-devel.h>
#include <dali/public-api/object/type-registry-helper.h>
// Fill-parent area by default
self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::WIDTH );
self.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::HEIGHT );
- self.OnStageSignal().Connect( this, &TextField::OnStageConnect );
+ self.OnSceneSignal().Connect( this, &TextField::OnSceneConnect );
DevelControl::SetInputMethodContext( *this, mInputMethodContext );
Vector2 contentSize( size.x - ( padding.start + padding.end ), size.y - ( padding.top + padding.bottom ) );
// Support Right-To-Left of padding
- Dali::LayoutDirection::Type layoutDirection = static_cast<Dali::LayoutDirection::Type>( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+ Dali::LayoutDirection::Type layoutDirection;
+ if( mController->IsMatchSystemLanguageDirection() )
+ {
+ layoutDirection = static_cast<Dali::LayoutDirection::Type>( DevelWindow::Get( self ).GetRootLayer().GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+ }
+ else
+ {
+ layoutDirection = static_cast<Dali::LayoutDirection::Type>( self.GetProperty( Dali::Actor::Property::LAYOUT_DIRECTION ).Get<int>() );
+ }
if( Dali::LayoutDirection::RIGHT_TO_LEFT == layoutDirection )
{
std::swap( padding.start, padding.end );
bool TextField::OnKeyEvent( const KeyEvent& event )
{
- DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyEvent %p keyCode %d\n", mController.Get(), event.keyCode );
+ DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextField::OnKeyEvent %p keyCode %d\n", mController.Get(), event.GetKeyCode() );
- if( Dali::DALI_KEY_ESCAPE == event.keyCode && mController->ShouldClearFocusOnEscape() )
+ if( Dali::DALI_KEY_ESCAPE == event.GetKeyCode() && mController->ShouldClearFocusOnEscape() )
{
// Make sure ClearKeyInputFocus when only key is up
- if( event.state == KeyEvent::Up )
+ if( event.GetState() == KeyEvent::Up )
{
ClearKeyInputFocus();
}
return true;
}
- else if( Dali::DevelKey::DALI_KEY_RETURN == event.keyCode )
+ else if( Dali::DevelKey::DALI_KEY_RETURN == event.GetKeyCode() )
{
// Do nothing when enter is comming.
return false;
}
}
-void TextField::OnStageConnect( Dali::Actor actor )
+void TextField::OnSceneConnect( Dali::Actor actor )
{
if ( mHasBeenStaged )
{
}
}
-void TextField::OnStageConnection( int depth )
+void TextField::OnSceneConnection( int depth )
{
// Sets the depth to the visuals inside the text's decorator.
mDecorator->SetTextDepth( depth );
// The depth of the text renderer is set in the RenderText() called from OnRelayout().
- // Call the Control::OnStageConnection() to set the depth of the background.
- Control::OnStageConnection( depth );
+ // Call the Control::OnSceneConnection() to set the depth of the background.
+ Control::OnSceneConnection( depth );
}
-bool TextField::OnTouched( Actor actor, const TouchData& touch )
+bool TextField::OnTouched( Actor actor, const TouchEvent& touch )
{
- return true;
+ return false;
}
void TextField::OnIdleSignal()