×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Apr 2008
    Posts
    6

    Listbox: Selection changed event

    I'm using S60 3rd FP1 (N95) and I was wondering if the listbox control offers a "selection changed event", as I need to update my application state if the user navigates through the list.

    I've checked the "MEikListBoxObserver", but it offers only these events:

    Code:
    enum TListBoxEvent
    {
         EEventEnterKeyPressed,
         EEventItemClicked,
         EEventItemDoubleClicked,
         EEventItemActioned,	// reported by dir tree and dir contents listboxes
         EEventEditingStarted,
         EEventEditingStopped,
         EEventPenDownOnItem,
         EEventItemDraggingActioned
    };
    Now I'm using a workaround: I capture the up/down key events in "OfferKeyEventL" before passing them on to the listbox control ... but I think this solution is quite a hack.

    Any help appreciated! Thank you! :)

    flokrates
    Last edited by flokrates; 2009-08-07 at 08:43.

  2. #2
    Registered User
    Join Date
    Apr 2008
    Posts
    6

    Lightbulb Re: Listbox: Selection changed event

    I think I've found the proper solution myself:

    Additional to implementing the MEikListBoxObserver interface (for receiving item pressed/clicked events), also the MCoeControlObserver interface (see file "coecobs.h") has to be implemented:

    Code:
    void CMyContainer::HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType)
    {
        if (aControl == iMyListBox && aEventType == EEventStateChanged)
        {
           // Use the current index to do whatever.
           TInt current = iMyListBox->CurrentItemIndex();
        }
    }
    Upon construction of the listbox control, SetObserver(...) has to be used to set the MCoeControlObserver instance.

    flokrates
    Last edited by flokrates; 2009-08-07 at 08:43.

Similar Threads

  1. KERN-EXEC 3 Panic/OK for the same call
    By PACALA_BA in forum Symbian
    Replies: 8
    Last Post: 2009-12-01, 01:02
  2. How to Create multiple selection listboxes
    By somnathbanik in forum Symbian
    Replies: 8
    Last Post: 2009-07-10, 12:27
  3. Replies: 5
    Last Post: 2008-10-02, 18:49
  4. Single Selection ListBox problem for S60
    By rolandwang in forum Symbian User Interface
    Replies: 1
    Last Post: 2005-08-25, 04:28
  5. Listbox & Form
    By tukaram in forum Symbian
    Replies: 1
    Last Post: 2005-06-28, 05:24

Posting Permissions

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