diff --git a/AlgebraicDataflowArchitectureModel/models/SimpleUI.model b/AlgebraicDataflowArchitectureModel/models/SimpleUI.model index 3b0d023..ac3c51d 100644 --- a/AlgebraicDataflowArchitectureModel/models/SimpleUI.model +++ b/AlgebraicDataflowArchitectureModel/models/SimpleUI.model @@ -2,6 +2,10 @@ in screen(curSc: Json, update(curSc, nextSc)) = nextSc } +native channel SetLayout { + in screen.layout(curLayout: Bool, setLayout(nextLayout)) = nextLayout +} + native channel SetVisible(wid: Str) { in screen.widgets.{wid}.visible(curVisible: Bool, setVisible(nextVisible)) = nextVisible } @@ -10,6 +14,22 @@ in screen.widgets.{wid}.text(curText: Str, setText(nextText)) = nextText } +native channel SetX(wid: Str) { + in screen.widgets.{wid}.x(curX: Int, setX(nextX)) = nextX +} + +native channel SetY(wid: Str) { + in screen.widgets.{wid}.y(curY: Int, setY(nextY)) = nextY +} + +native channel SetWidth(wid: Str) { + in screen.widgets.{wid}.width(curWidth: Int, setWidth(nextWidth)) = nextWidth +} + +native channel SetHeight(wid: Str) { + in screen.widgets.{wid}.height(curHeight: Int, setHeight(nextHeight)) = nextHeight +} + native channel MouseEvent(wid: Str) { out screen.widgets.{wid}.state(curState: Int, mouseEvent(nextState)) = nextState } @@ -18,6 +38,18 @@ out screen.widgets.{wid}.text(curText: Str, textEvent(nextText)) = nextText } +channel ChangeLayout { + out screen.layout(curLayout: Bool, changeLayout(layout)) = layout +} + +channel ChangeX(wid: Str) { + out screen.widgets.{wid}.x(curX: Int, changeX(x)) = x +} + +channel ChangeY(wid: Str) { + out screen.widgets.{wid}.y(curY: Int, changeY(y)) = y +} + channel AddButton { out screen.widgets(widgets: Map, addButton(wid: Str, text: Str)) = insert(widgets, wid, {"type": "button", "text": text, "state": 0}) } @@ -28,4 +60,16 @@ channel AddTextInput { out screen.widgets(widgets: Map, addTextInput(wid: Str)) = insert(widgets, wid, {"type": "textInput", "text": "", "state": 0}) -} \ No newline at end of file +} + +channel AddMovableButton { + out screen.widgets(widgets: Map, addMovableButton(wid: Str, text: Str, x: Int, y: Int, width: Int, height: Int)) = insert(widgets, wid, {"type": "button", "text": text, "x": x, "y": y, "width": width, "height": height, "state": 0}) +} + +channel AddMovableLabel { + out screen.widgets(widgets: Map, addMovableLabel(wid: Str, text: Str, x: Int, y: Int, width: Int, height: Int)) = insert(widgets, wid, {"type": "label", "text": text, "x": x, "y": y, "width": width, "height": height, "state": 0}) +} + +channel AddMovableTextInput { + out screen.widgets(widgets: Map, addMovableTextInput(wid: Str, x: Int, y: Int, width: Int, height: Int)) = insert(widgets, wid, {"type": "textInput", "text": "", "x": x, "y": y, "width": width, "height": height, "state": 0}) +}