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?
Re: Can I change listbox item text?
[QUOTE=aluzi;399329]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?[/QUOTE]
Have you checked the [URL="http://wiki.forum.nokia.com/index.php/List_box_example"]listbox example [/URL]?
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
Re: Can I change listbox item text?
[QUOTE=Symbian_Neil;399331]Have you checked the [URL="http://wiki.forum.nokia.com/index.php/List_box_example"]listbox example [/URL]?[/QUOTE]
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!
Re: Can I change listbox item text?
[QUOTE=aluzi;399734]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
[/QUOTE]
not optimal way... ;-)
Re: Can I change listbox item text?
Could you tell me the optimal way? I really want to know,thanks!
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