×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    32

    Using a "custom" listbox in mobile s60

    Hi!
    In s60, there are many kinds of listbox with "CAkn...ListBox". But those listbox have predefined format and layout and I don't know how to change their features such as font, number of items in view, background color....
    I simple wants to use a "standard" listbox with text item, has highlighted and can easily change its' attributes, so I used the listbox of UI Core Control - the inheritances class of CEikListBox. And the problem is here! When I use CEikTextListBox , I can do everything I want (change font, set itemheight to define num of items in view, change background color....) EXCEPT there're NO highlighted in listbox. There is only a rect encloses current item and it seems bad! Althought the listbox has SetHighlightedBackColor() and SetHighlightedTextColor() function, it does NOT effect. Some one has given me some tips and I tried many, but it doesn't affect.
    At last, how can I use EikListBox with all of features of a "real" listbox in app of mobile s60? I'm sure it's possible, because I saw a app has same listbox.
    Thank you so much for every helps!

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167
    have you thought about trying CEikColumnListBox instead ?

    yucca

  3. #3
    Registered User
    Join Date
    Mar 2005
    Posts
    32
    Yes, it's my problem!
    When i used CEikColumnListBox , there are NO text appear in listbox. Althought I can get current text item in HandleListBoxEvent(...).
    I simple change the alloc listbox as:

    //iListBox = new( ELeave ) CEikTextListBox();
    iListBox = new( ELeave ) CEikFormattedCellListBox();

    Can you help me, sir?

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    5
    You have to change the color of the selected item in the list box in Draw method.
    like
    if(iCurrentSlection)
    gc->SetBrushColor(KRgbWhite);
    else
    gc->SetBrushColor(KRgbBlack);

  5. #5
    Registered User
    Join Date
    Mar 2005
    Posts
    32
    Hi gbtw!
    Thanks very much for guide!
    But I still not understand. You said " change the color of the selected item in the list box in Draw method. But what is "iCurrentSelection", it's a variable or member of Listbox class? Draw method is a method of container class or method of inheritance listbox class?
    Please give me details instruction.
    Thank you very much!

Posting Permissions

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