import win.ui;
/*DSG{{*/
var winform = win.form(text="aardio form";right=943;bottom=351)
winform.add(
custom={cls="custom";text="自定义控件";left=488;top=8;right=936;bottom=344;bgcolor=0;border=1;z=2};
plus1={cls="plus";left=8;top=8;right=456;bottom=344;bgcolor=0;edge=1;notify=1;z=1}
)
/*}}*/
winform.show();
// 鼠标拖动实现
winform.plus1.addCtrl(
["plus"] = {cls="plus";left=0;top=0;right=800;bottom=500;z=1;background="/1691307138.png"}
)
winform.plus1.onMouseDown = function(wParam,lParam){
x,y = win.getMessagePos(lParam);
}
winform.plus1.onMouseDrag = function(wParam,lParam){
var x1,y1 = win.getMessagePos(lParam);
var l,t = winform.plus1.plus.left+(x1-x),winform.plus1.plus.top+(y1-y);
winform.plus1.plus.setPos(l,t);
x,y = x1,y1;
winform.plus1.update();
}
// 滚动条实现
winform.custom.addCtrl(
["plus"] = {cls="plus";left=0;top=0;right=800;bottom=500;z=1;background="/1691307138.png"}
)
import win.ui.scrollbar
var scw = win.ui.scrollbar(winform.custom,false)
var sch = win.ui.scrollbar(winform.custom,true)
scw.setRange(0,winform.custom.plus.right - winform.custom.width)
sch.setRange(0,winform.custom.plus.bottom - winform.custom.height)
win.loopMessage();