X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-editor-impl.cpp;fp=dali-toolkit%2Finternal%2Fcontrols%2Ftext-controls%2Ftext-editor-impl.cpp;h=ccddda51335ee50c4592c966e34d12a22309e0d6;hp=e763f2c9a16a557e6d2f5a40c2969889a8dfad8b;hb=7cca1061ed3db08d2e7f511a8f6ef707e688703d;hpb=6b496cacd2a596235a246c912a6b507a72d67ad4 diff --git a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp index e763f2c..ccddda5 100644 --- a/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp +++ b/dali-toolkit/internal/controls/text-controls/text-editor-impl.cpp @@ -76,6 +76,14 @@ const Scripting::StringEnum HORIZONTAL_ALIGNMENT_STRING_TABLE[] = }; 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[] = +{ + { "WORD", Toolkit::Text::Layout::LineWrap::WORD }, + { "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"); @@ -141,6 +149,7 @@ DALI_DEVEL_PROPERTY_REGISTRATION( Toolkit, TextEditor, "placeholderText", 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 ) @@ -712,6 +721,21 @@ void TextEditor::SetProperty( BaseObject* object, Property::Index index, const P } 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 } @@ -1088,6 +1112,13 @@ Property::Value TextEditor::GetProperty( BaseObject* object, Property::Index ind value = map; break; } + case Toolkit::DevelTextEditor::Property::LINE_WRAP_MODE: + { + if( impl.mController ) + { + value = impl.mController->GetLineWrapMode(); + } + } } //switch }