forked from sciter-sdk/nsciter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
handlers.htm
103 lines (91 loc) · 2.91 KB
/
handlers.htm
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
<html window-icon="icon.png" resizeable>
<head>
<title>Sciter Testing Page</title>
<style type="text/css">
html {
/*overflow: hidden;*/
padding-left: 20dip;
/*min-width:20%;
width: 300dip;
max-width: 30%;
height: 400dip;*/
}
ol {
margin-left: 20dip;
padding-left: 20dip;
/*overflow: scroll;*/
}
div#btns {
}
div#output{
size:*;
overflow: scroll;
background-color: green;
assigned!: self::opacity = 1.0, self.start-timer(100);
timer!: self::opacity > 0.0?
self::opacity = self::opacity - 0.05 # return cancel /* to stop the timer */;
}
button#native {
color: yellow;
}
button#csss {
color:blue;
/*click!:gprintln("hello world", 11,22,33,44);*/ /* HANDLE_SCRIPTING_METHOD_CALL method don't work*/
}
malevich {
behavior: gdi-drawing;
display:block;
size:300dip;
}
</style>
<script type="text/tiscript">
//view.connectToInspector();
// for host calls
function gFunc(a,b){
return String.printf("script defined function with arg, a:%v, b:%v", a, b);
};
event click $(button#csss) {
view.gprintln("hello world", 11,22,33,44);
}
var root = view.root;
root.mfn = function(a, b){
return String.printf("script defined method function with arg, a:%v, b:%v", a, b);
};
// handlers
self.$(#functor).on("click", function() {
var k = view.kkk();
view.gprintln("gprintln kkkk" + String.printf(", k = %v", k));
view.gprintln("k.f(1,2,3,4.5):", k.f(1,2,3,4.5));
});
root.$(#sumall).on("click", function() {
view.gprintln("sumall(1,2,3,45):", view.sumall(1,2,3,45));
});
self.$(#mcall).on("click", function() {
root.mcall("nice to see you", 100.5, 123);
});
</script>
</head>
<body>
<H1>Sciter Testing Page</H1>
<div id="btns">
<button id="csss">CSS!!! Button</button>
<button id="functor">Tiscript Native Functor Button</button>
<button id="native">Native Handler Button</button>
<button id="sumall">Do Sum</button>
<button id="mcall">Method Call</button>
<form >
<label>X (Ctrl+1):</label><input type="integer" name="x" step="20" accesskey="^1" />
<label>Y (Ctrl+2):</label><input type="integer" name="y" step="20" accesskey="^2" />
</form>
</div>
<div id="output"> </div>
<h2>Native GDI drawing behavior demo</h2>
<p>See: sdk/include/behaviors/behavior_drawing-gdi.cpp</p>
<!-- In native code not working now -->
<popup role="tooltip" id="dyn-tooltip" format="Tooltip # %d">Tooltip</popup>
<malevich></malevich>
<!-- Test download url -->
<p>Url to load: <span id='url'>placed here</span></p>
<div id='content' style='size: *'></div>
</body>
</html>