×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jan 2007
    Posts
    33

    Question How to add text items into listbox without using resource file

    Hi All,

    How to add text items into listbox without using resource file that is using array list of text/strings

    Please help me out


    Thanks in advance

    Regards
    Vivek

  2. #2
    Registered User
    Join Date
    Dec 2006
    Location
    Noida, India
    Posts
    150

    Re: How to add text items into listbox without using resource file

    use listbox's AppendL Function to add items..as
    iListBox->AppendL(iItemString);

  3. #3
    Regular Contributor
    Join Date
    Jun 2004
    Location
    Helsinki, Finland
    Posts
    69

    Re: How to add text items into listbox without using resource file

    You may also want to check out the "Listbox Item Layouts". For example if you use class CAknSingleGraphicHeadingStyleListBox the string format is as follows:
    String format: "1\t21/10\tMeeting\t"

    Where 1 refers to icon number and "\t" are separators.

    Some example code can be found in documentation "Creating a Selection Listbox with Graphic and Heading at Runtime".

    Hope this helps!

  4. #4
    Super Contributor
    Join Date
    Jul 2006
    Location
    Oulu, Finland.
    Posts
    1,174

    Re: How to add text items into listbox without using resource file

    Quote Originally Posted by vivek_dbaurman
    Hi All,

    How to add text items into listbox without using resource file that is using array list of text/strings

    Please help me out


    Thanks in advance

    Regards
    Vivek

    TBuf<32> item;
    item.Format(_L("\t%S"), &Number);
    where Number is of type TBuf16;
    // append new item to the listbox
    itemList->AppendL(item);

  5. #5
    Registered User
    Join Date
    May 2008
    Posts
    3

    Re: How to add text items into listbox without using resource file

    to add multiple items what 1 can do is:

    _LIT(KT,"\t");
    TBuf<100> buf1;
    TBuf<100> buf2;
    TBuf<100> buf3;

    buf1.Append(_L("1"));
    buf1.Append(KT);
    buf1.Append(_L("ajit"));
    items->AppendL(buf1);

    buf2.Append(_L("1"));
    buf2.Append(KT);
    buf2.Append(_L("birju"));
    items->AppendL(buf2);

    buf3.Append(_L("1"));
    buf3.Append(KT);
    buf3.Append(_L("cash"));
    items->AppendL(buf3);

  6. #6
    Regular Contributor
    Join Date
    May 2008
    Posts
    65

    Re: How to add text items into listbox without using resource file

    AppendL a string tailed by \t

Similar Threads

  1. problem reading resource file
    By Komarov Dmitriy in forum Symbian
    Replies: 3
    Last Post: 2006-09-28, 12:00
  2. Resource file
    By hicheri in forum Symbian
    Replies: 2
    Last Post: 2005-02-24, 20:25
  3. Replies: 0
    Last Post: 2004-11-24, 18:49
  4. Problems with CBA resource in 2nd Resource File.
    By colinlawrence in forum Symbian Tools & SDKs
    Replies: 5
    Last Post: 2004-02-17, 02:47
  5. Series 60 SDK Appwizard on windows xp
    By moonjoor in forum Symbian Tools & SDKs
    Replies: 15
    Last Post: 2003-12-24, 10:22

Posting Permissions

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