summaryrefslogtreecommitdiffstats
path: root/kommander/examples/tutorial/dialogs.kmdr
blob: 421f0607b5c9f264dd4eecece5f23436f4064056 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
<class>DialogTest</class>
<comment>This is my program</comment>
<author>MichaƂ Rudolf</author>
<license>GPL</license>
<version>0.1</version>
<widget class="Dialog">
    <property name="name">
        <cstring>DialogTest</cstring>
    </property>
    <property name="geometry">
        <rect>
            <x>0</x>
            <y>0</y>
            <width>600</width>
            <height>428</height>
        </rect>
    </property>
    <property name="caption">
        <string>Test of Dialogs</string>
    </property>
    <property name="associations" stdset="0">
        <stringlist>
            <string></string>
            <string></string>
            <string></string>
        </stringlist>
    </property>
    <property name="useInternalParser">
        <bool>true</bool>
    </property>
    <grid>
        <property name="name">
            <cstring>unnamed</cstring>
        </property>
        <property name="margin">
            <number>11</number>
        </property>
        <property name="spacing">
            <number>6</number>
        </property>
        <widget class="ExecButton" row="1" column="0">
            <property name="name">
                <cstring>ExecButton1</cstring>
            </property>
            <property name="text">
                <string>Run dialogs...</string>
            </property>
            <property name="associations" stdset="0">
                <stringlist>
                    <string>message_info("This is a demonstration of various KDE dialogs", "Demo")
message_error("Cannot enter 3D mode")
if message_question("Do you want to continue?") &lt;&gt; 1 then
   debug("Cancelled")
endif
if message_warning("Are you sure you want to continue?") &lt;&gt; 1 then
   debug("Aborted")
endif


echo("Hello world!")
a = input_text("Input text", "Text", "Default text")
LineEdit1.setText(a)

a = input_color
LineEdit2.setText(a)

a = input_value("Input value", "Value", 10, 1, 100)
LineEdit3.setText(a)

a = input_openfile
LineEdit4.setText(a)

echo("This is a test too")
a = input_savefile
LineEdit5.setText(a)

a = input_directory
LineEdit6.setText(a)

a = input_openfiles
ListBox1.setText(a)

</string>
                </stringlist>
            </property>
        </widget>
        <widget class=TQLAYOUTWIDGET_OBJECT_NAME_STRING row="0" column="0">
            <property name="name">
                <cstring>Layout1</cstring>
            </property>
            <grid>
                <property name="name">
                    <cstring>unnamed</cstring>
                </property>
                <property name="margin">
                    <number>0</number>
                </property>
                <property name="spacing">
                    <number>6</number>
                </property>
                <widget class="Label" row="4" column="0">
                    <property name="name">
                        <cstring>Label6</cstring>
                    </property>
                    <property name="text">
                        <string>File to save:</string>
                    </property>
                </widget>
                <widget class="Label" row="1" column="0">
                    <property name="name">
                        <cstring>Label2</cstring>
                    </property>
                    <property name="text">
                        <string>Color:</string>
                    </property>
                </widget>
                <widget class="ListBox" row="6" column="1">
                    <property name="name">
                        <cstring>ListBox1</cstring>
                    </property>
                </widget>
                <widget class="Label" row="6" column="0">
                    <property name="name">
                        <cstring>Label5</cstring>
                    </property>
                    <property name="text">
                        <string>Files to open:</string>
                    </property>
                </widget>
                <widget class="Label" row="5" column="0">
                    <property name="name">
                        <cstring>Label7</cstring>
                    </property>
                    <property name="text">
                        <string>Directory:</string>
                    </property>
                </widget>
                <widget class="Label" row="2" column="0">
                    <property name="name">
                        <cstring>Label3</cstring>
                    </property>
                    <property name="text">
                        <string>Value:</string>
                    </property>
                </widget>
                <widget class="LineEdit" row="0" column="1">
                    <property name="name">
                        <cstring>LineEdit1</cstring>
                    </property>
                </widget>
                <widget class="Label" row="3" column="0">
                    <property name="name">
                        <cstring>Label4</cstring>
                    </property>
                    <property name="text">
                        <string>File to open:</string>
                    </property>
                </widget>
                <widget class="LineEdit" row="2" column="1">
                    <property name="name">
                        <cstring>LineEdit3</cstring>
                    </property>
                </widget>
                <widget class="LineEdit" row="3" column="1">
                    <property name="name">
                        <cstring>LineEdit4</cstring>
                    </property>
                </widget>
                <widget class="LineEdit" row="4" column="1">
                    <property name="name">
                        <cstring>LineEdit5</cstring>
                    </property>
                </widget>
                <widget class="LineEdit" row="1" column="1">
                    <property name="name">
                        <cstring>LineEdit2</cstring>
                    </property>
                </widget>
                <widget class="LineEdit" row="5" column="1">
                    <property name="name">
                        <cstring>LineEdit6</cstring>
                    </property>
                </widget>
                <widget class="Label" row="0" column="0">
                    <property name="name">
                        <cstring>Label1</cstring>
                    </property>
                    <property name="text">
                        <string>Text:</string>
                    </property>
                </widget>
            </grid>
        </widget>
    </grid>
</widget>
<tqlayoutdefaults spacing="6" margin="11"/>
</UI>