Impl( Dali::Toolkit::Internal::Control& parent, Observer& observer )
- : mParent(parent),
+ : mTextControlParent(parent),
mObserver(observer),
mActiveCursor(ACTIVE_CURSOR_NONE),
mActiveGrabHandle(false),
*/
void Relayout( const Vector2& size )
{
- SetCursors();
+ // TODO - Remove this if nothing is active
+ CreateActiveLayer();
+
+ // Show or hide the cursors
+ CreateCursors();
+ if( mPrimaryCursor )
+ {
+ mPrimaryCursor.SetPosition( mCursor[PRIMARY_CURSOR].x, mCursor[PRIMARY_CURSOR].y );
+ }
+ if( mSecondaryCursor )
+ {
+ mSecondaryCursor.SetPosition( mCursor[SECONDARY_CURSOR].x, mCursor[SECONDARY_CURSOR].y );
+ }
// Show or hide the grab handle
if( mActiveGrabHandle )
{
SetupTouchEvents();
- CreateActiveLayer();
CreateGrabHandle();
mGrabHandle.SetPosition( mCursor[PRIMARY_CURSOR].x, mCursor[PRIMARY_CURSOR].y + mCursor[PRIMARY_CURSOR].height );
{
SetupTouchEvents();
- CreateActiveLayer();
CreateSelectionHandles();
SelectionHandleImpl& primary = mSelectionHandle[ PRIMARY_SELECTION_HANDLE ];
}
// Add or Remove cursor(s) from parent
- void SetCursors()
+ void CreateCursors()
{
- Actor parent = mParent.Self();
- /* Create Primary and or Secondary Cursor(s) if active and add to parent */
- if ( mActiveCursor == ACTIVE_CURSOR_PRIMARY )
+ if( mActiveCursor == ACTIVE_CURSOR_NONE )
{
- if ( !mPrimaryCursor )
- {
- CreateCursor( mPrimaryCursor );
-#ifdef DECORATOR_DEBUG
- mPrimaryCursor.SetName( "PrimaryCursorActor" );
-#endif
- parent.Add( mPrimaryCursor);
- }
-
- mPrimaryCursor.SetPosition( mCursor[PRIMARY_CURSOR].x, mCursor[PRIMARY_CURSOR].y );
+ UnparentAndReset( mPrimaryCursor );
+ UnparentAndReset( mSecondaryCursor );
}
- else if ( mActiveCursor == ACTIVE_CURSOR_BOTH )
+ else
{
- if ( !mSecondaryCursor )
+ /* Create Primary and or Secondary Cursor(s) if active and add to parent */
+ if ( mActiveCursor == ACTIVE_CURSOR_PRIMARY ||
+ mActiveCursor == ACTIVE_CURSOR_BOTH )
{
- CreateCursor( mSecondaryCursor );
+ if ( !mPrimaryCursor )
+ {
+ CreateCursor( mPrimaryCursor );
#ifdef DECORATOR_DEBUG
- mSecondaryCursor.SetName( "SecondaryCursorActor" );
+ mPrimaryCursor.SetName( "PrimaryCursorActor" );
#endif
- parent.Add( mSecondaryCursor);
- }
- }
- else
- {
- /* ACTIVE_CURSOR_NONE so unparent cursors*/
- if ( mPrimaryCursor )
- {
- UnparentAndReset( mPrimaryCursor );
+ mActiveLayer.Add( mPrimaryCursor);
+ }
}
- if ( mSecondaryCursor )
+ if ( mActiveCursor == ACTIVE_CURSOR_BOTH )
{
- UnparentAndReset( mSecondaryCursor );
+ if ( !mSecondaryCursor )
+ {
+ CreateCursor( mSecondaryCursor );
+#ifdef DECORATOR_DEBUG
+ mSecondaryCursor.SetName( "SecondaryCursorActor" );
+#endif
+ mActiveLayer.Add( mSecondaryCursor);
+ }
}
}
}
bool OnCursorBlinkTimerTick()
{
// Cursor blinking
- if ( ACTIVE_CURSOR_PRIMARY )
+ if ( mPrimaryCursor )
{
mPrimaryCursor.SetVisible( mCursorBlinkStatus );
}
- else if ( ACTIVE_CURSOR_BOTH )
+ if ( mSecondaryCursor )
{
- mPrimaryCursor.SetVisible( mCursorBlinkStatus );
mSecondaryCursor.SetVisible( mCursorBlinkStatus );
}
{
if( !mActiveLayer )
{
- Actor parent = mParent.Self();
+ Actor parent = mTextControlParent.Self();
mActiveLayer = Layer::New();
#ifdef DECORATOR_DEBUG
CreateBackground( mCopyPastePopup );
AddPopupOptions( true, true );
SetUpPopup( mCopyPastePopup.mRoot, mCopyPastePopup.mVisiblePopUpSize );
- Actor parent = mParent.Self();
- parent.Add( mCopyPastePopup.mRoot );
+ Actor textControl = mTextControlParent.Self();
+ textControl.Add( mCopyPastePopup.mRoot );
}
}
}
}
- Internal::Control& mParent;
+ Internal::Control& mTextControlParent;
Observer& mObserver;
Layer mActiveLayer; // Layer for active handles and alike that ensures they are above all else.