javauis/lcdui_akn/lcdui/src/CMIDTextEditor.cpp
branchRCL_3
changeset 24 6c158198356e
parent 23 e5618cc85d74
equal deleted inserted replaced
23:e5618cc85d74 24:6c158198356e
   355         if (iUtils)
   355         if (iUtils)
   356         {
   356         {
   357             // It sets edwin variables necessary for correct clipping.
   357             // It sets edwin variables necessary for correct clipping.
   358             iTextEdwin->SetOnScreenCanvasRect(iUtils->GetOnScreenCanvasRect());
   358             iTextEdwin->SetOnScreenCanvasRect(iUtils->GetOnScreenCanvasRect());
   359             iTextEdwin->SetScaling(IsScalingOn());
   359             iTextEdwin->SetScaling(IsScalingOn());
   360     
   360 
   361             // It sets indicator variables necessary for correct clipping.
   361             // It sets indicator variables necessary for correct clipping.
   362             iEditingStateIndicator->SetScalingOn(IsScalingOn());
   362             iEditingStateIndicator->SetScalingOn(IsScalingOn());
   363             iEditingStateIndicator->SetCanvasRect(iUtils->GetOnScreenCanvasRect());
   363             iEditingStateIndicator->SetCanvasRect(iUtils->GetOnScreenCanvasRect());
   364         }
   364         }
   365     }
   365     }
   366     
   366 
   367     DEBUG("CMIDTextEditor::SetParentL -");
   367     DEBUG("CMIDTextEditor::SetParentL -");
   368 }
   368 }
   369 
   369 
   370 // ---------------------------------------------------------------------------
   370 // ---------------------------------------------------------------------------
   371 // CMIDTextEditor::SetDirectContainerL
   371 // CMIDTextEditor::SetDirectContainerL
   612             iTextEdwin->SetFocus(ETrue);
   612             iTextEdwin->SetFocus(ETrue);
   613             // Set focus automatically selects the editor's content
   613             // Set focus automatically selects the editor's content
   614             // Remove the selection at this point. The selection can be
   614             // Remove the selection at this point. The selection can be
   615             // set again with the API.
   615             // set again with the API.
   616             SetCursorPositionL(iTextEdwin->CursorPos());
   616             SetCursorPositionL(iTextEdwin->CursorPos());
   617             
   617 
   618             if (iEditingStateIndicator->EnabledState() ==
   618             if (iEditingStateIndicator->EnabledState() ==
   619                              CMIDEditingStateIndicator::EIndicatorStateRelative)
   619                     CMIDEditingStateIndicator::EIndicatorStateRelative)
   620             {
   620             {
   621                 // Enable the custom indicators as in Avkon if not controlled
   621                 // Enable the custom indicators as in Avkon if not controlled
   622                 // by the client application
   622                 // by the client application
   623                 iEditingStateIndicator->MakeVisible(ETrue);
   623                 iEditingStateIndicator->MakeVisible(ETrue);
   624             }
   624             }
  1427     {
  1427     {
  1428         TSize size = EditorSize();
  1428         TSize size = EditorSize();
  1429         TInt newEditorWindowHeight = iTextEdwin->EditorWindowHeight();
  1429         TInt newEditorWindowHeight = iTextEdwin->EditorWindowHeight();
  1430         if (size.iHeight != newEditorWindowHeight)
  1430         if (size.iHeight != newEditorWindowHeight)
  1431         {
  1431         {
  1432             SetEditorSize(size.iWidth, newEditorWindowHeight);
  1432             if (!IsScalingOn())
       
  1433             {
       
  1434                 SetEditorSize(size.iWidth, newEditorWindowHeight);
       
  1435             }
       
  1436             else if (iUtils)
       
  1437             {
       
  1438                 SetEditorSize(size.iWidth, iUtils->DoDescaling(newEditorWindowHeight, CMIDUtils::EVertical));
       
  1439             }
  1433         }
  1440         }
  1434         // SetEditorSize method resets the flag, make sure it remains true
  1441         // SetEditorSize method resets the flag, make sure it remains true
  1435         // here.
  1442         // here.
  1436         iRowCountActive = ETrue;
  1443         iRowCountActive = ETrue;
  1437     }
  1444     }
  2185             HandleChangeForScaling(EResolutionChange);
  2192             HandleChangeForScaling(EResolutionChange);
  2186         }
  2193         }
  2187     }
  2194     }
  2188 }
  2195 }
  2189 
  2196 
       
  2197 void CMIDTextEditor::HandleForeground(TBool aForeground)
       
  2198 {
       
  2199     // If Canvas goes to foreground and scaling is on,
       
  2200     // then we resize a TextEditor.
       
  2201     if (aForeground && iUtils && iComponentContainer && iUtils->IsScalingEnabled() &&
       
  2202             iComponentContainer->IsFullScreen())
       
  2203     {
       
  2204         HandleChangeForScaling(EForegroundGained);
       
  2205     }
       
  2206 }
       
  2207 
  2190 void CMIDTextEditor::HandleChangeForScaling(TChange aChange)
  2208 void CMIDTextEditor::HandleChangeForScaling(TChange aChange)
  2191 {
  2209 {
  2192     // It is needed to store iRowCountActive, because SetEditorSize resets it.
  2210     // It is needed to store iRowCountActive, because SetEditorSize resets it.
  2193     TBool rowCountActive = iRowCountActive;
  2211     TBool rowCountActive = iRowCountActive;
  2194 
  2212 
  2205     }
  2223     }
  2206 
  2224 
  2207     // restoring of iRowCountActive
  2225     // restoring of iRowCountActive
  2208     iRowCountActive = rowCountActive;
  2226     iRowCountActive = rowCountActive;
  2209 
  2227 
  2210     if ((aChange == EFullscreenChange) || (aChange == EResolutionChange))
  2228     if (aChange == EFullscreenChange
       
  2229             || aChange == EResolutionChange
       
  2230             || aChange == EForegroundGained)
  2211     {
  2231     {
  2212         if (iUtils)
  2232         if (iUtils)
  2213         {
  2233         {
  2214             // It sets edwin variable necessary for correct clipping.
  2234             // It sets edwin variable necessary for correct clipping.
  2215             iTextEdwin->SetOnScreenCanvasRect(iUtils->GetOnScreenCanvasRect());
  2235             iTextEdwin->SetOnScreenCanvasRect(iUtils->GetOnScreenCanvasRect());
  2224             iTextEdwin->SetScaling(IsScalingOn());
  2244             iTextEdwin->SetScaling(IsScalingOn());
  2225             iEditingStateIndicator->SetScalingOn(IsScalingOn());
  2245             iEditingStateIndicator->SetScalingOn(IsScalingOn());
  2226         }
  2246         }
  2227     }
  2247     }
  2228 
  2248 
       
  2249     if (aChange == EForegroundGained)
       
  2250     {
       
  2251         iEditingStateIndicator->MakeVisible(iEditingStateIndicator->EnabledState());
       
  2252     }
       
  2253 
  2229 #ifdef RD_JAVA_S60_RELEASE_9_2
  2254 #ifdef RD_JAVA_S60_RELEASE_9_2
  2230     if (aChange == EPartialVKBChange)
  2255     if (aChange == EPartialVKBChange)
  2231     {
  2256     {
  2232         if (iPartialVKBOpen)
  2257         if (iPartialVKBOpen)
  2233         {
  2258         {