calendarui/views/src/calenmissedalarmscontainer.cpp
branchRCL_3
changeset 13 1984aceb8774
parent 0 f979ecb2b13e
child 15 9711e452b5e9
equal deleted inserted replaced
11:0f07cd1b5772 13:1984aceb8774
   137     
   137     
   138     // Create scroll bar
   138     // Create scroll bar
   139     iListBox->CreateScrollBarFrameL(ETrue);
   139     iListBox->CreateScrollBarFrameL(ETrue);
   140     iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,
   140     iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,
   141             CEikScrollBarFrame::EAuto);
   141             CEikScrollBarFrame::EAuto);
   142 
   142     iListBox->SetListBoxObserver( this ); // single click changes MK
   143     // set the model array
   143     // set the model array
   144     iListBox->Model()->SetItemTextArray(iListBoxItemArray);
   144     iListBox->Model()->SetItemTextArray(iListBoxItemArray);
   145 
   145 
   146     // set icon array
   146     // set icon array
   147     CAknIconArray* iconArray = CreateIconsL( iIconIndices );
   147     CAknIconArray* iconArray = CreateIconsL( iIconIndices );
   459 
   459 
   460     switch (aPointerEvent.iType)
   460     switch (aPointerEvent.iType)
   461         {
   461         {
   462         case TPointerEvent::EButton1Down:
   462         case TPointerEvent::EButton1Down:
   463             {
   463             {
   464             TInt oldCursor = iListBox->View()->CurrentItemIndex();
   464             TBool isItem (iListBox->View()->XYPosToItemIndex(aPointerEvent.iPosition, pointerIndex));
   465             iListBox->HandlePointerEventL(aPointerEvent);
   465             
   466             TInt newCursor = iListBox->View()->CurrentItemIndex();
   466             if(isItem && MissedAlarmsCount() > 0)
   467 
       
   468             if (oldCursor != newCursor)
       
   469                 {
   467                 {
   470                 // set the context
   468                 iHighlightedRowNumber = iListBox->View()->CurrentItemIndex(); 
   471                 iHighlightedRowNumber = newCursor;
   469                 SetContextFromMissedAlarmEntryL(iListBox->View()->CurrentItemIndex());
   472                 SetContextFromMissedAlarmEntryL(newCursor);
       
   473                 iFirstTap = EFalse;
       
   474                 }
   470                 }
   475             else
   471             
   476                 {
       
   477                 iFirstTap = ETrue;
       
   478                 }
       
   479             break;
   472             break;
   480             }
   473             }
   481         case TPointerEvent::EDrag:
   474         case TPointerEvent::EDrag:
   482             {
   475             {
   483             iListBox->HandlePointerEventL(aPointerEvent);
   476             /*iListBox->HandlePointerEventL(aPointerEvent);
   484             if (iFirstTap && index != iListBox->CurrentItemIndex())
   477             if (iFirstTap && index != iListBox->CurrentItemIndex())
   485                 {
   478                 {
   486                 iFirstTap = EFalse;
   479                 iFirstTap = EFalse;
       
   480                 }*/
       
   481             break;
       
   482             }
       
   483 
       
   484         case TPointerEvent::EButton1Up:
       
   485             {
       
   486            // if (iFirstTap)
       
   487                 {
       
   488                // iView->HandleCommandL(ECalenMissedEventView);
   487                 }
   489                 }
   488             break;
   490             break;
   489             }
   491             }
   490 
       
   491         case TPointerEvent::EButton1Up:
       
   492             {
       
   493             if (iFirstTap)
       
   494                 {
       
   495                 iView->HandleCommandL(ECalenMissedEventView);
       
   496                 }
       
   497             break;
       
   498             }
       
   499         default:
   492         default:
   500             break;
   493             break;
   501         }
   494         }
   502 
   495 
       
   496    if ( aPointerEvent.iType != TPointerEvent::EButtonRepeat )
       
   497         {
       
   498         iListBox->HandlePointerEventL( aPointerEvent );
       
   499         }
       
   500   
   503     TRACE_EXIT_POINT;
   501     TRACE_EXIT_POINT;
   504     }
   502     }
   505 
   503 
   506 // ----------------------------------------------------------------------------
   504 // ----------------------------------------------------------------------------
   507 // CCalenMissedAlarmsContainer::HandleNaviDecoratorEventL
   505 // CCalenMissedAlarmsContainer::HandleNaviDecoratorEventL
   950 
   948 
   951     TRACE_EXIT_POINT;
   949     TRACE_EXIT_POINT;
   952     return KErrNotFound;
   950     return KErrNotFound;
   953     }
   951     }
   954 
   952 
       
   953 
       
   954 void CCalenMissedAlarmsContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, 
       
   955                                                       TListBoxEvent aEventType)
       
   956     {
       
   957     TRACE_ENTRY_POINT;
       
   958     switch( aEventType )
       
   959         {
       
   960         // Single click integration
       
   961         case EEventItemSingleClicked:
       
   962             {
       
   963              iHighlightedRowNumber = iListBox->View()->CurrentItemIndex();
       
   964             
       
   965               SetContextFromMissedAlarmEntryL(iListBox->View()->CurrentItemIndex());
       
   966             //Handle listbox item selection event
       
   967            // iListBox->HandlePointerEventL(aPointerEvent);
       
   968             if(iView->MenuBar()->IsDisplayed() == EFalse)
       
   969                 {
       
   970                 iView->HandleCommandL( ECalenMissedEventView );
       
   971                 }
       
   972             break;
       
   973             }
       
   974             
       
   975         // Single click integration
       
   976         case EEventEnterKeyPressed:
       
   977             {
       
   978             iHighlightedRowNumber = iListBox->View()->CurrentItemIndex();
       
   979             
       
   980               SetContextFromMissedAlarmEntryL(iListBox->View()->CurrentItemIndex());
       
   981             iView->HandleCommandL( ECalenMissedEventView );
       
   982             break;
       
   983             }
       
   984         default:
       
   985             break;
       
   986         };
       
   987     TRACE_EXIT_POINT;
       
   988     }
       
   989 
       
   990 
       
   991 
   955 // End of File
   992 // End of File