Results 1 to 4 of 4

Thread: IlvScrolledComboBox::insertLabe() error with same data

  1. #1
    Junior Member
    Join Date
    Nov 2013
    Posts
    3

    IlvScrolledComboBox::insertLabel() error with same data

    Hi,

    I need to insert in a combo box two labels at the top of the list. The combo box is not empty before my insertion.
    For these labels, I do not specify any data. As a consequence, data are the same for both labels. When I call the function whichSelected(), it returns -1 instead of 0 or 1 (my labels are at the top of the combo box list).

    I tried to figured out how to find a solution of my issue but I didn't succeed. If I insert only one label, it works how it should.

    Do you know if it as a normal behavior and/or how to correct it ?

    Here is the the flow I use
    Init function
    Code:
    ComboBox->insertLabel(0,"label1");
    ComboBox->insertLabel(0,"label2");
    When I click on a label in the combo (user side), a callback is called
    Code:
    IlShort idx = ComboBox->whichSelected();
    //work using idx
    //But in my case, idx=-1 if label1 or label2 is selected
    Thanks a lot

    Note:
    I am using Version 5.5
    Last edited by Flows; 12-02-2013 at 02:23 AM.

  2. #2
    Junior Member
    Join Date
    Oct 2012
    Posts
    29
    Hello Flows,
    Not sure I get you right. May be a more thorough description of the sequence you use may help.

    On first sight, the normal behavior is:
    - inserting or adding one or label remove the current selection
    - thus calling whichSelected after an insertion should return -1 (as documented).

  3. #3
    Junior Member
    Join Date
    Nov 2013
    Posts
    3
    When I add the label, I don't care of the current selection, so the first behavior you highlight is fine for me.
    Then, on the application/user side, when I select an item of the combo, a callback is called. In the callback, I need to use whichSelected().

    When you write
    " - thus calling whichSelected after an insertion should return -1 (as documented)."
    Do you mean straight after the insertLabel() ? It is not what I do. I updated original post with example.

  4. #4
    Junior Member
    Join Date
    Nov 2013
    Posts
    3
    Found the solution in my code.

Tags for this Thread

Posting Permissions

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