projects
/
platform
/
core
/
uifw
/
dali-toolkit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add support to unselect text And Get_SelectedText
[platform/core/uifw/dali-toolkit.git]
/
dali-toolkit
/
internal
/
text
/
text-controller.cpp
diff --git
a/dali-toolkit/internal/text/text-controller.cpp
b/dali-toolkit/internal/text/text-controller.cpp
index
8aaefae
..
b4624dc
100755
(executable)
--- a/
dali-toolkit/internal/text/text-controller.cpp
+++ b/
dali-toolkit/internal/text/text-controller.cpp
@@
-3033,17
+3033,22
@@
void Controller::LongPressEvent( Gesture::State state, float x, float y )
}
}
}
}
-void Controller::SelectEvent( float x, float y,
bool selectAll
)
+void Controller::SelectEvent( float x, float y,
SelectionType selectType
)
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SelectEvent\n" );
if( NULL != mImpl->mEventData )
{
{
DALI_LOG_INFO( gLogFilter, Debug::Verbose, "Controller::SelectEvent\n" );
if( NULL != mImpl->mEventData )
{
- if( select
All
)
+ if( select
Type == SelectionType::ALL
)
{
Event event( Event::SELECT_ALL );
mImpl->mEventData->mEventQueue.push_back( event );
}
{
Event event( Event::SELECT_ALL );
mImpl->mEventData->mEventQueue.push_back( event );
}
+ else if( selectType == SelectionType::NONE )
+ {
+ Event event( Event::SELECT_NONE );
+ mImpl->mEventData->mEventQueue.push_back( event );
+ }
else
{
Event event( Event::SELECT );
else
{
Event event( Event::SELECT );
@@
-3326,14
+3331,14
@@
void Controller::TextPopupButtonTouched( Dali::Toolkit::TextSelectionPopup::Butt
if( mImpl->mEventData->mSelectionEnabled )
{
// Creates a SELECT event.
if( mImpl->mEventData->mSelectionEnabled )
{
// Creates a SELECT event.
- SelectEvent( currentCursorPosition.x, currentCursorPosition.y,
false
);
+ SelectEvent( currentCursorPosition.x, currentCursorPosition.y,
SelectionType::INTERACTIVE
);
}
break;
}
case Toolkit::TextSelectionPopup::SELECT_ALL:
{
// Creates a SELECT_ALL event
}
break;
}
case Toolkit::TextSelectionPopup::SELECT_ALL:
{
// Creates a SELECT_ALL event
- SelectEvent( 0.f, 0.f,
true
);
+ SelectEvent( 0.f, 0.f,
SelectionType::ALL
);
break;
}
case Toolkit::TextSelectionPopup::CLIPBOARD:
break;
}
case Toolkit::TextSelectionPopup::CLIPBOARD:
@@
-3755,6
+3760,16
@@
bool Controller::RemoveSelectedText()
return textRemoved;
}
return textRemoved;
}
+std::string Controller::GetSelectedText()
+{
+ std::string text;
+ if( EventData::SELECTING == mImpl->mEventData->mState )
+ {
+ mImpl->RetrieveSelection( text, false );
+ }
+ return text;
+}
+
// private : Relayout.
bool Controller::DoRelayout( const Size& size,
// private : Relayout.
bool Controller::DoRelayout( const Size& size,