mirror of
https://github.com/euphy/polargraphcontroller
synced 2025-01-09 19:55:16 +01:00
Dropdown selects the actual selected port (#15)
Also mentioned against issue #14.
This commit is contained in:
parent
d74881f2de
commit
936d918402
@ -31,9 +31,9 @@ ControlFrameSimple addSerialPortControlFrame(String theName, int theWidth, int t
|
|||||||
|
|
||||||
ScrollableList sl = p.cp5().addScrollableList("dropdown_serialPort")
|
ScrollableList sl = p.cp5().addScrollableList("dropdown_serialPort")
|
||||||
.setPosition(10, 10)
|
.setPosition(10, 10)
|
||||||
.setSize(150, 100)
|
.setSize(150, 150)
|
||||||
.setBarHeight(20)
|
.setBarHeight(20)
|
||||||
.setItemHeight(20)
|
.setItemHeight(16)
|
||||||
.plugTo(this, "dropdown_serialPort");
|
.plugTo(this, "dropdown_serialPort");
|
||||||
|
|
||||||
sl.addItem("No serial connection", -1);
|
sl.addItem("No serial connection", -1);
|
||||||
@ -61,8 +61,10 @@ ControlFrameSimple addSerialPortControlFrame(String theName, int theWidth, int t
|
|||||||
void dropdown_serialPort(int newSerialPort)
|
void dropdown_serialPort(int newSerialPort)
|
||||||
{
|
{
|
||||||
println("In dropdown_serialPort, newSerialPort: " + newSerialPort);
|
println("In dropdown_serialPort, newSerialPort: " + newSerialPort);
|
||||||
newSerialPort -= 1;
|
|
||||||
|
|
||||||
|
// No serial in list is slot 0 in code because of list index
|
||||||
|
// So shift port index by one
|
||||||
|
newSerialPort -= 1;
|
||||||
|
|
||||||
if (newSerialPort == -2)
|
if (newSerialPort == -2)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user