edvin / tornadofx-controls

CSS Stylable Controls for JavaFX
Apache License 2.0
107 stars 16 forks source link

Form Functionality feature parity with TornadoFx #4

Closed gtnarg closed 7 years ago

gtnarg commented 7 years ago

The Form functionality feature set is behind that available in the TornadoFx (Kotlin) version.

If you provide a list of features that are missing, I will attempt to update the functionality here to be in sync.

Thanks, Grant

edvin commented 7 years ago

OK, trying this off the top of my head first.

ButtonBar

To support this properly, an AbstractField class was added with the default functionality of the old Field class. Then two subclasses were added: Field and ButtonBarField.

Abstract field also has an abstract inputContainer: Region property. For the standard Field class, this is either an HBox or VBox depending on the orientation property (javafx.geometry.Orientation). For ButtonBarField this is a ButtonBar. This was done so that the builders would operate on the correct parent type. I haven't thought about if this is necessary for the JavaFX version.

prefWidth calculations fixed

The Form.labelContainerWidth function now gets a height property, I think it didn't use to. I think there was a bug inside Field.computePrefWidth as well, where fieldset.labelPosition == HORIZONTAL should be changed to fieldset.labelPosition == VERTICAL.

Menemonic target (setting labelFor)

This was done as an extension function on node, it will probably be a function on AbstractField in the JavaFX version.

That's all I can remember right now, I think this covers most of it :)

gtnarg commented 7 years ago

Important notice: The field builder used to operate on the inputContainer inside the Field. This has been changed so that it now operates on the field itself. If you did something like parent.isVisible = false to hide the field, you must now change your code to isVisible = false. This new behavior is more as one would expect and hopefully the change won't cause any trouble to anyone.

edvin commented 7 years ago

This doesn't apply to the Java version, since there are no builders.

gtnarg commented 7 years ago

Okay - thanks

edvin commented 7 years ago

I'll close this issue as your PR took care of all of it!