javauis/lcdui_akn/lcdui/src/CMIDForm.cpp
branchRCL_3
changeset 23 e5618cc85d74
parent 18 9ac0a0a7da70
child 24 6c158198356e
equal deleted inserted replaced
21:4376525cdefb 23:e5618cc85d74
   178     // to first item which is focusable. Once the item has focus,
   178     // to first item which is focusable. Once the item has focus,
   179     // we can skip this step.
   179     // we can skip this step.
   180     if (iFocused == KErrNotFound)
   180     if (iFocused == KErrNotFound)
   181     {
   181     {
   182         SetFocusedItem(ci.IsSelectable() ? aIndex : KErrNotFound);
   182         SetFocusedItem(ci.IsSelectable() ? aIndex : KErrNotFound);
       
   183     }
       
   184     else if (aIndex <= iFocused)
       
   185     {
       
   186         // If new item is inserted to Form above the current item,
       
   187         // index must increase
       
   188         iFocused++;
   183     }
   189     }
   184 
   190 
   185     RequestLayoutL();
   191     RequestLayoutL();
   186 }
   192 }
   187 
   193 
  1975     TInt focusIndexDelta = aFocusIdx - iFocused;
  1981     TInt focusIndexDelta = aFocusIdx - iFocused;
  1976     if (iFocused != KErrNotFound)
  1982     if (iFocused != KErrNotFound)
  1977     { // actions for the item loosing focus
  1983     { // actions for the item loosing focus
  1978         CMIDControlItem& control = ControlItem(iFocused);
  1984         CMIDControlItem& control = ControlItem(iFocused);
  1979         control.PostFocusTransferEvent(EFalse, aDirection);
  1985         control.PostFocusTransferEvent(EFalse, aDirection);
       
  1986         // setting highlight must be called before setting focus
       
  1987         control.SetHighlight(EFalse);
  1980         control.SetFocus(EFalse);
  1988         control.SetFocus(EFalse);
  1981         UpdateItemCommands(NULL, NULL);
  1989         UpdateItemCommands(NULL, NULL);
  1982     }
  1990     }
  1983 
  1991 
  1984     iFocused = aFocusIdx;
  1992     iFocused = aFocusIdx;
  2007         CMIDControlItem& control = ControlItem(iFocused);
  2015         CMIDControlItem& control = ControlItem(iFocused);
  2008 
  2016 
  2009         SetHighlightBackgroundRects();
  2017         SetHighlightBackgroundRects();
  2010 
  2018 
  2011         control.PostFocusTransferEvent(ETrue, aDirection);
  2019         control.PostFocusTransferEvent(ETrue, aDirection);
       
  2020         control.SetHighlight(ETrue);
  2012         control.SetFocus(ETrue);
  2021         control.SetFocus(ETrue);
  2013         // msk: deliver also the possible MSK command to displayable
  2022         // msk: deliver also the possible MSK command to displayable
  2014         UpdateItemCommands(control.CommandList(), control.GetMSKCommand());
  2023         UpdateItemCommands(control.CommandList(), control.GetMSKCommand());
  2015     }
  2024     }
  2016 }
  2025 }
  2303                                     KAknsIIDQsnBgAreaMainListGene, Rect(), ETrue,
  2312                                     KAknsIIDQsnBgAreaMainListGene, Rect(), ETrue,
  2304                                     KAknsIIDQsnBgColumnAB, Rect())  ;  // Rect parameters are only place-holders
  2313                                     KAknsIIDQsnBgColumnAB, Rect())  ;  // Rect parameters are only place-holders
  2305 
  2314 
  2306     // Background for highlighted item, frame rects are set later
  2315     // Background for highlighted item, frame rects are set later
  2307     iHighlightedBackgroundCc = CAknsFrameBackgroundControlContext::NewL(
  2316     iHighlightedBackgroundCc = CAknsFrameBackgroundControlContext::NewL(
       
  2317 #ifdef RD_JAVA_S60_RELEASE_9_2
       
  2318                                    KAknsIIDQsnFrPopupPreview,
       
  2319 #else
  2308                                    KAknsIIDQsnFrInput,
  2320                                    KAknsIIDQsnFrInput,
       
  2321 #endif // RD_JAVA_S60_RELEASE_9_2
  2309                                    TRect(), TRect(), ETrue);
  2322                                    TRect(), TRect(), ETrue);
  2310 
  2323 
  2311     iDisplayable.SetComponentL(*this);
  2324     iDisplayable.SetComponentL(*this);
  2312 
  2325 
  2313     // get the layout from shared data so we can tell what our
  2326     // get the layout from shared data so we can tell what our