javauis/lcdui_akn/lcdui/src/CMIDForm.cpp
branchRCL_3
changeset 71 d5e927d5853b
parent 66 2455ef1f5bbc
child 77 7cee158cb8cd
equal deleted inserted replaced
66:2455ef1f5bbc 71:d5e927d5853b
  2070 }
  2070 }
  2071 
  2071 
  2072 CMIDForm::CMIDForm(MMIDEnv& aEnv, CMIDDisplayable& aDisplayable)
  2072 CMIDForm::CMIDForm(MMIDEnv& aEnv, CMIDDisplayable& aDisplayable)
  2073         : iDisplayable(aDisplayable), iEnv(&aEnv), iFocused(KErrNotFound),
  2073         : iDisplayable(aDisplayable), iEnv(&aEnv), iFocused(KErrNotFound),
  2074         iInitialAlignment(MMIDItem::ELeft), iHasScrolled(EFalse),
  2074         iInitialAlignment(MMIDItem::ELeft), iHasScrolled(EFalse),
  2075         iLastFadeMessage(0)
  2075         iLastFadeMessage(0),
       
  2076         iLastPointedControl(KErrNotFound)
  2076 {
  2077 {
  2077 }
  2078 }
  2078 
  2079 
  2079 CMIDForm::~CMIDForm()
  2080 CMIDForm::~CMIDForm()
  2080 {
  2081 {
  3376         }
  3377         }
  3377 
  3378 
  3378         // add any additional row breaks if needed
  3379         // add any additional row breaks if needed
  3379         InsertNewlinesL(NumNewLinesAfter(ci), &ci);
  3380         InsertNewlinesL(NumNewLinesAfter(ci), &ci);
  3380     }
  3381     }
       
  3382 
       
  3383     // Restore pointed control
       
  3384     if (iLastPointedControl != KErrNotFound)
       
  3385     {
       
  3386         iPointedControl = &ControlItem(iLastPointedControl);
       
  3387     }
  3381 }
  3388 }
  3382 
  3389 
  3383 /** Return true if the item is an unconstrained string item, false otherwise */
  3390 /** Return true if the item is an unconstrained string item, false otherwise */
  3384 TBool CMIDForm::ItemIsUnconstrained(TInt aIndex) const
  3391 TBool CMIDForm::ItemIsUnconstrained(TInt aIndex) const
  3385 {
  3392 {
  3728     // To avoid any problems with using iPointedControl, which
  3735     // To avoid any problems with using iPointedControl, which
  3729     // could points to invalid object (e.g. used in
  3736     // could points to invalid object (e.g. used in
  3730     // CMIDForm::HandleHighlightTimer or
  3737     // CMIDForm::HandleHighlightTimer or
  3731     // in CMIDForm::HandlePhysicsPointerEventL),
  3738     // in CMIDForm::HandlePhysicsPointerEventL),
  3732     // iPointedControl must be set to NULL.
  3739     // iPointedControl must be set to NULL.
       
  3740     if (iPointedControl)
       
  3741     {
       
  3742         // Store the index to last poited control. It will
       
  3743         // be restored after item are placed to new rows
       
  3744         // (see CMIDForm::AssignItemsToRowsL).
       
  3745         iLastPointedControl = ItemIndex(*iPointedControl);
       
  3746     }
  3733     iPointedControl = NULL;
  3747     iPointedControl = NULL;
  3734 
  3748 
  3735     for (TInt i=0; i < iRows.Count(); i++)
  3749     for (TInt i=0; i < iRows.Count(); i++)
  3736     {
  3750     {
  3737         delete iRows[i];
  3751         delete iRows[i];