×

Discussion Board

Results 1 to 12 of 12
  1. #1
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    how to show a list box in my application

    hi 2 all

    i have already existing my application n their is one more application of listbox.......i want to show that listbox in my applications front view.
    my application is having no. of views.
    i have added the container class of listbox appn in my application then made object of listboxcontainer for the view object which is setdefault. and builded but what is happening is i am getting a blank screen n after few seconds my emulator directly closes.

    plz help me what should i do?

    thanks n regards
    bharat

  2. #2
    Super Contributor
    Join Date
    Oct 2005
    Location
    Hyderabad,India
    Posts
    1,156

    Re: how to show a list box in my application

    Hi,
    could you please post some code so that we could understand how you are building your listbox.
    please have a look onto this link.it tell you how to create a list box.

    http://discussion.forum.nokia.com/fo...ad.php?t=92554

    and also mention the panic code.

    Priju

  3. #3
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to show a list box in my application

    yah sure.

    void CListDlgContainer::ConstructL(const TRect& aRect)
    {
    CreateWindowL();
    SetRect(aRect);
    ActivateL();

    TInt openedItem(0);


    HBufC* iconFileName;
    iconFileName = StringLoader::LoadLC(R_ICON_FILE_NAME);

    CAknSelectionListDialog* dialog = CAknSelectionListDialog::NewL(openedItem, NULL, 0);
    dialog->PrepareLC (R_LISTDLG_DIALOG);

    CArrayPtr<CGulIcon>* icons = new(ELeave) CAknIconArray(KNumberOfIcons);
    CleanupStack::PushL(icons);
    icons->AppendL(iEikonEnv->CreateIconL(*iconFileName, EMbmListdlg1player, EMbmListdlg1player_mask));
    icons->AppendL(iEikonEnv->CreateIconL(*iconFileName, EMbmListdlg2player, EMbmListdlg2player_mask));

    dialog->SetIconArrayL(icons); // transferring ownership of icons

    CleanupStack::Pop(icons);


    if (dialog->RunLD ())
    {
    PlaySelectedGame(openedItem);
    }
    CleanupStack::PopAndDestroy(iconFileName);

    }

    CListDlgContainer* CListDlgContainer::NewL(const TRect& aRect)
    {
    CListDlgContainer* self = CListDlgContainer::NewLC(aRect);
    CleanupStack::Pop(self);
    return self;
    }

    CListDlgContainer* CListDlgContainer::NewLC(const TRect& aRect)
    {
    CListDlgContainer* self = new (ELeave) CListDlgContainer;
    CleanupStack::PushL(self);
    self->ConstructL(aRect);
    return self;
    }

    void CListDlgContainer::Draw(const TRect& aRect) const
    {
    CWindowGc& gc = SystemGc();
    gc.Clear(aRect);
    }

    void CListDlgContainer::PlaySelectedGame(TInt /*aOpenedItem*/)
    {
    }


    this is the code in my container.

  4. #4
    Super Contributor
    Join Date
    Oct 2005
    Location
    Hyderabad,India
    Posts
    1,156

    Re: how to show a list box in my application

    hi,
    i dont find your HandleItemAdditionL()..that might be the reason y you find a empty list box..check the link that had been given below.it would help you to understand better.

    Priju

  5. #5
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to show a list box in my application

    hi priju

    but this handleItemAdditionL is not present in my original application where actual listbox created n displayed.
    n u r talking about which link?


    qwiting ur valuable reply

    bharat

  6. #6
    Super Contributor
    Join Date
    Oct 2005
    Location
    Hyderabad,India
    Posts
    1,156

    Re: how to show a list box in my application

    Quote Originally Posted by bharats
    hi priju

    but this handleItemAdditionL is not present in my original application where actual listbox created n displayed.
    i dont understand you! which is your so said original application? after you append your items on the icon array you need to call HandleItemAdditionL() which you are not doing!! please go thru the listbox examples which comes in the sdk installation.

    Quote Originally Posted by bharats
    n u r talking about which link?
    the link which comes along with the first reply.Wizard_hu__ has got the codes for you in that link..please have a look.

    Priju

  7. #7
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to show a list box in my application

    hi briju

    sorry for inconvinience.
    my original application means a listbox application example which i downloaded from somewhere.the code of container class of this listbox is posted already in lase reply and it is working fine here when i build and run it on emulator.
    but when i am adding it in my new application where i wanna to show this listbox by default on my first screen of my application means i have simply added a new class which is container of the listbox application in my new application and in the doactivate method of my default view i made a object of this listbox container class but still it is showing a blank screen and after few seconds the emulator closes automatically with a error report.
    so what could i do?

    awaiting your valuable reply.
    bharat

  8. #8
    Super Contributor
    Join Date
    Oct 2005
    Location
    Hyderabad,India
    Posts
    1,156

    Re: how to show a list box in my application

    have you made related modification in CountComponentControls() and in ComponentControl(TInt aIndex) const, if proper valvues are not mentioned here the controls wont be displayed.
    what is ur error code that you get..

    Priju

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: how to show a list box in my application

    Hi Priju, thank you for remembering my example code :-)
    However bharats is trying to use a CAknSelectionListDialog, which is a self-containing dialog (with PrepareLC-RunLD or ExecuteLD), thus it will not be a contained control of a view.
    Unfortunately I do not know exactly how should it work, but I would guess that launching (and probably waiting for) a dialog has a bad place in the 2nd phase constructor of a CCoeControl; the crash is probably caused by a timeout in the Window or the View Server.

  10. #10
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to show a list box in my application

    hi priju

    i hav copied these functions in my listbox container and now i am getting a error

    C:\SYMBIAN\7.0S\SERIES60_V20\SERIES60EX\SMS\GUI\SRC\Smsexamplelogview.cpp(100) : error C2664: 'void __thiscall CCoeAppUi::AddToStackL(class CCoeControl *,int,int)' : cannot convert parameter 1 from 'class CLogView' to 'class CCoeControl *'

    in my examplelogview.cpp file where i am calling
    AppUi()->AddToStackL(*this, iContainer);
    in my DoactivateL function so what should i do now?

    awiting your valuable reply

  11. #11
    Super Contributor
    Join Date
    Oct 2005
    Location
    Hyderabad,India
    Posts
    1,156

    Re: how to show a list box in my application

    From which class is your CLogView class derived from?
    is it CAknView?

    Priju

  12. #12
    Regular Contributor
    Join Date
    Nov 2006
    Posts
    260

    Re: how to show a list box in my application

    hi pirju
    yah...

Similar Threads

  1. Scroll bars in a list box (Series 60)
    By krnsoft in forum Symbian User Interface
    Replies: 30
    Last Post: 2007-02-05, 06:12
  2. How to add items dynamically to the double pop menu style list box
    By vinayakak in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-12-07, 08:16
  3. List Box will not show
    By aconteh in forum Symbian User Interface
    Replies: 4
    Last Post: 2005-11-09, 18:00
  4. List Box empty text
    By srkreddy999 in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-10-25, 11:09
  5. List Box control on series -60
    By Nokia_Archive in forum Symbian Tools & SDKs
    Replies: 1
    Last Post: 2002-05-30, 21:03

Posting Permissions

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