Skip to content

GemColumn

GemColumn is a container which arranges input elements vertically.

Usage Examples

/* (c) https://github.com/MontiCore/monticore */
package example_arrange;

import mc.fenix.arrange.GemColumn;
import mc.fenix.basic.GemText;
import common.ExamplePage;

page GemColumnExample() {
  @ExamplePage(
    component = @GemColumn(
      rowGap = "15px",
      components = [
        @GemText(value = "First row"),
        @GemText(value = "Second row"),
        @GemText(value = "Third row")
      ]
    ),
    basePath = "example_arrange",
    componentName = "GemColumnExample"
  );
}
GemColumnExample

/* (c) https://github.com/MontiCore/monticore */
package example_arrange;

import mc.fenix.arrange.GemColumn;
import mc.fenix.basic.GemText;
import common.ExamplePage;

/**
  Following example shows a `300 x 200` column. The horizontal alignment of
  elements is set to evenly distribute extra space to the left of the column
  containing two rows, between the column and the "Third row", and to the right of
  the "Third row". The outer column is set to wrap elements that cannot fit into
  the container. Since the inner column has height of `100%`, the "Third row" is
  forced to wrap. The inner column sets vertical align to `"bottom"` which forces
  "First row" and "Second row" to the bottom of the container. The `rowGap` is set
  to `"5px"` which creates a gap between the "First row" and "Second row".
*/
page GemColumnExample2() {
  @ExamplePage(
    component = outer@GemColumn(
      width = "300px",
      height = "200px",
      hAlign = "space-evenly",
      wrap = "wrap",
      components = [
        inner@GemColumn(
          width = "30%",
          height = "100%",
          vAlign = "bottom",
          rowGap = "5px",
          components = [
            @GemText(value = "First row"),
            @GemText(value = "Second row")
          ]
        ),
        @GemText(value = "Third row")
      ]
    ),
    basePath = "example_arrange",
    componentName = "GemColumnExample2"
  );
}
GemColumnExample2

GUI Model

component GemColumn(
  String height = "auto",
  String width = "auto",
  String hAlign = "stretch",
  String vAlign = "stretch",
  String rowGap = "0",
  String colGap = "0",
  String wrap = "nowrap",
  List<GUIViewElement> components,
  GUIViewElement component,
  String style = ""
)
Name Type Description Default value
height String Height of the component in px, %, vh. "auto"
width String Width of the component in px, %, vh. "auto"
hAlign String Horizontal alignment of the embedded components. Invalid values are ignored. Possible values: "left", "center", "right": Set position of the elements inside the container. "stretch": Stretch elements proportionally to fill space if the elements' size is not specified. "space-between": Distribute empty space equally between the elements. "space-around": Distribute empty space around each element equally. "space-evenly": Distribute empty space around the elements and make those gaps equal size. "stretch"
vAlign String Vertical alignment of the embedded components. Invalid values are ignored. Possible values: "top", "center", "bottom": Set position of the elements inside the container. "stretch": Stretch elements proportionally to fill space if the elements' size is not specified. "space-between": Distribute empty space equally between the elements. "space-around": Distribute empty space around the elements equally. "space-evenly": Distribute empty space around the elements and make those gaps equal size. "stretch"
rowGap String Gap between rows of elements in the container in px, %, vh, etc. "0"
colGap String Gap between columns of elements in the container in px, %, vh, etc. Relevant when wrap is set to "wrap" or "wrap-reverse". "0"
wrap String Set behavior for element wrapping. Invalid values are ignored. "nowrap": Elements are never wrapped. If elements do not into the container, a scrollbar appears. "wrap": Elements that do not fit into the container are wrapped, i.e. a new column is created to the right. "wrap-reverse": Similar to "wrap", but a new column is created to the left. "nowrap"
components List<GUIViewElement> Components to display inside a column.
component GUIViewElement Deprecated. Shortcut for components property for the case when only one component has to be displayed. If both component and components are defined, component is shown first.
style String Deprecated. ""