javauis/lcdui_akn/lcdui/src/CMIDTextEditor.cpp
branchRCL_3
changeset 60 6c158198356e
parent 59 e5618cc85d74
--- a/javauis/lcdui_akn/lcdui/src/CMIDTextEditor.cpp	Thu Jul 15 18:31:06 2010 +0300
+++ b/javauis/lcdui_akn/lcdui/src/CMIDTextEditor.cpp	Thu Aug 19 09:48:13 2010 +0300
@@ -357,13 +357,13 @@
             // It sets edwin variables necessary for correct clipping.
             iTextEdwin->SetOnScreenCanvasRect(iUtils->GetOnScreenCanvasRect());
             iTextEdwin->SetScaling(IsScalingOn());
-    
+
             // It sets indicator variables necessary for correct clipping.
             iEditingStateIndicator->SetScalingOn(IsScalingOn());
             iEditingStateIndicator->SetCanvasRect(iUtils->GetOnScreenCanvasRect());
         }
     }
-    
+
     DEBUG("CMIDTextEditor::SetParentL -");
 }
 
@@ -614,9 +614,9 @@
             // Remove the selection at this point. The selection can be
             // set again with the API.
             SetCursorPositionL(iTextEdwin->CursorPos());
-            
+
             if (iEditingStateIndicator->EnabledState() ==
-                             CMIDEditingStateIndicator::EIndicatorStateRelative)
+                    CMIDEditingStateIndicator::EIndicatorStateRelative)
             {
                 // Enable the custom indicators as in Avkon if not controlled
                 // by the client application
@@ -1429,7 +1429,14 @@
         TInt newEditorWindowHeight = iTextEdwin->EditorWindowHeight();
         if (size.iHeight != newEditorWindowHeight)
         {
-            SetEditorSize(size.iWidth, newEditorWindowHeight);
+            if (!IsScalingOn())
+            {
+                SetEditorSize(size.iWidth, newEditorWindowHeight);
+            }
+            else if (iUtils)
+            {
+                SetEditorSize(size.iWidth, iUtils->DoDescaling(newEditorWindowHeight, CMIDUtils::EVertical));
+            }
         }
         // SetEditorSize method resets the flag, make sure it remains true
         // here.
@@ -2187,6 +2194,17 @@
     }
 }
 
+void CMIDTextEditor::HandleForeground(TBool aForeground)
+{
+    // If Canvas goes to foreground and scaling is on,
+    // then we resize a TextEditor.
+    if (aForeground && iUtils && iComponentContainer && iUtils->IsScalingEnabled() &&
+            iComponentContainer->IsFullScreen())
+    {
+        HandleChangeForScaling(EForegroundGained);
+    }
+}
+
 void CMIDTextEditor::HandleChangeForScaling(TChange aChange)
 {
     // It is needed to store iRowCountActive, because SetEditorSize resets it.
@@ -2207,7 +2225,9 @@
     // restoring of iRowCountActive
     iRowCountActive = rowCountActive;
 
-    if ((aChange == EFullscreenChange) || (aChange == EResolutionChange))
+    if (aChange == EFullscreenChange
+            || aChange == EResolutionChange
+            || aChange == EForegroundGained)
     {
         if (iUtils)
         {
@@ -2226,6 +2246,11 @@
         }
     }
 
+    if (aChange == EForegroundGained)
+    {
+        iEditingStateIndicator->MakeVisible(iEditingStateIndicator->EnabledState());
+    }
+
 #ifdef RD_JAVA_S60_RELEASE_9_2
     if (aChange == EPartialVKBChange)
     {