-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev.main.aardio
70 lines (53 loc) · 1.41 KB
/
dev.main.aardio
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
import win.ui;
/*DSG{{*/
mainForm = win.form(cls="sciterjs";text="view";right=761;bottom=554;border="none")
mainForm.add(
custom={cls="custom";text="view-cotent";left=0;top=0;right=762;bottom=555;ah=1;aw=1;db=1;dl=1;dr=1;dt=1;z=1}
)
/*}}*/
hwnd = _ARGV[1]
parent = _ARGV[2]
url = _ARGV[3]
if(!hwnd || !url) return null;
import web.sciter;
import web.sciter.debug;
var wbSciter = web.sciter( mainForm.custom );
wbSciter.go(url);
wbSciter.enableDebug()
wbSciter.attachEventHandler( web.sciter.debug );
win.setParent(mainForm.hwnd,parent)
var x,y,w,h = win.getPos(parent)
win.setPos(mainForm.hwnd,x,y - 10,w - 240,h - 132)
namespace web.sciter.behavior.customEvent {
reload = function(ltOwner){
import winex
winex.click(..hwnd)
}
testJs = function(ltOwner,...){
..mainForm.msgbox(...)
}
}
var loop = true
thread.invoke(
function(mainForm,parent,loop){
import win
var px,py,pw,ph = win.getPos(parent)
while(loop){
var x,y,w,h = win.getPos(parent)
if(px == x && py == y && pw == w && ph == h){
}else{
win.setPos(mainForm.hwnd,0,0,w,h)
px = x
py = y
pw = w
ph = h
}
sleep(1000)
}
},mainForm,parent,loop
)
mainForm.onClose = function(hwnd,message,wParam,lParam){
loop = false
}
mainForm.show();
return win.loopMessage();