equal
deleted
inserted
replaced
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 TInt cmdListBoxIndex = EnabledCommandCount(); |
1133 TRAP_IGNORE( HandleCommandEventL( |
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( |
|
1145 (aVisible ? EItemAdded : EItemRemoved), |
1134 (aVisible ? EItemAdded : EItemRemoved), |
1146 cmdItemIndex); |
1135 cmdItemIndex) ); |
1147 ); |
|
1148 } |
1136 } |
1149 |
1137 |
1150 // -------------------------------------------------------------------------- |
1138 // -------------------------------------------------------------------------- |
1151 // CPbk2NamesListFilteredState::UpdateCommandEnabled |
1139 // CPbk2NamesListFilteredState::UpdateCommandEnabled |
1152 // -------------------------------------------------------------------------- |
1140 // -------------------------------------------------------------------------- |
1227 { |
1215 { |
1228 iListBox.View()->DeselectItem( i ); |
1216 iListBox.View()->DeselectItem( i ); |
1229 } |
1217 } |
1230 } |
1218 } |
1231 |
1219 |
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 |
|
1249 // End of File |
1220 // End of File |