DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "maxLength", INTEGER, MAX_LENGTH )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "selectedTextStart", INTEGER, SELECTED_TEXT_START )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "selectedTextEnd", INTEGER, SELECTED_TEXT_END )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableEditing", BOOLEAN, ENABLE_EDITING )
DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED )
}
break;
}
+ case Toolkit::DevelTextEditor::Property::ENABLE_EDITING:
+ {
+ const bool editable = value.Get< bool >();
+ DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p ENABLE_EDITING %d\n", impl.mController.Get(), editable );
+ impl.SetEditable( editable );
+ break;
+ }
} // switch
} // texteditor
}
value = static_cast<int>(range.second);
break;
}
+ case Toolkit::DevelTextEditor::Property::ENABLE_EDITING:
+ {
+ value = impl.IsEditable();
+ break;
+ }
} //switch
}
void TextEditor::OnKeyInputFocusGained()
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnKeyInputFocusGained %p\n", mController.Get() );
- if ( mInputMethodContext )
+ if ( mInputMethodContext && IsEditable() )
{
mInputMethodContext.StatusChangedSignal().Connect( this, &TextEditor::KeyboardStatusChanged );
void TextEditor::OnTap( const TapGesture& gesture )
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "TextEditor::OnTap %p\n", mController.Get() );
- if ( mInputMethodContext )
+ if ( mInputMethodContext && IsEditable() )
{
mInputMethodContext.Activate();
}
void TextEditor::OnLongPress( const LongPressGesture& gesture )
{
- if ( mInputMethodContext )
+ if ( mInputMethodContext && IsEditable() )
{
mInputMethodContext.Activate();
}
}
}
+bool TextEditor::IsEditable() const
+{
+ return mController->IsEditable();
+}
+
+void TextEditor::SetEditable( bool editable )
+{
+ mController->SetEditable(editable);
+ if ( mInputMethodContext && !editable )
+ {
+ mInputMethodContext.Deactivate();
+ }
+}
+
TextEditor::TextEditor()
: Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
mAnimationPeriod( 0.0f, 0.0f ),