javauis/eswt_akn/org.eclipse.ercp.swt.s60/native/src/swtlistview.cpp
branchRCL_3
changeset 24 0fd27995241b
parent 19 04becd199f91
child 34 71c436fe3ce0
equal deleted inserted replaced
20:f9bb0fca356a 24:0fd27995241b
   190                      CEikListBox::ES60StyleMultiselection |
   190                      CEikListBox::ES60StyleMultiselection |
   191                      CEikListBox::EShiftEnterMarks;
   191                      CEikListBox::EShiftEnterMarks;
   192 #else
   192 #else
   193         gridFlags |= EAknListBoxMarkableGrid;
   193         gridFlags |= EAknListBoxMarkableGrid;
   194 #endif
   194 #endif
       
   195         // Enabling marking only by pressing enter key
       
   196         gridFlags |= CEikListBox::EEnterMarks;
   195 
   197 
   196         // Create control menu
   198         // Create control menu
   197         iMenu = CSwtControlMenu::NewL(iDisplay, NULL, 0);
   199         iMenu = CSwtControlMenu::NewL(iDisplay, NULL, 0);
   198 
   200 
   199         iMenuItemEditList = CSwtMenuItem::NewL(iDisplay, NULL, *iMenu, 0, 0);
   201         iMenuItemEditList = CSwtMenuItem::NewL(iDisplay, NULL, *iMenu, 0, 0);
  2687     }
  2689     }
  2688     else  // Multi-style
  2690     else  // Multi-style
  2689     {
  2691     {
  2690         GetSelection(iOldSelectionArray);
  2692         GetSelection(iOldSelectionArray);
  2691 
  2693 
  2692         TBool shiftKeyPressed = (aKeyEvent.iModifiers & EModifierShift) ||
  2694         iGrid->OfferKeyEventL(aKeyEvent, aType);
  2693                                 (aKeyEvent.iModifiers & EModifierLeftShift) ||
       
  2694                                 (aKeyEvent.iModifiers & EModifierRightShift);
       
  2695 
       
  2696         // Do not offer menu opening ok key event to the grid
       
  2697         if ((aKeyEvent.iCode != EKeyOK && aKeyEvent.iCode != EKeyEnter) || shiftKeyPressed)
       
  2698         {
       
  2699             iGrid->OfferKeyEventL(aKeyEvent, aType);
       
  2700         }
       
  2701 
  2695 
  2702         if (aType == EEventKeyUp)
  2696         if (aType == EEventKeyUp)
  2703         {
  2697         {
  2704             UpdateControlMenu();
  2698             UpdateControlMenu();
  2705         }
  2699         }
  2929     {
  2923     {
  2930         return EFalse;
  2924         return EFalse;
  2931     }
  2925     }
  2932     else if (aKeyCode == EKeyOK || aKeyCode == EKeyEnter)
  2926     else if (aKeyCode == EKeyOK || aKeyCode == EKeyEnter)
  2933     {
  2927     {
  2934         if (iStyle & KSwtStyleSingle)
  2928         MSwtCommandArranger* commandArranger = iDisplay.CommandArranger();
  2935         {
  2929         if (commandArranger)
  2936             MSwtCommandArranger* commandArranger = iDisplay.CommandArranger();
  2930         {
  2937             if (commandArranger)
  2931             if (iStyle & KSwtStyleSingle &&
       
  2932                     commandArranger->IsContextSensitiveOperationSet())
  2938             {
  2933             {
  2939                 if (commandArranger->IsContextSensitiveOperationSet())
  2934                 return EFalse;
  2940                 {
       
  2941                     return EFalse;
       
  2942                 }
       
  2943             }
  2935             }
  2944             return ETrue;
  2936         }
  2945         }
  2937         return ETrue;
  2946         else
       
  2947         {
       
  2948             return EFalse;
       
  2949         }
       
  2950     }
  2938     }
  2951     return ETrue;
  2939     return ETrue;
  2952 }
  2940 }
  2953 
  2941 
  2954 TBool CSwtListView::MSKSelCmdEnabled() const
  2942 TBool CSwtListView::MSKSelCmdEnabled() const