landmarksui/app/src/CLmkCategorySettingsView.cpp
branchRCL_3
changeset 6 91123d004e8f
parent 0 522cd55cc3d7
child 16 8173571d354e
equal deleted inserted replaced
5:41042d2af523 6:91123d004e8f
   303 // CLmkCategorySettingsView::HandleListBoxEventL()
   303 // CLmkCategorySettingsView::HandleListBoxEventL()
   304 // ---------------------------------------------------------
   304 // ---------------------------------------------------------
   305 //
   305 //
   306 void CLmkCategorySettingsView::HandleListBoxEventL(CEikListBox* aListBox,
   306 void CLmkCategorySettingsView::HandleListBoxEventL(CEikListBox* aListBox,
   307         TListBoxEvent aEventType)
   307         TListBoxEvent aEventType)
   308     {
   308     {    
       
   309     TInt count(aListBox->Model()->NumberOfItems());
       
   310     if( count == 0 )    
       
   311         return;
       
   312     
       
   313     TInt markedCount = aListBox->SelectionIndexes()->Count();
       
   314     
   309     switch (aEventType)
   315     switch (aEventType)
   310         {
   316         {
   311         //case EEventItemDoubleClicked:
       
   312         case EEventItemSingleClicked:
   317         case EEventItemSingleClicked:
   313             {
   318             {
   314             if( aListBox->SelectionIndexes()->Count() > 0 )
   319             if( markedCount > 0 )
   315                 {
   320                 {
   316                 CEikMenuBar* menubar = MenuBar();
   321                 CEikMenuBar* menubar = MenuBar();
   317                 if (menubar)
   322                 if (menubar)
   318                     {
   323                     {
   319                     menubar->SetContextMenuTitleResourceId(R_LMK_CATEGORY_SETTINGS_OK_MENUBAR);
   324                     menubar->SetContextMenuTitleResourceId(R_LMK_CATEGORY_SETTINGS_OK_MENUBAR);
   320                     TRAP_IGNORE( menubar->TryDisplayContextMenuBarL() );
   325                     TRAP_IGNORE( menubar->TryDisplayContextMenuBarL() );
   321                     }            
   326                     }            
   322                 }                
   327                 }
   323             break;
   328             else
   324             }
   329                 {
   325         //case EEventItemClicked:
   330                 CLmkAppCategorySettingsImpl& LCategorySettingsImpl =
   326         case EEventPanningStarted:
   331                         iContainer->SelectorImpl();
   327         case EEventPanningStopped:
   332                 // Checkif the category is a global category only when some items present
   328         case EEventFlickStarted:
   333                 TBool retVal = LCategorySettingsImpl.IsPredefinedCategoryL();
   329         case EEventFlickStopped:
   334                 if( retVal  )
   330         case EEventPenDownOnItem:
   335                     HandleCommandL( ELmkCmdChangeIcon );                
   331         case EEventItemDraggingActioned:
   336                 else
   332             {
   337                     HandleCommandL( ELmkCmdRenameCat );                
       
   338                 }            
   333             break;
   339             break;
   334             }
   340             }
   335         default:
   341         default:
   336             break;
   342             break;
   337         }
   343         }