×

Discussion Board

Results 1 to 8 of 8
  1. #1
    Regular Contributor
    Join Date
    Feb 2009
    Location
    mumbai,india
    Posts
    94

    datatype to use for listitem

    I want to display the name in listbox,so can someone tell what datatype i should use.
    i use "TBuf" is it that i required to use "TBuf8" bcz it display square after each letter
    like "l(block)o(block)p"

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: datatype to use for listitem

    Which kind of listbox are you using, and how are you adding the data into it ?

  3. #3
    Regular Contributor
    Join Date
    Feb 2009
    Location
    mumbai,india
    Posts
    94

    Re: datatype to use for listitem

    Quote Originally Posted by symbianyucca View Post
    Which kind of listbox are you using, and how are you adding the data into it ?
    Im using "single text" style list
    This is the code i used to display the list item from database
    void CAssBankMenu::LoadBankMenuL()
    {

    CBankDatabase* BankloadDb = CBankDatabase::NewL();

    CleanupStack::PushL(BankloadDb);
    TInt count = BankloadDb->GetBankTableCountL();

    if(count==0)
    {
    CleanupStack::PopAndDestroy();
    return;
    }


    //TBankTableItem* NewItem = NULL;
    TBool first = BankloadDb->GetBankTableFirstRecordL(iNewItem);
    TBool next = EFalse;
    TBuf<32> buf;
    TInt i = 1;
    TBuf<6> info;

    if(first)
    {
    CTextListBoxModel* model = static_cast< CTextListBoxModel *> (iBanklistBox->Model() );
    //CTextListBoxModel* model = iListBox->Model();
    CDesCArray* itemArray = static_cast< CDesCArray* > (model->ItemTextArray() );

    itemArray->Reset();

    do
    {
    //CreateBanklistBoxItemL(buf, i, iNewItem.iBankName, info);

    //CreateBanklistBoxItemL(buf,iNewItem.iBankName);
    _LIT ( KStringHeader, "\t%S" );

    buf.Format( KStringHeader(), &iNewItem.iBankName );

    itemArray->AppendL(buf);

    // refresh listbox now that items are added
    iBanklistBox->HandleItemAdditionL();

    next = BankloadDb->GetBankTableNextRecordL(iNewItem);

    i++;

    }
    while(next);
    CleanupStack::PopAndDestroy();
    }

    }
    This is my data class

    class TBankTableItem
    {
    public:
    TBankTableItem(): iPrimeId(-1){};
    public:
    TInt iPrimeId;
    TBuf8<32> iBankName;//display this
    TBuf<32> iAccNo;
    TBuf<32> iBal;
    public:
    inline void Reset()
    {
    iPrimeId = 0;
    iBankName.Zero();
    iAccNo.Zero();
    iBal.Zero();
    }

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: datatype to use for listitem

    I would try changing the buffer involved to be 16-bit wide, never seen that problem before, though I have never tried using byte buffer when using format with 16-bit one...

  5. #5
    Regular Contributor
    Join Date
    Feb 2009
    Location
    mumbai,india
    Posts
    94

    Re: datatype to use for listitem

    Quote Originally Posted by symbianyucca View Post
    I would try changing the buffer involved to be 16-bit wide, never seen that problem before, though I have never tried using byte buffer when using format with 16-bit one...
    can u tell what change i should do?

  6. #6
    Regular Contributor
    Join Date
    Feb 2009
    Location
    mumbai,india
    Posts
    94

    Re: datatype to use for listitem

    can u tell what change i should do?

    Actually i had first used TBuf everywere then to that probelm was coming so thg of making
    it TBuf8

  7. #7
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,344

    Re: datatype to use for listitem

    Have you tried this article: How to create a simple listbox ?

    Make appropriate changes in your application according to the above article.
    Nokia Developer Wiki Moderation team

  8. #8
    Super Contributor
    Join Date
    May 2005
    Location
    Hyderabad,India
    Posts
    704

    Re: datatype to use for listitem

    Quote Originally Posted by lopesrohan1988 View Post
    can u tell what change i should do?

    Actually i had first used TBuf everywere then to that probelm was coming so thg of making
    it TBuf8
    Hi,

    Change the datatype as TBuf instead of TBuf8 and try again.

    Thanks,
    Eswar

Similar Threads

  1. Symbian Datatype to OpenC Datatype
    By shini_m in forum General Development Questions
    Replies: 1
    Last Post: 2009-03-10, 11:29
  2. Function to determine the datatype.
    By Priju Jacob Paul in forum Symbian
    Replies: 9
    Last Post: 2008-02-18, 10:01
  3. Replies: 4
    Last Post: 2006-09-05, 15:15
  4. Converting a char* string to TPtrC datatype
    By sujoydas in forum Symbian
    Replies: 8
    Last Post: 2004-04-08, 09:44
  5. Equivalent of long datatype in Symbian C++
    By praizada in forum Symbian
    Replies: 2
    Last Post: 2003-12-15, 15:01

Posting Permissions

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