×

Discussion Board

Results 1 to 7 of 7

Hybrid View

  1. #1
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    77

    Can I change listbox item text?

    look:

    MDesCArray* textArray =iListBox->Model()->ItemTextArray();
    CDesCArray* itemList = static_cast<CDesCArray*>(textArray);
    (*itemList)[0] = "0\tnew text\tnew text\t";

    compile error, it seem that listbox item text can not modify, but if I real want to change item text, how I can do?

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2006
    Location
    Finland
    Posts
    4,533

    Re: Can I change listbox item text?

    Quote Originally Posted by aluzi View Post
    look:

    MDesCArray* textArray =iListBox->Model()->ItemTextArray();
    CDesCArray* itemList = static_cast<CDesCArray*>(textArray);
    (*itemList)[0] = "0\tnew text\tnew text\t";

    compile error, it seem that listbox item text can not modify, but if I real want to change item text, how I can do?
    Have you checked the listbox example ?

  3. #3
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    77

    Re: Can I change listbox item text?

    Quote Originally Posted by Symbian_Neil View Post
    Have you checked the listbox example ?
    The sample you gave dose not mention how to chang item text in list box.

    But I found another sample, and I know how to do it:
    1 first delete the item
    2 and then insert an new item at same index

    So, I can change item text now, and thank you!

  4. #4
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    156

    Re: Can I change listbox item text?

    Quote Originally Posted by aluzi View Post
    But I found another sample, and I know how to do it:
    1 first delete the item
    2 and then insert an new item at same index
    not optimal way... ;-)

  5. #5
    Regular Contributor
    Join Date
    Mar 2008
    Posts
    77

    Re: Can I change listbox item text?

    Could you tell me the optimal way? I really want to know,thanks!

  6. #6
    Registered User
    Join Date
    Apr 2005
    Location
    Pune
    Posts
    115

    Re: Can I change listbox item text?

    Well I guess there are two ways out:

    1. Delete the item, add new item and re-draw the list

    2. Derive the listbox to create your custom list box and in the DrawActualItem() update the text..

    Hope it helps.

    Shivam

  7. #7
    Regular Contributor
    Join Date
    Jun 2007
    Posts
    107

    Re: Can I change listbox item text?

    In my opinion, you should check the example first.
    A list box can own or not own a list of item text and after the text modified, you need to Update the list to display the correct item.
    -------
    zesky
    http://symbian-security.cn

Similar Threads

  1. Update listbox item
    By fuhrer in forum Symbian
    Replies: 4
    Last Post: 2007-10-03, 16:31
  2. Enabling marquee in listbox item
    By toinks in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-11-02, 10:37
  3. Change icon in listbox
    By ninidotnet in forum Symbian User Interface
    Replies: 2
    Last Post: 2006-10-12, 02:57
  4. Can you change color of 6280 active standby text?
    By marc3381 in forum General Development Questions
    Replies: 0
    Last Post: 2006-06-27, 12:03
  5. listbox item height...
    By yahyah_yy in forum Symbian User Interface
    Replies: 1
    Last Post: 2004-05-25, 16:28

Posting Permissions

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