Dropdown selects the actual selected port (#15)

Also mentioned against issue #14.
This commit is contained in:
MurKit 2017-04-21 01:35:17 +03:00 committed by Sandy Noble
parent d74881f2de
commit 936d918402

View File

@ -31,9 +31,9 @@ ControlFrameSimple addSerialPortControlFrame(String theName, int theWidth, int t
ScrollableList sl = p.cp5().addScrollableList("dropdown_serialPort")
.setPosition(10, 10)
.setSize(150, 100)
.setSize(150, 150)
.setBarHeight(20)
.setItemHeight(20)
.setItemHeight(16)
.plugTo(this, "dropdown_serialPort");
sl.addItem("No serial connection", -1);
@ -61,9 +61,11 @@ ControlFrameSimple addSerialPortControlFrame(String theName, int theWidth, int t
void dropdown_serialPort(int newSerialPort)
{
println("In dropdown_serialPort, newSerialPort: " + newSerialPort);
// No serial in list is slot 0 in code because of list index
// So shift port index by one
newSerialPort -= 1;
if (newSerialPort == -2)
{
}