175 { |
175 { |
176 if ( iItemActionMenu ) |
176 if ( iItemActionMenu ) |
177 { |
177 { |
178 TBool dimCommands( EFalse ); |
178 TBool dimCommands( EFalse ); |
179 TBool changeState( EFalse ); |
179 TBool changeState( EFalse ); |
|
180 TBool dimMarkAndUnmark( EFalse ); |
180 if ( iItemActionMenu->MarkingMode().MultipleMarkingActive() ) |
181 if ( iItemActionMenu->MarkingMode().MultipleMarkingActive() ) |
181 { |
182 { |
182 changeState = ETrue; |
183 changeState = ETrue; |
183 dimCommands = EFalse; |
184 dimCommands = EFalse; |
184 } |
185 } |
185 else if ( !iItemActionMenu->CollectionHighlightVisible() ) |
186 else if ( !iItemActionMenu->CollectionHighlightVisible() ) |
186 { |
187 { |
187 changeState = ETrue; |
188 if ( iItemActionMenu->CollectionHasMarkedItems() ) |
188 dimCommands = ETrue; |
189 { |
|
190 TInt pos; |
|
191 if ( iBar->iMenuPane->MenuItemExists( EAknCmdMark, pos ) ) |
|
192 { |
|
193 iBar->iMenuPane->SetItemDimmed( EAknCmdMark, ETrue ); |
|
194 } |
|
195 if ( iBar->iMenuPane->MenuItemExists( EAknCmdUnmark, pos ) ) |
|
196 { |
|
197 iBar->iMenuPane->SetItemDimmed( EAknCmdUnmark, ETrue ); |
|
198 } |
|
199 dimMarkAndUnmark = ETrue; |
|
200 } |
|
201 else |
|
202 { |
|
203 changeState = ETrue; |
|
204 dimCommands = ETrue; |
|
205 } |
189 } |
206 } |
190 if ( changeState ) |
207 if ( changeState ) |
191 { |
208 { |
192 iBar->iMenuPane->SetItemCommandsStateL( dimCommands ); |
209 iBar->iMenuPane->SetItemCommandsStateL( dimCommands ); |
193 } |
210 } |
|
211 iBar->iMenuPane->HideMarkAndUnmark( dimMarkAndUnmark ); |
194 } |
212 } |
195 else if ( iSingleClickEnabled ) |
213 else if ( iSingleClickEnabled ) |
196 { |
214 { |
197 // Dim tagged item action and item specific commands |
215 // Dim tagged item action and item specific commands |
198 // anyway, fixes case where listbox creation is not |
216 // anyway, fixes case where listbox creation is not |
971 if ( fepMenuObserver ) |
989 if ( fepMenuObserver ) |
972 fepMenuObserver->DynInitMenuPaneL( |
990 fepMenuObserver->DynInitMenuPaneL( |
973 ( *iTitleArray )[ titles ]->iData.iMenuPaneResourceId, |
991 ( *iTitleArray )[ titles ]->iData.iMenuPaneResourceId, |
974 iMenuPane ); |
992 iMenuPane ); |
975 if ( iActiveEditMenuObserver ) |
993 if ( iActiveEditMenuObserver ) |
|
994 { |
976 iActiveEditMenuObserver->DynInitMenuPaneL( |
995 iActiveEditMenuObserver->DynInitMenuPaneL( |
977 ( *iTitleArray )[ titles ]->iData.iMenuPaneResourceId, |
996 ( *iTitleArray )[ titles ]->iData.iMenuPaneResourceId, |
978 iMenuPane ); |
997 iMenuPane ); |
|
998 } |
979 |
999 |
980 titles = iTitleArray->Count() - 2; |
1000 titles = iTitleArray->Count() - 2; |
981 iMenuPane->FilterDimmedItems(); |
1001 iMenuPane->FilterDimmedItems(); |
982 |
1002 |
983 // Add the remaining menu panes from right to left |
1003 // Add the remaining menu panes from right to left |
989 iMenuPane->AddMenuItemsL( resource, 0, ETrue ); |
1009 iMenuPane->AddMenuItemsL( resource, 0, ETrue ); |
990 iMenuObserver->DynInitMenuPaneL( resource, iMenuPane ); |
1010 iMenuObserver->DynInitMenuPaneL( resource, iMenuPane ); |
991 if ( fepMenuObserver ) |
1011 if ( fepMenuObserver ) |
992 fepMenuObserver->DynInitMenuPaneL( resource, iMenuPane ); |
1012 fepMenuObserver->DynInitMenuPaneL( resource, iMenuPane ); |
993 if ( iActiveEditMenuObserver ) |
1013 if ( iActiveEditMenuObserver ) |
|
1014 { |
994 iActiveEditMenuObserver->DynInitMenuPaneL( |
1015 iActiveEditMenuObserver->DynInitMenuPaneL( |
995 resource,iMenuPane ); |
1016 resource,iMenuPane ); |
|
1017 } |
996 |
1018 |
997 if ( resource == R_AVKON_MENUPANE_MARK_MULTIPLE ) |
1019 if ( resource == R_AVKON_MENUPANE_MARK_MULTIPLE ) |
998 { |
1020 { |
999 iMenuPane->SetItemDimmed( EAknCmdMarkingModeMarkOne, ETrue ); |
1021 iMenuPane->SetItemDimmed( EAknCmdMarkingModeMarkOne, ETrue ); |
1000 } |
1022 } |
1001 |
1023 iMenuPane->FilterDimmedItems(); |
1002 titles--; |
1024 titles--; |
1003 } |
1025 } |
1004 iExt->SetItemCommandsStateL(); |
1026 iExt->SetItemCommandsStateL(); |
1005 iMenuPane->FilterDimmedItems(); |
1027 iMenuPane->FilterDimmedItems(); |
1006 } |
1028 } |
1098 iMenuPane->SetSelectedItem( 0 ); |
1120 iMenuPane->SetSelectedItem( 0 ); |
1099 } |
1121 } |
1100 |
1122 |
1101 iMenuPane->SetFocus(ETrue); |
1123 iMenuPane->SetFocus(ETrue); |
1102 if (fepMenuObserver) |
1124 if (fepMenuObserver) |
|
1125 { |
1103 fepMenuObserver->SetEmphasis(this, ETrue); |
1126 fepMenuObserver->SetEmphasis(this, ETrue); |
|
1127 } |
1104 if (iActiveEditMenuObserver) |
1128 if (iActiveEditMenuObserver) |
|
1129 { |
1105 iActiveEditMenuObserver->SetEmphasis(this, ETrue); |
1130 iActiveEditMenuObserver->SetEmphasis(this, ETrue); |
|
1131 } |
1106 |
1132 |
1107 // Set the position of the menu pane to the top of the CBA area, |
1133 // Set the position of the menu pane to the top of the CBA area, |
1108 // and set the width to the width of the screen |
1134 // and set the width to the width of the screen |
1109 TPoint menuPosition = TPoint(0, screenSize.iHeight - iMenuCba->Size().iHeight); |
1135 TPoint menuPosition = TPoint(0, screenSize.iHeight - iMenuCba->Size().iHeight); |
1110 |
1136 |