Created
December 31, 2018 17:07
-
-
Save Jofairden/97027d7351077d773f7e74db3d0a43eb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package net.tmodloader.modbrowser.view | |
import javafx.geometry.Pos | |
import javafx.scene.layout.Priority | |
import tornadofx.View | |
import tornadofx.action | |
import tornadofx.borderpane | |
import tornadofx.bottom | |
import tornadofx.button | |
import tornadofx.field | |
import tornadofx.fieldset | |
import tornadofx.form | |
import tornadofx.hbox | |
import tornadofx.hgrow | |
import tornadofx.label | |
import tornadofx.pane | |
import tornadofx.textfield | |
class TrivView : View() { | |
// if you want to assign stuff: | |
// var myThing : XTYPE by singleAssign() | |
// singleAssign essentially makes var a val again | |
// but you can now assign inside the root override or initializer | |
// (no runtime errors, but the var will never change again if you try assigning again) | |
// (in root simply do myThing = hbox { ... blabla ... } like done now.. | |
override val root = borderpane { | |
top = hbox { | |
button("Choose Directory") { | |
action { | |
// blah | |
} | |
} | |
textfield("Selected directory path...") { | |
hgrow = Priority.ALWAYS | |
} | |
} | |
center = form { | |
hbox(20) { | |
fieldset("Mod details") { | |
field("Mod name") { | |
textfield() | |
} | |
field("Display name") { | |
textfield() | |
} | |
field("Mod version") { | |
textfield() | |
} | |
field("Mod author") { | |
textfield() | |
} | |
} | |
fieldset("Extras") { | |
field("Language version") { | |
textfield { | |
promptText = "6" | |
} | |
} | |
field("Build ignore") { | |
textfield { | |
promptText = "*.csproj, *.sln" | |
} | |
} | |
} | |
} | |
} | |
bottom { | |
hbox { | |
label("Status bar") { | |
alignment = Pos.CENTER_LEFT | |
} // could actually use StatusBar element instead | |
pane { | |
hgrow = Priority.ALWAYS | |
} | |
button("Generate mod") { | |
alignment = Pos.CENTER_RIGHT | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment