diff --git a/AlgebraicDataflowArchitectureModel/models/SimpleUI.model b/AlgebraicDataflowArchitectureModel/models/SimpleUI.model index 9b54346..3e03bbd 100644 --- a/AlgebraicDataflowArchitectureModel/models/SimpleUI.model +++ b/AlgebraicDataflowArchitectureModel/models/SimpleUI.model @@ -1,7 +1,12 @@ init { - screen := {"widgets": {"001": {"type": "button", "text": "OK", "state": 0}, - "002": {"type": "textInput", "text": "", "state": 0}}, - "layout": true} + screenTemplates := { + "000": {"widgets": {"001": {"type": "textInput", "text": "", "state": 0}, + "002": {"type": "button", "text": "Next", "state": 0}}, + "layout": true}, + "001": {"widgets": {"003": {"type": "label", "text": "label", "state": 0}, + "004": {"type": "button", "text": "Back", "state": 0}}, + "layout": true} + } } native channel ScreenUpdate { @@ -44,6 +49,16 @@ out screen.widgets.{wid}.text(curText: Str, textEvent(nextText)) = nextText } +channel ChangeCurScreen { + out curScreen(curScId: Str, changeCurScreen(nextScId)) = nextScId +} + +channel ScreenTransition { + in curScreen(curScId: Str, transScreen(nextScId, nextSc)) = nextScId + in screenTemplates.{nextScId}(curSc, transScreen(nextScId, nextSc)) = nextSc + out screen(curS, transScreen(nextScId, nextSc)) = nextSc +} + channel ChangeLayout { out screen.layout(curLayout: Bool, changeLayout(layout)) = layout } @@ -78,4 +93,4 @@ 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}) -} +} \ No newline at end of file