phonebookui/Phonebook2/UIControls/src/CPbk2NamesListFilteredState.cpp
branchRCL_3
changeset 18 d4f567ce2e7c
parent 13 a6539d1e8e43
equal deleted inserted replaced
17:2666d9724c76 18:d4f567ce2e7c
  1128 // --------------------------------------------------------------------------
  1128 // --------------------------------------------------------------------------
  1129 //    
  1129 //    
  1130 void CPbk2NamesListFilteredState::CmdItemVisibilityChanged( TInt aCmdItemId, TBool aVisible ) 
  1130 void CPbk2NamesListFilteredState::CmdItemVisibilityChanged( TInt aCmdItemId, TBool aVisible ) 
  1131     {
  1131     {
  1132     TInt cmdItemIndex = FindCommand(aCmdItemId);
  1132     TInt cmdItemIndex = FindCommand(aCmdItemId);
  1133     TRAP_IGNORE( HandleCommandEventL(
  1133     TInt cmdListBoxIndex = EnabledCommandCount();
       
  1134     if( aVisible )
       
  1135         {
       
  1136         cmdListBoxIndex--;
       
  1137         }
       
  1138     // Update the HiddenSelection property of the command items.
       
  1139     TListItemProperties prop( iListBox.ItemDrawer()->Properties(cmdListBoxIndex) );
       
  1140     prop.SetHiddenSelection(aVisible);
       
  1141     TRAP_IGNORE(        
       
  1142         iListBox.ItemDrawer()->SetPropertiesL(cmdListBoxIndex, prop);
       
  1143     
       
  1144         HandleCommandEventL(
  1134                 (aVisible ? EItemAdded : EItemRemoved),
  1145                 (aVisible ? EItemAdded : EItemRemoved),
  1135                  cmdItemIndex) );		
  1146                  cmdItemIndex);
       
  1147         );		
  1136     }
  1148     }
  1137 
  1149 
  1138 // --------------------------------------------------------------------------
  1150 // --------------------------------------------------------------------------
  1139 // CPbk2NamesListFilteredState::UpdateCommandEnabled
  1151 // CPbk2NamesListFilteredState::UpdateCommandEnabled
  1140 // --------------------------------------------------------------------------
  1152 // --------------------------------------------------------------------------
  1215         {
  1227         {
  1216         iListBox.View()->DeselectItem( i );
  1228         iListBox.View()->DeselectItem( i );
  1217         }
  1229         }
  1218     }
  1230     }
  1219 
  1231 
       
  1232 // --------------------------------------------------------------------------
       
  1233 // CPbk2NamesListFilteredState::EnabledCommandCount
       
  1234 // --------------------------------------------------------------------------
       
  1235 //  
       
  1236 TInt CPbk2NamesListFilteredState::EnabledCommandCount() const
       
  1237     {
       
  1238     TInt result = 0;
       
  1239     for ( TInt i = 0; i < iCommandItems.Count(); ++i )
       
  1240         {
       
  1241         if(iCommandItems[i]->IsEnabled())
       
  1242             {
       
  1243             result++;
       
  1244             }
       
  1245         }
       
  1246     return result;    
       
  1247     }
       
  1248 
  1220 //  End of File
  1249 //  End of File