photosgallery/viewframework/views/viewbase/src/glxtoolbarcontroller.cpp
branchRCL_3
changeset 23 b023a8d2866a
parent 21 f9e827349359
child 24 ea65f74e6de4
equal deleted inserted replaced
21:f9e827349359 23:b023a8d2866a
   181 //
   181 //
   182 void CGlxToolbarController::HandleItemSelectedL(TInt /*aIndex*/, TBool /*aSelected*/, 
   182 void CGlxToolbarController::HandleItemSelectedL(TInt /*aIndex*/, TBool /*aSelected*/, 
   183         MGlxMediaList* aList)
   183         MGlxMediaList* aList)
   184     {
   184     {
   185     TRACER("CGlxToolbarController::HandleItemSelectedL");
   185     TRACER("CGlxToolbarController::HandleItemSelectedL");
   186     
   186     GLX_DEBUG2("CGlxToolbarController::HandleItemSelectedL()"
       
   187             " aList->SelectionCount()=%d", aList->SelectionCount());
       
   188 
   187     // If atleast 1 item is marked, or if Mark All is called, then Latch the mark button.
   189     // If atleast 1 item is marked, or if Mark All is called, then Latch the mark button.
   188     if((aList->SelectionCount() == 1 ) || (aList->SelectionCount() == aList->Count()))
   190     if ((aList->SelectionCount() == 1) || (aList->SelectionCount()
   189         {
   191             == aList->Count()))
   190         EnableLatch( EGlxCmdStartMultipleMarking, ETrue );
   192         {
       
   193         EnableLatch(EGlxCmdStartMultipleMarking, ETrue);
       
   194         }
       
   195     else if (aList->SelectionCount() == 0)
       
   196         {
       
   197         EnableLatch(EGlxCmdStartMultipleMarking, EFalse);
   191         }
   198         }
   192     }
   199     }
   193 
   200 
   194 //----------------------------------------------------------------------------
   201 //----------------------------------------------------------------------------
   195 // HandleMessageL
   202 // HandleMessageL
   333 // EnableLatch
   340 // EnableLatch
   334 //----------------------------------------------------------------------------
   341 //----------------------------------------------------------------------------
   335 //
   342 //
   336 void CGlxToolbarController::EnableLatch( TInt aCommandId, TInt aLatched )
   343 void CGlxToolbarController::EnableLatch( TInt aCommandId, TInt aLatched )
   337     {
   344     {
   338     CAknButton* toolbarButton = static_cast<CAknButton*>
   345     TRACER("CGlxToolbarController::EnableLatch()");
   339                                 (iToolbar->ControlOrNull( aCommandId ));
   346     GLX_DEBUG2("CGlxToolbarController::EnableLatch() aLatched=%d", aLatched);
   340 
   347 
   341     if( toolbarButton )
   348     CAknButton* toolbarButton =
   342         {
   349             static_cast<CAknButton*> (iToolbar->ControlOrNull(aCommandId));
   343         if (aLatched)
   350 
   344             {
   351     if (toolbarButton && !toolbarButton->IsDimmed())
   345             toolbarButton->SetCurrentState(ETrue, ETrue);
   352         {
   346             }
   353         toolbarButton->SetCurrentState(aLatched, ETrue);
   347         else
   354         // Force to update the frame IDs 
   348             {
   355         toolbarButton->SetDimmed(EFalse);
   349             toolbarButton->SetCurrentState(EFalse, ETrue);
       
   350             }
       
   351         }
   356         }
   352     }
   357     }
   353 
   358 
   354 // ----------------------------------------------------------------------------
   359 // ----------------------------------------------------------------------------
   355 // HandlePopulatedL
   360 // HandlePopulatedL