Can i change the text color of a listbox
hi..
can anyone tell how to change the color of the listbox item's text...
i tried going thru many threads, but none is successfully completed :(
i tried the following.. but in vain..
[QUOTE]
iListBox->View()->ItemDrawer()->SetHighlightedTextColor(KRgbYellow);
iListBox->View()->ItemDrawer()->SetTextColor(KRgbRed);
[/QUOTE]
Thanks
Nital Shah
Re: Can i change the text color of a listbox
you can try this:in UI,constructL() add "BaseConstructL(EAknEnableSkin)"
Re: Can i change the text color of a listbox
[QUOTE=bingxuewangzi427;654812]you can try this:in UI,constructL() add "BaseConstructL(EAknEnableSkin)"[/QUOTE]
hi.. thanks for replying..
the skin is already enabled...
but doesnt seem to work
Re: Can i change the text color of a listbox
hey everyone...
i have done it...
these r the 2 Ids for changing list item's color..
[CODE] EAknsCIQsnTextColorsCG10
EAknsCIQsnTextColorsCG6
[/CODE]
so u have to change dat.. :)
Re: Can i change the text color of a listbox
[QUOTE=nital_shah;654829]hey everyone...
i have done it...
these r the 2 Ids for changing list item's color..
[CODE] EAknsCIQsnTextColorsCG10
EAknsCIQsnTextColorsCG6
[/CODE]
so u have to change dat.. :)[/QUOTE]
the following code can change the color of selected item in listbox,but if you want to change the color of all items,you have to draw each of them by yourself~
iListbox->ItemDrawer()->SetSkinEnabledL(ETrue);/
iListbox->ItemDrawer()->SetBackColor(KRgbRed);
iListbox->ItemDrawer()->SetHighlightedTextColor(KRgbYellow);
Re: Can i change the text color of a listbox
thanks friend..
may b yr way is correct..
but i did it in this way..
[CODE] MAknsSkinInstance* pSkin = AknsUtils::SkinInstance();
CAknsColorTableItemData* colorTable =
static_cast<CAknsColorTableItemData*>(pSkin->
GetCachedItemData(KAknsIIDQsnTextColors, EAknsITColorTable));
TUint64 colors[58];
for (TInt i = 0; i < 58; ++i)
{
colors[i] = colorTable->ColorRgb(i).Value();
colors[i] *= 0x100;
colors[i] += 0xFF;
colors[i] *= 0x1000000;
}
colors[EAknsCIQsnTextColorsCG6] = KRgbDarkGreen.Value();
colors[EAknsCIQsnTextColorsCG6] *= 0x100;
colors[EAknsCIQsnTextColorsCG6] += 0xFF;
colors[EAknsCIQsnTextColorsCG6] *= 0x1000000;
colors[EAknsCIQsnTextColorsCG10] = KRgbBlue.Value();
colors[EAknsCIQsnTextColorsCG10] *= 0x100;
colors[EAknsCIQsnTextColorsCG10] += 0xFF;
colors[EAknsCIQsnTextColorsCG10] *= 0x1000000;
//set
colorTable->SetColorsL(60, (const TAknsColorTableEntry*)colors);
[/CODE]
Re: Can i change the text color of a listbox
[QUOTE=nital_shah;654840]thanks friend..
may b yr way is correct..
but i did it in this way..
[CODE] MAknsSkinInstance* pSkin = AknsUtils::SkinInstance();
CAknsColorTableItemData* colorTable =
static_cast<CAknsColorTableItemData*>(pSkin->
GetCachedItemData(KAknsIIDQsnTextColors, EAknsITColorTable));
TUint64 colors[58];
for (TInt i = 0; i < 58; ++i)
{
colors[i] = colorTable->ColorRgb(i).Value();
colors[i] *= 0x100;
colors[i] += 0xFF;
colors[i] *= 0x1000000;
}
colors[EAknsCIQsnTextColorsCG6] = KRgbDarkGreen.Value(); //left cba text color set to blue
colors[EAknsCIQsnTextColorsCG6] *= 0x100;
colors[EAknsCIQsnTextColorsCG6] += 0xFF;
colors[EAknsCIQsnTextColorsCG6] *= 0x1000000;
colors[EAknsCIQsnTextColorsCG10] = KRgbBlue.Value(); //left cba text color set to blue
colors[EAknsCIQsnTextColorsCG10] *= 0x100;
colors[EAknsCIQsnTextColorsCG10] += 0xFF;
colors[EAknsCIQsnTextColorsCG10] *= 0x1000000;
//set
colorTable->SetColorsL(60, (const TAknsColorTableEntry*)colors);
[/CODE][/QUOTE]
oh,is it can change the color of each item in listbox?