d6adb97d08a5867d68bf852fb1c1e9f5ec1d0213
[apps/onscreenapp.git] / sample / ons / 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
13     function qmlOnScreenParameter(message) {
14         console.log(qsTr('OnScreenVICS:QML:System >>> qmlOnScreenMessage.'), message);
15         var message_json = JSON.parse (message);
16         data1.text = message_json.data1;
17         data2.text = message_json.data2;
18         data3.text = message_json.data3;
19     }
20
21     RowLayout {
22         id: line1
23         x: 40
24         y: 72
25         width: 1000
26         height: 200
27         spacing: 20
28         Label {
29             id: data1
30             color: "#eeeeec"
31             text: "show data1"
32             font.pixelSize: 20
33             textFormat: Text.AutoText
34             font.wordSpacing: 0
35             verticalAlignment: Text.AlignVCenter
36             horizontalAlignment: Text.AlignHCenter
37         }
38
39         Label {
40             id: data2
41             color: "#eeeeec"
42             text: "show data2"
43             font.pixelSize: 20
44             textFormat: Text.AutoText
45             font.wordSpacing: 0
46             verticalAlignment: Text.AlignVCenter
47             horizontalAlignment: Text.AlignHCenter
48         }
49
50         Label {
51             id: data3
52             color: "#eeeeec"
53             text: "show data3"
54             font.pixelSize: 20
55             textFormat: Text.AutoText
56             font.wordSpacing: 0
57             verticalAlignment: Text.AlignVCenter
58             horizontalAlignment: Text.AlignHCenter
59         }
60
61     }
62
63     RowLayout {
64         anchors.top: line1.bottom
65         anchors.topMargin: 60
66         anchors.horizontalCenter: parent.horizontalCenter
67         Button {
68             id: button1
69             text: qsTr("Button1")
70             onClicked: {
71                 eventHandler.onScreenReply("Button1");
72             }
73         }
74         Button {
75             id: button2
76             text: qsTr("Button2")
77             onClicked: {
78                 eventHandler.onScreenReply("Button2");
79             }
80         }
81         Button {
82             id: button3
83             text: qsTr("Button3")
84             onClicked: {
85                 eventHandler.onScreenReply("Button3");
86             }
87         }
88     }
89
90 }