-
Notifications
You must be signed in to change notification settings - Fork 1
/
AFDT.kv
289 lines (256 loc) · 6.15 KB
/
AFDT.kv
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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
<UI>:
#background color
canvas.before:
Color:
rgb: 0, 0, 0
Rectangle:
pos: self.pos
size: self.size
#UI reference
sysMessageLabel:sysMessageLabel
userHintMessageLabel:userHintMessageLabel
displayCode:displayCode
imageButton:imageButton
orientation: 'vertical'
BoxLayout:
orientation: 'vertical'
# show user hint
UserHintMessage:
id:userHintMessageLabel
halign: 'center'
valign: 'middle'
size_hint_y:0.1
text_size: root.width, None
font_size:app.uiFontSize
# component
BoxLayout:
orientation: 'horizontal'
size_hint_y: 0.9
ButtonList:
size_hint_x: 0.2
DisplayCode:
size_hint_x: 0.5
id:displayCode
ScrollView:
#orientation: 'vertical'
size_hint_x: 0.3
ImageButton:
id:imageButton
SysMessage:
size_hint_y: 0.1
id:sysMessageLabel
<ImageButton>:
canvas.before:
Color:
rgba: 1,1,1, 1
Rectangle:
pos: self.pos
size: self.size
allow_stretch: True
keep_ratio: False
size:root.size
size:root.size
source: app.getDiagram
on_release: root.viewImage()
<DisplayImage>:
Image:
source: app.getDiagram
allow_stretch: True
keep_ratio: True
<userHelpDialog>:
BoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
ScrollView:
Label:
font_size:app.uiFontSize
text:"[b]<Hot key>[/b]\n- Ctrl+S Save image\n- Ctrl+O Open file\n- Ctrl+P Analysis\n[b]<Tips>[/b]\n- You can drag files directly into the code block.\n- Click the diagram to see more clearly.\n- Click clear but\n[b]<Notice>[/b]\n- This program now can only analysis C and C++ grammar\n- Please don't paste any personal information on our program"
text_size: root.width, None
markup : True
BoxLayout:
size_hint_y: None
height: 30
Button:
text: "OK"
on_release: root.ok()
<ButtonList>:
orientation: 'vertical'
Button:
font_name: './LucidaGrande'
id:importfile_btn
halign: 'center'
text_size: root.width, None
font_size:app.uiFontSize
text: 'Import file'
on_release:root.importFile()
Button:
font_name: './LucidaGrande'
id:drawdiagram_btn
halign: 'center'
text_size: root.width, None
font_size:app.uiFontSize
text: 'Draw Diagram'
on_release: root.draw()
Button:
font_name: './LucidaGrande'
id:clear_btn
halign: 'center'
text_size: root.width, None
font_size:app.uiFontSize
text: 'Clear'
on_release:root.clear()
Button:
font_name: './LucidaGrande'
id:saveimage_btn
halign: 'center'
text_size: root.width, None
font_size:app.uiFontSize
text: 'Save Image'
on_release:root.saveFile()
Button:
font_name: './LucidaGrande'
id:userpreference_btn
halign: 'center'
text_size: root.width, None
font_size:app.uiFontSize
text: 'User Prefernce'
on_release:root.setting()
Button:
font_name: './LucidaGrande'
id:userhelp_btn
halign: 'center'
text_size: root.width, None
font_size:app.uiFontSize
text: 'user help'
on_release:root.userhelp()
<floatImage>
BoxLayout:
pos: root.pos
DisplayImage:
<DisplayCode>
text: ''
font_size: app.codeFontSize
Label:
id:displayCodeLabel
font_name:'./kaiu'
font_size:root.font_size
text: root.text
text_size: root.width, None
size_hint_y: None
height: self.texture_size[1]
<UserHintMessage>:
font_name: './LucidaGrande'
text: 'User hint'
canvas.before:
Color:
rgb: 60/255, 60/255, 60/255
Rectangle:
pos: self.pos
size: self.size
<SysMessage>:
font_name: './LucidaGrande'
font_size:app.uiFontSize
text: 'Welcome to AFDT'
canvas.before:
Color:
rgb: 0, 122/255, 204/255
Rectangle:
pos: self.pos
size: self.size
<LoadDialog>:
BoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
FileChooserListView:
id: filechooser
BoxLayout:
size_hint_y: None
height: 30
Button:
text: "Cancel"
on_release: root.cancel()
Button:
text: "Load"
on_release: root.load(filechooser.path, filechooser.selection)
<SaveDialog>:
text_input: text_input
BoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
FileChooserListView:
id: filechooser
on_selection: text_input.text = self.selection and self.selection[0] or ''
TextInput:
id: text_input
size_hint_y: None
height: 30
multiline: False
BoxLayout:
size_hint_y: None
height: 30
Button:
text: "Cancel"
on_release: root.cancel()
Button:
text: "Save"
on_release: root.save(filechooser.path, text_input.text)
<settingDialog>:
#textExample:textExample
BoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
padding:30
#BoxLayout:
# Label:
# width: root.width*0.5
# text: "PreView"
# font_size: app.codeFontSize
# id:textExample
BoxLayout:
size_hint_y: 0.55
orientation: 'horizontal'
Label:
size_hint_x:0.2
text:"UI font size"
Slider:
id: uifontSizeValue
min: 10
max: 50
value: app.uiFontSize
step: 1
orientation: 'horizontal'
on_touch_move:
app.uiFontSize = uifontSizeValue.value
BoxLayout:
size_hint_y: 0.1
BoxLayout:
size_hint_y: 0.55
orientation: 'horizontal'
Label:
size_hint_x:0.2
text:"Code font size"
Slider:
id: codefontSizeValue
min: 10
max: 50
value: app.codeFontSize
step: 1
orientation: 'horizontal'
on_touch_move:
app.codeFontSize = codefontSizeValue.value
#BoxLayout:
# size_hint_y: 0.5
# height: 30
# Button:
# text: "Cancel"
# on_release: root.cancel()
# Button:
# text: "OK"
# on_release: root.ok(str(app.codeFontSize))
#Label:
# size_hint_y: 0.2
# text: str(codefontSizeValue.value)