-
Notifications
You must be signed in to change notification settings - Fork 1
/
event.singkong
94 lines (79 loc) · 1.91 KB
/
event.singkong
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
reset()
var b = component("button", "Hello World (mouse event)")
var c = component("checkbox", "Singkong?")
var r = component("radio", "Radio Button")
var m = component("combobox", "Singkong,Programming,Language")
var t = component("table", "A,B", true)
var tm = component("table", "TYPE, X, Y, CLICK COUNT", true)
var tk = component("table", "TYPE, CHAR, CODE, KEY, ACTION, MODIFIER, LOCATION, ALT, ALT GRAPH, CONTROL, META, SHIFT", true)
var tf = component("table", "TYPE, WIDTH, HEIGHT, X, Y", true)
var pm = component("panel", "Mouse")
var pk = component("panel", "Keyboard")
var pf = component("panel", "Frame")
var ta = component("tab", "")
var e = component("edit", "")
var p = component("password", "")
var x = component("text", "")
var v = component("view", "")
panel_add(pm, tm, 10, 10, 300, 500)
tab_add(ta, pm)
panel_add(pk, tk, 10, 10, 300, 500)
tab_add(ta, pk)
panel_add(pf, tf, 10, 10, 300, 500)
tab_add(ta, pf)
var bb = fn() {
message(get(b,"text"))
}
event(b, bb)
var cc = fn() {
message(get(c,"active"))
}
event(c, cc)
var rr = fn() {
message(get(r,"active"))
}
event(r, rr)
var mm = fn() {
message(get(m, "text"))
}
event(m, mm)
config(t, "contents", [[1,2],[3,4],[5,6]])
var tt = fn() {
message(get(t, "contents")[get(t, "active")])
}
event(t, tt)
var ee = fn() {
var content = get(e, "contents")
config(v, "contents", content)
}
event(e, ee)
var pp = fn() {
message(get(p, "contents"))
}
event(p, pp)
var xx = fn() {
message(get(x, "contents"))
}
event(x, xx)
event_mouse(b, fn(m) {
table_add(tm, [m])
if (m[0] == "EXITED") {
var c = len(get(tm, "contents"))
table_scroll(tm, c-1)
}
})
event_keyboard_frame(fn(m) {
table_add(tk, [m])
})
event_frame(fn(m) {
table_add(tf, [m])
})
event(ta, fn() {
message(get(ta, "active"))
})
add_n([p, x])
add_s([b, c, r, m])
add([t, e, v, ta])
closing("Are you sure you want to quit this application?",
"Please confirm")
show()