tornadofx控件combobox绑定enum class-LMLPHP

class LearnApp : App(LearnV::class)
class LearnV : View("learn") {
    val speed = SimpleObjectProperty(this, "speed", Speed.Normal)
    override val root = form {
        fieldset {
            field("choosed:") {
                label(speed)
            }
            field("Speed") {
                combobox(
                    property = speed,
                    values = Speed.all
                )
            }
        }
        prefWidth=200.0
    }
}

enum class Speed(val inMs: Long) {
    Slow(200), Normal(100), Fast(70);

    companion object {
        val all by lazy { values().toList() }
    }
}
07-12 10:08