Add onscreenapp
[apps/onscreenapp.git] / sample / qml / msg.qml
1 import QtQuick 2.6
2 import QtQuick.Window 2.2
3 import QtQuick.Layouts 1.1
4 import QtQuick.Controls 2.0
5 import AGL.Demo.Controls 1.0
6
7 Item {
8     id: onScreenMsg
9     visible: true
10     width: 1079
11     height: 400
12     scale: screenInfo.scale_factor()
13
14     function qmlOnScreenParameter(message) {
15         console.log(qsTr('OnScreenVICS:QML:System >>> qmlOnScreenMessage.'), message);
16         var message_json = JSON.parse (message);
17         data1.text = message_json.data1;
18         data2.text = message_json.data2;
19         data3.text = message_json.data3;
20     }
21
22     RowLayout {
23         id: line1
24         x: 40
25         y: 72
26         width: 1000
27         height: 200
28         spacing: 20
29         Label {
30             id: data1
31             color: "#eeeeec"
32             text: "show data1"
33             font.pixelSize: 20
34             textFormat: Text.AutoText
35             font.wordSpacing: 0
36             verticalAlignment: Text.AlignVCenter
37             horizontalAlignment: Text.AlignHCenter
38         }
39
40         Label {
41             id: data2
42             color: "#eeeeec"
43             text: "show data2"
44             font.pixelSize: 20
45             textFormat: Text.AutoText
46             font.wordSpacing: 0
47             verticalAlignment: Text.AlignVCenter
48             horizontalAlignment: Text.AlignHCenter
49         }
50
51         Label {
52             id: data3
53             color: "#eeeeec"
54             text: "show data3"
55             font.pixelSize: 20
56             textFormat: Text.AutoText
57             font.wordSpacing: 0
58             verticalAlignment: Text.AlignVCenter
59             horizontalAlignment: Text.AlignHCenter
60         }
61
62     }
63
64     RowLayout {
65         anchors.top: line1.bottom
66         anchors.topMargin: 60
67         anchors.horizontalCenter: parent.horizontalCenter
68         Button {
69             id: button1
70             text: qsTr("Button1")
71             onClicked: {
72                 eventHandler.onScreenReply("Button1");
73             }
74         }
75         Button {
76             id: button2
77             text: qsTr("Button2")
78             onClicked: {
79                 eventHandler.onScreenReply("Button2");
80             }
81         }
82         Button {
83             id: button3
84             text: qsTr("Button3")
85             onClicked: {
86                 eventHandler.onScreenReply("Button3");
87             }
88         }
89     }
90
91 }