textinput/peninputarc/src/peninputlayoutcontrol/peninputlayoutcursor.cpp
branchRCL_3
changeset 22 1bbdde98cc2d
parent 19 5e18d8c489d6
child 43 ebd48d2de13c
--- a/textinput/peninputarc/src/peninputlayoutcontrol/peninputlayoutcursor.cpp	Tue May 25 13:03:44 2010 +0300
+++ b/textinput/peninputarc/src/peninputlayoutcontrol/peninputlayoutcursor.cpp	Wed Jun 09 10:03:19 2010 +0300
@@ -102,29 +102,34 @@
 EXPORT_C void CFepUiCursor::SetPosition(const TPoint& aPosition)
     {
     
-    TBool isOn = iIsOn;
-    if (isOn)
-        {
-        SetOn(EFalse);
-        }
-    iPosition=aPosition;
-    TPoint correction(KCursorPosCorrectionX,KCursorPosCorrectionY );
-    TRect rect = TRect(iPosition + correction , TSize(KCursorWidth,iHeight));
-    if(rect != iCursorRect)
-        {
-        SetRect(rect);
-        iCursorRect = rect;
-        //must update clip region again.
-        for(TInt i = 0 ; i < RootControl()->PopCtrlList().Count(); ++i)
-            {
-            UpdateValidRegion(RootControl()->PopCtrlList()[i],EFalse);
-            }
-        }
-        
-    if (isOn)
-        {
-        SetOn(ETrue);
-        }
+	if( iPosition != aPosition )
+		{
+		TBool isOn = iIsOn;
+		if (isOn)
+			{
+			SetOn(EFalse);
+
+			}
+		iPosition=aPosition;
+		TPoint correction(KCursorPosCorrectionX,KCursorPosCorrectionY );
+		TRect rect = TRect(iPosition + correction , TSize(KCursorWidth,iHeight));
+		if(rect != iCursorRect)
+			{
+			SetRect(rect);
+			iCursorRect = rect;
+			//must update clip region again.
+			for(TInt i = 0 ; i < RootControl()->PopCtrlList().Count(); ++i)
+				{
+				UpdateValidRegion(RootControl()->PopCtrlList()[i],EFalse);
+				}
+			}
+			
+		if (isOn)
+			{
+			SetOn(ETrue);
+			}
+		}
+
     }
 
 // ---------------------------------------------------------------------------
@@ -168,6 +173,7 @@
             {
             iCursorBlinkingTimer->Cancel();    
             }
+        InvalidateInsertionPoint();
         }
     else
         {
@@ -184,7 +190,7 @@
         }
         
         // Invalidate InsertionPoint's rect, so it will be removed from editarea
-    InvalidateInsertionPoint();
+    //InvalidateInsertionPoint();
     }
 
 // ---------------------------------------------------------------------------
@@ -380,7 +386,7 @@
 //
 void CFepUiCursor::InvalidateInsertionPoint()
     {    
-    //if(AbleToDraw())
+    if(AbleToDraw())
         {        
         Draw();
         //UpdateArea(iCursorRect,EFalse);
@@ -437,7 +443,7 @@
     iCursorTempDisabled = EFalse;
     iIsOn = ETrue;
     //To avoid the ugly first shown, we draw the cursor directly here.
-    InvalidateInsertionPoint();
+    //InvalidateInsertionPoint();
     SetOn(ETrue, EFalse);    
     }