-
Notifications
You must be signed in to change notification settings - Fork 9
/
msgget.prg
78 lines (46 loc) · 1.42 KB
/
msgget.prg
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
// {% LoadHrb( 'lib/tweb/tweb.hrb' ) %}
#include {% TWebInclude() %}
function main()
LOCAL o
DEFINE WEB oWeb TITLE 'MsgInfo()' INIT
DEFINE FORM o
HTML o FILE 'templates/title_test.tpl' PARAMS 'Test MsgInfo()'
INIT FORM o
ROWGROUP o
SAY VALUE "MsgGet( cVar ) -> Error" GRID 6 ALIGN 'right' OF o
BUTTON LABEL 'Test' GRID 4 ACTION "Test0()" OF o
ENDROW o
ROWGROUP o
SAY VALUE "MsgGet( cVar, fCallback )" GRID 6 ALIGN 'right' OF o
BUTTON LABEL 'Test' GRID 4 ACTION "Test1()" OF o
ENDROW o
ROWGROUP o
SAY VALUE "MsgGet( cMsg, fCallback, cTitle )" GRID 6 ALIGN 'right' OF o
BUTTON LABEL 'Test' GRID 4 ACTION "Test2()" OF o
ENDROW o
ROWGROUP o
SAY VALUE "MsgInfo( cMsg, fCallback, cTitle, Icon )" GRID 6 ALIGN 'right' OF o
BUTTON LABEL 'Test' GRID 4 ACTION "Test3()" OF o
ENDROW o
HTML o
<script>
function Test0() {
// Error. No callback defined
MsgGet( 'James Bond' )
}
function Test1() {
MsgGet( 'James Bond', MyFunc )
}
function Test2() {
MsgGet( 'James Bond', MyFunc, 'My Card' )
}
function Test3() {
MsgGet( 'James Bond', MyFunc, 'My Card', '<i class="far fa-address-card"></i>' )
}
function MyFunc( u ) {
MsgInfo( u )
}
</script>
ENDTEXT
END FORM o
retu nil