You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
1.1 KiB

3 years ago
3 years ago
3 years ago
3 years ago
  1. package nova.monadic_sfx.util.controls
  2. import com.jfoenix.{controls => jfoenixc}
  3. import javafx.{scene => jfxs}
  4. import nova.monadic_sfx.implicits._
  5. import scalafx.Includes._
  6. import scalafx.beans.property.ObjectProperty
  7. import scalafx.scene.Node
  8. import scalafx.scene.control.Button
  9. import jfxs.{paint => jfxsp}
  10. object JFXButton {
  11. implicit def sfxButton2jfx(v: JFXButton): jfoenixc.JFXButton =
  12. if (v != null) v.delegate else null
  13. }
  14. class JFXButton(
  15. override val delegate: jfoenixc.JFXButton = new jfoenixc.JFXButton
  16. ) extends Button(delegate) {
  17. /**
  18. * Creates a button with the specified text as its label.
  19. */
  20. def this(text: String) = this(new jfoenixc.JFXButton(text))
  21. /**
  22. * Creates a button with the specified text and icon for its label.
  23. */
  24. def this(text: String, graphic: Node) =
  25. this(new jfoenixc.JFXButton(text, graphic))
  26. def ripplerFill: ObjectProperty[jfxsp.Paint] = delegate.ripplerFillProperty
  27. def ripplerFill_=(b: jfxsp.Paint): Unit = ripplerFill() = b
  28. def obsAction = new ActionObservableBuilder(this.observableAction)
  29. }