18 |
18 |
19 #include "CMIDChoiceGroupListBox.h" |
19 #include "CMIDChoiceGroupListBox.h" |
20 // API for iChoiceControl |
20 // API for iChoiceControl |
21 #include "CMIDChoiceGroupControl.h" |
21 #include "CMIDChoiceGroupControl.h" |
22 #include "CMIDChoiceGroupModel.h" |
22 #include "CMIDChoiceGroupModel.h" |
|
23 // API for control item |
|
24 #include "CMIDControlItem.h" |
23 |
25 |
24 #include <e32def.h> |
26 #include <e32def.h> |
25 // using for CColumnListBoxData related to colors |
27 // using for CColumnListBoxData related to colors |
26 // and in HandleResourceChange function - setting icon array |
28 // and in HandleResourceChange function - setting icon array |
27 #include <eikclbd.h> |
29 #include <eikclbd.h> |
98 #ifdef RD_JAVA_ADVANCED_TACTILE_FEEDBACK |
100 #ifdef RD_JAVA_ADVANCED_TACTILE_FEEDBACK |
99 iFeedback->EnableFeedbackForControl(this, FALSE); |
101 iFeedback->EnableFeedbackForControl(this, FALSE); |
100 #endif //RD_JAVA_ADVANCED_TACTILE_FEEDBACK |
102 #endif //RD_JAVA_ADVANCED_TACTILE_FEEDBACK |
101 #endif //RD_TACTILE_FEEDBACK |
103 #endif //RD_TACTILE_FEEDBACK |
102 |
104 |
|
105 SetTextColors(); |
103 } |
106 } |
104 |
107 |
105 // Overridden, because CEikListBox returns EKeyWasConsumed when |
108 // Overridden, because CEikListBox returns EKeyWasConsumed when |
106 // up is pressed on the first item, or down on last. We need to |
109 // up is pressed on the first item, or down on last. We need to |
107 // return not consumed in order to make the form move focus |
110 // return not consumed in order to make the form move focus |
339 if (AknsUtils::AvkonSkinEnabled()) |
342 if (AknsUtils::AvkonSkinEnabled()) |
340 { |
343 { |
341 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
344 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
342 TRgb color; |
345 TRgb color; |
343 |
346 |
344 // icon color, checkbox, radio button |
347 // Chose correct colors for elements |
|
348 TInt logicalColor = KNonHighlightedItemTextColor; // non-highlighted |
|
349 |
|
350 #ifdef RD_JAVA_S60_RELEASE_9_2 |
|
351 if (iChoiceControl |
|
352 && iChoiceControl->ChoiceType() != MMIDChoiceGroup::EPopup |
|
353 && iChoiceControl->ControlItem() |
|
354 && iChoiceControl->ControlItem()->IsHighlighted()) |
|
355 { |
|
356 logicalColor = KHighlightedItemTextColor; // highlighted |
|
357 } |
|
358 #endif // RD_JAVA_S60_RELEASE_9_2 |
|
359 |
345 TInt error = AknsUtils::GetCachedColor(skin, |
360 TInt error = AknsUtils::GetCachedColor(skin, |
346 color, |
361 color, |
347 KAknsIIDQsnIconColors, |
362 KAknsIIDQsnTextColors, |
348 EAknsCIQsnIconColorsCG14); |
363 logicalColor); |
349 |
|
350 if (!error) |
364 if (!error) |
351 { |
365 { |
352 colors.iText = color; |
366 colors.iText = color; |
353 } |
367 } |
354 |
368 |
355 // icon color, setting list highlight checkbox, radio button |
|
356 error = AknsUtils::GetCachedColor(skin, |
369 error = AknsUtils::GetCachedColor(skin, |
357 color, |
370 color, |
358 KAknsIIDQsnIconColors, |
371 KAknsIIDQsnTextColors, |
359 EAknsCIQsnIconColorsCG14); |
372 logicalColor); |
360 |
|
361 if (!error) |
373 if (!error) |
362 { |
374 { |
363 colors.iHighlightedText = color; |
375 colors.iHighlightedText = color; |
364 } |
376 } |
365 } |
377 } |
366 |
378 |
367 View()->ItemDrawer()->SetTextColor(colors.iText); |
379 if (View() && View()->ItemDrawer()) |
368 View()->ItemDrawer()->SetHighlightedTextColor(colors.iHighlightedText); |
380 { |
|
381 #ifdef RD_JAVA_S60_RELEASE_9_2 |
|
382 View()->ItemDrawer()->SetFlags( |
|
383 CListItemDrawer::EUseOverrideSkinTextColor); |
|
384 #endif // RD_JAVA_S60_RELEASE_9_2 |
|
385 View()->ItemDrawer()->SetTextColor(colors.iText); |
|
386 View()->ItemDrawer()->SetHighlightedTextColor(colors.iHighlightedText); |
|
387 } |
369 } |
388 } |
370 |
389 |
371 |
390 |
372 void CMIDChoiceGroupListBox::PositionChanged() |
391 void CMIDChoiceGroupListBox::PositionChanged() |
373 { |
392 { |