javauis/lcdui_akn/lcdui/src/CMIDTextEditor.cpp
branchRCL_3
changeset 46 4376525cdefb
parent 25 9ac0a0a7da70
child 59 e5618cc85d74
equal deleted inserted replaced
34:71c436fe3ce0 46:4376525cdefb
    27 #include "CMIDTextEditorEdwin.h"
    27 #include "CMIDTextEditorEdwin.h"
    28 #include "CMIDEditingStateIndicator.h"
    28 #include "CMIDEditingStateIndicator.h"
    29 #include "CMIDEdwinUtils.h"
    29 #include "CMIDEdwinUtils.h"
    30 #include "CMIDUtils.h"
    30 #include "CMIDUtils.h"
    31 #include "CMIDFont.h"
    31 #include "CMIDFont.h"
       
    32 #include "CMIDDisplayable.h"
    32 
    33 
    33 // Default background color.
    34 // Default background color.
    34 const TInt KDefColorBgRed       = 0;
    35 const TInt KDefColorBgRed       = 0;
    35 const TInt KDefColorBgGreen     = 0;
    36 const TInt KDefColorBgGreen     = 0;
    36 const TInt KDefColorBgBlue      = 0;
    37 const TInt KDefColorBgBlue      = 0;
   300         CCoeControl& control = aComponentContainer->Control();
   301         CCoeControl& control = aComponentContainer->Control();
   301         // Register container window for the editor.
   302         // Register container window for the editor.
   302         iTextEdwin->SetContainerWindowL(control);
   303         iTextEdwin->SetContainerWindowL(control);
   303         iTextEdwin->SetTopParent(&control);
   304         iTextEdwin->SetTopParent(&control);
   304         // Initialize the editor window.
   305         // Initialize the editor window.
   305         iTextEdwin->InitializeL();
   306         CMIDDisplayable* displayable = NULL;
       
   307 #ifdef RD_JAVA_S60_RELEASE_9_2
       
   308         displayable = aComponentContainer->GetDisplayable();
       
   309 #endif // RD_JAVA_S60_RELEASE_9_2
       
   310         iTextEdwin->InitializeL(displayable);
   306         // Set container window also for the indicator.
   311         // Set container window also for the indicator.
   307         iEditingStateIndicator->SetContainerWindowL(&control);
   312         iEditingStateIndicator->SetContainerWindowL(&control);
   308 
   313 
   309         // Register this custom component to the container.
   314         // Register this custom component to the container.
   310         aComponentContainer->RegisterComponentL(this);
   315         aComponentContainer->RegisterComponentL(this);
   605     else if (!(aFocusState) && (iFocusState))
   610     else if (!(aFocusState) && (iFocusState))
   606     {
   611     {
   607         // Remove focus if the text editor is focused.
   612         // Remove focus if the text editor is focused.
   608         iFocusState = EFalse;
   613         iFocusState = EFalse;
   609 
   614 
       
   615 #ifdef RD_JAVA_S60_RELEASE_9_2
       
   616         iTextEdwin->FocusLost();
       
   617 #endif // RD_JAVA_S60_RELEASE_9_2
       
   618 
   610         // Call SetFocus on edwin
   619         // Call SetFocus on edwin
   611         iTextEdwin->SetFocus(EFalse);
   620         iTextEdwin->SetFocus(EFalse);
   612 
   621 
   613         if (iComponentContainer)
   622         if (iComponentContainer)
   614         {
   623         {
  1647 //
  1656 //
  1648 void CMIDTextEditor::Dispose()
  1657 void CMIDTextEditor::Dispose()
  1649 {
  1658 {
  1650     DEBUG("CMIDTextEditor::Dispose +");
  1659     DEBUG("CMIDTextEditor::Dispose +");
  1651 
  1660 
       
  1661 #ifdef RD_JAVA_S60_RELEASE_9_2
       
  1662     if (iFocusState)
       
  1663     {
       
  1664         iTextEdwin->CloseVKB();
       
  1665     }
       
  1666 #endif // RD_JAVA_S60_RELEASE_9_2
  1652     delete this;
  1667     delete this;
  1653 
       
  1654     DEBUG("CMIDTextEditor::Dispose -");
  1668     DEBUG("CMIDTextEditor::Dispose -");
  1655 }
  1669 }
  1656 
  1670 
  1657 // ---------------------------------------------------------------------------
  1671 // ---------------------------------------------------------------------------
  1658 // CMIDTextEditor::MdcContainerWindowRectChanged
  1672 // CMIDTextEditor::MdcContainerWindowRectChanged
  1948         iEditingStateIndicator->SetPosition(x, y);
  1962         iEditingStateIndicator->SetPosition(x, y);
  1949 
  1963 
  1950         // Update the indicator.
  1964         // Update the indicator.
  1951         if (iTextEdwin->IsVisible() && iTextEdwin->IsFocused())
  1965         if (iTextEdwin->IsVisible() && iTextEdwin->IsFocused())
  1952         {
  1966         {
       
  1967             if (iComponentContainer &&
       
  1968                     iComponentContainer->IsFullScreen())
       
  1969             {
       
  1970                 iEditingStateIndicator->MakeVisible(ETrue);
       
  1971             }
  1953             iEditingStateIndicator->Redraw();
  1972             iEditingStateIndicator->Redraw();
  1954         }
  1973         }
  1955         else
  1974         else
  1956         {
  1975         {
  1957             iEditingStateIndicator->MakeVisible(EFalse);
  1976             iEditingStateIndicator->MakeVisible(EFalse);
  2026         CEikEdwin::EInclusiveSizeFixed;
  2045         CEikEdwin::EInclusiveSizeFixed;
  2027 
  2046 
  2028     if (aParams.iHeightInRows)
  2047     if (aParams.iHeightInRows)
  2029     {
  2048     {
  2030         // Height is specified using rows.
  2049         // Height is specified using rows.
  2031         iTextEdwin->ConstructL(
  2050         iTextEdwin->ConstructL(flags, aParams.iWidth,
  2032             flags, aParams.iWidth, aParams.iMaxSize, aParams.iHeight);
  2051                                aParams.iMaxSize, aParams.iHeight);
  2033         iRowCountActive = ETrue;
  2052         iRowCountActive = ETrue;
  2034         iRowCount = aParams.iHeight;
  2053         iRowCount = aParams.iHeight;
  2035 
  2054 
  2036         // Editor size is too wide when created with rows. Adjust the width
  2055         // Editor size is too wide when created with rows. Adjust the width
  2037         // accordingly again after construction. Note that SetEditorSize()
  2056         // accordingly again after construction. Note that SetEditorSize()