merlinvn / controlp5

Automatically exported from code.google.com/p/controlp5
0 stars 0 forks source link

ListBox event values are -1 indexed #33

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
if(event.isController() && event.isGroup()){
    if(event.name().equals("Something")) {
        int test = (int)event.group().value());
    }
}

What is the expected output? What do you see instead?
0 indexed values. Instead values are -1 indexed

What version of the product are you using? On what operating system?
0.5.4 Windows7

Please provide any additional information below.
Can be related to previous two issues.

Original issue reported on code.google.com by malek.ma...@gmail.com on 17 Jan 2012 at 8:44

GoogleCodeExporter commented 8 years ago
this condition should never be met, an event can only be triggered by a 
controller or a group at separate times but not at the same time.

if(event.isController() && event.isGroup()){
}

Original comment by soj...@gmail.com on 18 Jan 2012 at 2:07

GoogleCodeExporter commented 8 years ago

Original comment by soj...@gmail.com on 18 Jan 2012 at 2:16

GoogleCodeExporter commented 8 years ago
Sorry. I copied wrong.

The expression is ofcourse,

if(event.isGroup() && event.name().equals("Active Tokens")){
    int test = (int)event.group().value());
}

Please check for -1 index being returned

Original comment by malek.ma...@gmail.com on 18 Jan 2012 at 7:53

GoogleCodeExporter commented 8 years ago
as of version 0.7.0 if an item of a listbox is triggered, the value of the 
listbox will correspond to the value of the listboxitem.

Original comment by soj...@gmail.com on 18 Jan 2012 at 9:05