×

Discussion Board

Results 1 to 7 of 7

Hybrid View

  1. #1
    Super Contributor
    Join Date
    Jun 2008
    Posts
    593

    Smile 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..
    iListBox->View()->ItemDrawer()->SetHighlightedTextColor(KRgbYellow);
    iListBox->View()->ItemDrawer()->SetTextColor(KRgbRed);
    Thanks
    Nital Shah

  2. #2
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    103

    Re: Can i change the text color of a listbox

    you can try this:in UI,constructL() add "BaseConstructL(EAknEnableSkin)"

  3. #3
    Super Contributor
    Join Date
    Jun 2008
    Posts
    593

    Unhappy Re: Can i change the text color of a listbox

    Quote Originally Posted by bingxuewangzi427 View Post
    you can try this:in UI,constructL() add "BaseConstructL(EAknEnableSkin)"
    hi.. thanks for replying..
    the skin is already enabled...
    but doesnt seem to work

  4. #4
    Super Contributor
    Join Date
    Jun 2008
    Posts
    593

    Smile 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
    so u have to change dat..

  5. #5
    Regular Contributor
    Join Date
    Sep 2009
    Posts
    103

    Re: Can i change the text color of a listbox

    Quote Originally Posted by nital_shah View Post
    hey everyone...

    i have done it...
    these r the 2 Ids for changing list item's color..
    Code:
     EAknsCIQsnTextColorsCG10
     EAknsCIQsnTextColorsCG6
    so u have to change dat..
    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);

  6. #6
    Super Contributor
    Join Date
    Jun 2008
    Posts
    593

    Smile 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);
    Last edited by nital_shah; 2009-10-09 at 14:01.

Similar Threads

  1. make textbox in canvas
    By mahdi68 in forum Mobile Java General
    Replies: 7
    Last Post: 2009-09-20, 11:46
  2. Change the default background of a view and listbox
    By RajeevSahu in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-09-18, 10:54
  3. Replies: 2
    Last Post: 2005-07-20, 14:17
  4. change font size on listbox and load image as foreground
    By cindul in forum Symbian Media (Closed)
    Replies: 0
    Last Post: 2005-02-19, 03:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×