import de.unixwork.ui.Button
import de.unixwork.ui.ButtonBuilder
+import de.unixwork.ui.Container
+import de.unixwork.ui.ContainerBuilder
+import de.unixwork.ui.ContainerUI
import de.unixwork.ui.EventHandler
import de.unixwork.ui.EventWrapper.eventHandler
import de.unixwork.ui.ToggleBuilder
block()
}
+ private fun createContainer(
+ builder: ContainerBuilder,
+ fill: Boolean = false,
+ hexpand: Boolean = false,
+ vexpand: Boolean = false,
+ hfill: Boolean = false,
+ vfill: Boolean = false,
+ overrideDefaults: Boolean = false,
+ defhexpand: Boolean = false,
+ defvexpand: Boolean = false,
+ defhfill: Boolean = false,
+ defvfill: Boolean = false,
+ colspan: Int = -1,
+ rowspan: Int = -1,
+ name: String? = null,
+ styleClass: String? = null,
+ margin: Int = -1,
+ spacing: Int = -1,
+ columnspacing: Int = -1,
+ rowspacing: Int = -1,
+ ui: ContainerUI? = null
+ ): UiWidget {
+ val container = Container.vbox(obj)
+ if(hexpand) {
+ container.hexpand(true)
+ }
+ if(vexpand) {
+ container.vexpand(true)
+ }
+ if(hfill) {
+ container.hfill(true)
+ }
+ if(vfill) {
+ container.vfill(true)
+ }
+ if(overrideDefaults) {
+ container.overrideDefaults(true)
+ }
+ if(defhexpand) {
+ container.defaultHExpand(true)
+ }
+ if(defvexpand) {
+ container.defaultVExpand(true)
+ }
+ if(defhfill) {
+ container.defaultHfill(true)
+ }
+ if(defvfill) {
+ container.defaultVfill(true)
+ }
+ if(colspan > 0) {
+ container.colspan(colspan)
+ }
+ if(rowspan > 0) {
+ container.rowspan(rowspan)
+ }
+ if(margin > 0) {
+ container.margin(margin)
+ }
+ if(spacing > 0) {
+ container.spacing(spacing)
+ }
+ if(columnspacing > 0) {
+ container.columnspacing(columnspacing)
+ }
+ if(rowspacing > 0) {
+ container.rowspacing(rowspacing)
+ }
+
+ return container.create(ui)
+ }
+
+ fun hbox(
+ fill: Boolean = false,
+ hexpand: Boolean = false,
+ vexpand: Boolean = false,
+ hfill: Boolean = false,
+ vfill: Boolean = false,
+ overrideDefaults: Boolean = false,
+ colspan: Int = -1,
+ rowspan: Int = -1,
+ name: String? = null,
+ styleClass: String? = null,
+ margin: Int = -1,
+ spacing: Int = -1,
+ ui: ContainerUI? = null
+ ): UiWidget {
+ return createContainer(
+ builder = Container.hbox(obj),
+ fill = fill,
+ hexpand = hexpand,
+ vexpand = vexpand,
+ hfill = hfill,
+ vfill = vfill,
+ overrideDefaults = overrideDefaults,
+ colspan = colspan,
+ rowspan = rowspan,
+ name = name,
+ styleClass = styleClass,
+ margin = margin,
+ spacing = spacing,
+ ui = ui
+ )
+ }
+
+
+ fun vbox(
+ fill: Boolean = false,
+ hexpand: Boolean = false,
+ vexpand: Boolean = false,
+ hfill: Boolean = false,
+ vfill: Boolean = false,
+ overrideDefaults: Boolean = false,
+ colspan: Int = -1,
+ rowspan: Int = -1,
+ name: String? = null,
+ styleClass: String? = null,
+ margin: Int = -1,
+ spacing: Int = -1,
+ ui: ContainerUI? = null
+ ): UiWidget {
+ return createContainer(
+ builder = Container.vbox(obj),
+ fill = fill,
+ hexpand = hexpand,
+ vexpand = vexpand,
+ hfill = hfill,
+ vfill = vfill,
+ overrideDefaults = overrideDefaults,
+ colspan = colspan,
+ rowspan = rowspan,
+ name = name,
+ styleClass = styleClass,
+ margin = margin,
+ spacing = spacing,
+ ui = ui
+ )
+ }
+
+
+ fun grid(
+ fill: Boolean = false,
+ hexpand: Boolean = false,
+ vexpand: Boolean = false,
+ hfill: Boolean = false,
+ vfill: Boolean = false,
+ overrideDefaults: Boolean = false,
+ defhexpand: Boolean = false,
+ defvexpand: Boolean = false,
+ defhfill: Boolean = false,
+ defvfill: Boolean = false,
+ colspan: Int = -1,
+ rowspan: Int = -1,
+ name: String? = null,
+ styleClass: String? = null,
+ margin: Int = -1,
+ spacing: Int = -1,
+ columnspacing: Int = -1,
+ rowspacing: Int = -1,
+ ui: ContainerUI? = null
+ ): UiWidget {
+ return createContainer(
+ builder = Container.grid(obj),
+ fill = fill,
+ hexpand = hexpand,
+ vexpand = vexpand,
+ hfill = hfill,
+ vfill = vfill,
+ overrideDefaults = overrideDefaults,
+ defhexpand = defhexpand,
+ defhfill = defhfill,
+ defvexpand = defvexpand,
+ defvfill = defhfill,
+ colspan = colspan,
+ rowspan = rowspan,
+ name = name,
+ styleClass = styleClass,
+ margin = margin,
+ spacing = spacing,
+ columnspacing = columnspacing,
+ rowspacing = rowspacing,
+ ui = ui
+ )
+ }
+
fun button(
label: String? = null,
stockId: String? = null,