×

Discussion Board

Results 1 to 2 of 2

Thread: CEikListBox

  1. #1
    Registered User
    Join Date
    Mar 2003
    Location
    Vancouver, Canada
    Posts
    25

    CEikListBox

    I'm in a desparate need for CEikListBox usage example (Symbian Crystal, C++). Please help. Thank you.

    Costya

    PS. My code below doesn't work
    ==============================

    void CKgAppView::Draw(const TRect&) const
    {
    CWindowGc& gc = SystemGc();
    gc.Clear();
    TRect drawRect=Rect();
    drawRect.Shrink(10,10);
    gc.DrawRect(drawRect);

    // My ListBox
    CEikListBox *lb = new (ELeave) CEikListBox();
    lb->SetContainerWindowL(*this);
    lb->ConstructL(this, 0);
    lb->ActivateL();
    }

  2. #2
    Registered User
    Join Date
    Mar 2003
    Location
    Tampere, Finland
    Posts
    29

    RE: CEikListBox

    It's definetely not a good idea to create a listbox in the Draw method. I'd suggest doing it in the CKgAppView::ConstructL.

    If your CKgAppView class is inherited from CCoeControl, declare a member variable of CEikListbox* type in that class, create a listbox in ConstructL, override virtual functions CountComponentControls and ComponentControl of CKgAppView class and don't forget to call superclass Draw method in CKgAppView::Draw.

    As an example you can take any sample project from Nokia 9200 SDK that uses similar technique (like \NokiaCPP\Epoc32Ex\AppFramework\UIControls\CustomControls)

Posting Permissions

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