};
const unsigned int HORIZONTAL_ALIGNMENT_STRING_TABLE_COUNT = sizeof( HORIZONTAL_ALIGNMENT_STRING_TABLE ) / sizeof( HORIZONTAL_ALIGNMENT_STRING_TABLE[0] );
+
+const Scripting::StringEnum LINE_WRAP_MODE_STRING_TABLE[] =
+{
+ { "WRAP_MODE_WORD", Toolkit::Text::Layout::LineWrap::WORD },
+ { "WRAP_MODE_CHARACTER", Toolkit::Text::Layout::LineWrap::CHARACTER }
+};
+const unsigned int LINE_WRAP_MODE_STRING_TABLE_COUNT = sizeof( LINE_WRAP_MODE_STRING_TABLE ) / sizeof( LINE_WRAP_MODE_STRING_TABLE[0] );
+
const char* const SCROLL_BAR_POSITION("sourcePosition");
const char* const SCROLL_BAR_POSITION_MIN("sourcePositionMin");
const char* const SCROLL_BAR_POSITION_MAX("sourcePositionMax");
DALI_DEVEL_PROPERTY_REGISTRATION_READ_ONLY( Toolkit, TextEditor, "lineCount", INTEGER, LINE_COUNT )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderText", STRING, PLACEHOLDER_TEXT )
DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderTextColor", VECTOR4, PLACEHOLDER_TEXT_COLOR )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "enableSelection", BOOLEAN, ENABLE_SELECTION )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholder", MAP, PLACEHOLDER )
+DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "lineWrapMode", STRING, LINE_WRAP_MODE )
DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "textChanged", SIGNAL_TEXT_CHANGED )
DALI_SIGNAL_REGISTRATION( Toolkit, TextEditor, "inputStyleChanged", SIGNAL_INPUT_STYLE_CHANGED )
const std::string& text = value.Get< std::string >();
DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor::OnPropertySet %p PLACEHOLDER_TEXT %s\n", impl.mController.Get(), text.c_str() );
- impl.mController->SetPlaceholderText( text );
+ impl.mController->SetPlaceholderText( Controller::PLACEHOLDER_TYPE_INACTIVE, text );
}
break;
}
}
break;
}
+ case Toolkit::DevelTextEditor::Property::ENABLE_SELECTION:
+ {
+ if( impl.mController )
+ {
+ const bool enableSelection = value.Get< bool >();
+ DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p ENABLE_SELECTION %d\n", impl.mController.Get(), enableSelection );
+ impl.mController->SetSelectionEnabled( enableSelection );
+ }
+ break;
+ }
+ case Toolkit::DevelTextEditor::Property::PLACEHOLDER:
+ {
+ const Property::Map* map = value.GetMap();
+ if( map )
+ {
+ impl.mController->SetPlaceholderProperty( *map );
+ }
+ break;
+ }
+ case Toolkit::DevelTextEditor::Property::LINE_WRAP_MODE:
+ {
+ const std::string& wrapModeStr = value.Get< std::string >();
+ DALI_LOG_INFO( gLogFilter, Debug::General, "TextEditor %p LINE_WRAP_MODE %s\n", impl.mController.Get(), wrapModeStr.c_str() );
+
+ Layout::LineWrap::Mode lineWrapMode( Layout::LineWrap::WORD );
+ if( Scripting::GetEnumeration< Layout::LineWrap::Mode >( wrapModeStr.c_str(),
+ LINE_WRAP_MODE_STRING_TABLE,
+ LINE_WRAP_MODE_STRING_TABLE_COUNT,
+ lineWrapMode ) )
+ {
+ impl.mController->SetLineWrapMode( lineWrapMode );
+ }
+ break;
+ }
} // switch
} // texteditor
}
if( impl.mController )
{
std::string text;
- impl.mController->GetPlaceholderText( text );
+ impl.mController->GetPlaceholderText( Controller::PLACEHOLDER_TYPE_INACTIVE, text );
value = text;
}
break;
}
break;
}
+ case Toolkit::DevelTextEditor::Property::ENABLE_SELECTION:
+ {
+ if( impl.mController )
+ {
+ value = impl.mController->IsSelectionEnabled();
+ }
+ break;
+ }
+ case Toolkit::DevelTextEditor::Property::PLACEHOLDER:
+ {
+ Property::Map map;
+ impl.mController->GetPlaceholderProperty( map );
+ value = map;
+ break;
+ }
+ case Toolkit::DevelTextEditor::Property::LINE_WRAP_MODE:
+ {
+ if( impl.mController )
+ {
+ const char* name = Scripting::GetEnumerationName< Layout::LineWrap::Mode >( impl.mController->GetLineWrapMode(),
+ LINE_WRAP_MODE_STRING_TABLE,
+ LINE_WRAP_MODE_STRING_TABLE_COUNT );
+ if( name )
+ {
+ value = std::string( name );
+ }
+ }
+ }
} //switch
}
{
if( mRenderer )
{
+ Dali::Toolkit::TextEditor handle = Dali::Toolkit::TextEditor( GetOwner() );
+
renderableActor = mRenderer->Render( mController->GetView(),
+ handle,
+ Property::INVALID_INDEX, // Animatable property not supported
mAlignmentOffset,
DepthIndex::CONTENT );
}