-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
玖兰百夜烟花
authored
May 21, 2023
1 parent
24cc875
commit 7479c02
Showing
2 changed files
with
123 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,128 +1,123 @@ | ||
import win.ui | ||
import thread.table | ||
import win.util.tray | ||
import win.animate | ||
/*DSG{{*/ | ||
mainForm = win.form(cls="TIME_TIP_FORM";text="时钟";left=0;top=100;right=232;bottom=147;border="none";exmode="toolwindow";max=false;min=false;sysmenu=false;topmost=1) | ||
mainForm.add( | ||
dot1={cls="static";text=":";left=64;top=0;right=83;bottom=47;align="center";center=1;color=255;db=1;dl=1;dt=1;font=LOGFONT(h=-48;name='微软雅黑');transparent=1;z=3}; | ||
dot2={cls="static";text=":";left=149;top=0;right=168;bottom=47;align="center";center=1;color=255;db=1;dl=1;dr=1;dt=1;font=LOGFONT(h=-48;name='微软雅黑');transparent=1;z=4}; | ||
hotkey={cls="hotkey";left=199;top=27;right=232;bottom=47;edge=1;hide=1;z=6}; | ||
hour={cls="static";left=0;top=0;right=63;bottom=47;align="center";center=1;db=1;dl=1;dt=1;font=LOGFONT(h=-48;name='微软雅黑');transparent=1;z=1}; | ||
min={cls="static";left=84;top=0;right=147;bottom=47;align="center";center=1;db=1;dl=1;dt=1;font=LOGFONT(h=-48;name='微软雅黑');transparent=1;z=2}; | ||
sec={cls="static";left=169;top=0;right=232;bottom=47;align="center";center=1;db=1;dr=1;dt=1;font=LOGFONT(h=-48;name='微软雅黑');transparent=1;z=5} | ||
) | ||
/*}}*/ | ||
|
||
if(!io.exist(io._exedir + "time_config.ini")){ | ||
string.save(io._exedir + "time_config.ini",$"\res\time_config.ini")} | ||
|
||
mainForm.tray = win.util.tray(mainForm) | ||
var app_window = win.animate.slide(mainForm) | ||
var time_list = thread.table("v_share_list",true) | ||
|
||
io.open() | ||
|
||
thread.invoke( | ||
function(mainForm){ | ||
import win.ui | ||
import thread.table | ||
time_list = thread.table("v_share_list") | ||
var temp = 1 | ||
var hotkey_list = {0,0} | ||
for i in io.lines(io.open(io._exedir + "time_config.ini","r")){ | ||
//io.print(i) | ||
if(string.left(i,1,true) == "&"){ | ||
time_list.set(tostring(temp),tostring(string.right(i,-2,true))) | ||
temp = temp + 1 | ||
}elseif(string.left(i,1,true) == "@"){ | ||
hotkey_list[1] = tonumber(string.right(i,-2,true)) | ||
}elseif(string.left(i,1,true) == "%"){ | ||
hotkey_list[2] = tonumber(string.right(i,-2,true)) + 64 | ||
} | ||
} | ||
if (hotkey_list[2] != 0){ | ||
mainForm.hotkey.value = hotkey_list | ||
if((mainForm.hotkey.value[2] != 0) and (mainForm.hotkey.value[2] != null)){ | ||
mainForm.hotkey.value = hotkey_list | ||
} | ||
} | ||
},mainForm,hotkey_ctrl | ||
) | ||
|
||
|
||
thread.invoke( | ||
function(mainForm,time_str,show_hide){ | ||
import thread.table | ||
import win.animate | ||
while(sleep(333)){ | ||
time_now = time() | ||
if(tonumber(time_now.hour) < 10){ | ||
mainForm.hour.text = "0" + tostring(time_now.hour) | ||
}else{ | ||
mainForm.hour.text = tostring(time_now.hour)} | ||
if(tonumber(time_now.minute) < 10){ | ||
mainForm.min.text = "0" + tostring(time_now.minute) | ||
}else{ | ||
mainForm.min.text = tostring(time_now.minute)} | ||
if(tonumber(time_now.second) < 10){ | ||
mainForm.sec.text = "0" + tostring(time_now.second) | ||
}else{ | ||
mainForm.sec.text = tostring(time_now.second) | ||
} | ||
time_str = thread.table("v_share_list").tostring() | ||
var find_1,find_2 = string.indexOf(time_str,tostring(time_now,"%H%M%S")) | ||
if(find_1 != null){ | ||
mainForm.hour.color = 255 | ||
mainForm.min.color = 255 | ||
mainForm.sec.color = 255 | ||
mainForm.redraw() | ||
app_window = win.animate.slide(mainForm) | ||
app_window.show(1000,0x1/*水平自左向右*/) | ||
win.delay(5000) | ||
app_window.hide(500,0x2/*水平自右向左*/) | ||
mainForm.hour.color = 0 | ||
mainForm.min.color = 0 | ||
mainForm.sec.color = 0 | ||
} | ||
} | ||
},mainForm,time_list,show_hide | ||
) | ||
|
||
mainForm.onTrayMessage = { | ||
[0x205/*_WM_RBUTTONUP*/ ] = function(wParam){ | ||
mainForm.close()}; | ||
[0x202/*_WM_LBUTTONUP*/] = function(wParam){ | ||
mainForm.reghotkey( | ||
function(id,mod,vk){ | ||
app_window.show(1000,0x1/*水平自左向右*/) | ||
win.delay(5000) | ||
app_window.hide(500,0x2/*水平自右向左*/) | ||
}, | ||
mainForm.hotkey.gethotkey() | ||
) | ||
app_window.show(1000,0x1/*水平自左向右*/) | ||
win.delay(5000) | ||
app_window.hide(500,0x2/*水平自右向左*/) | ||
}; | ||
[0x203/*_WM_LBUTTONDBLCLK*/] = function(wParam){}; | ||
[0x404/*_PARAM_DESTROY*/] = function(wParam){}; | ||
[0x405/*_PARAM_CLICKED*/] = function(wParam){};} | ||
|
||
mainForm.onMouseDown = function(wParam,lParam){ | ||
mainForm.hitCaption() | ||
} | ||
|
||
mainForm.wndproc = function(hwnd,message,wParam,lParam){ | ||
select(message){ | ||
case 0x206/*_WM_RBUTTONDBLCLK*/{ | ||
mainForm.close() | ||
} | ||
} | ||
} | ||
|
||
mainForm.button.oncommand = function(id,event){ | ||
win.msgbox("sdf") | ||
} | ||
|
||
import win.ui | ||
import thread.table | ||
import win.util.tray | ||
import win.animate | ||
/*DSG{{*/ | ||
mainForm = win.form(cls="TIME_TIP_FORM";text="时钟";left=0;top=100;right=232;bottom=147;border="none";exmode="toolwindow";max=false;min=false;sysmenu=false;topmost=1) | ||
mainForm.add( | ||
dot1={cls="static";text=":";left=64;top=0;right=83;bottom=47;align="center";center=1;color=255;db=1;dl=1;dt=1;font=LOGFONT(h=-48;name='微软雅黑');transparent=1;z=3}; | ||
dot2={cls="static";text=":";left=149;top=0;right=168;bottom=47;align="center";center=1;color=255;db=1;dl=1;dr=1;dt=1;font=LOGFONT(h=-48;name='微软雅黑');transparent=1;z=4}; | ||
hotkey={cls="hotkey";left=199;top=27;right=232;bottom=47;edge=1;hide=1;z=6}; | ||
hour={cls="static";left=0;top=0;right=63;bottom=47;align="center";center=1;db=1;dl=1;dt=1;font=LOGFONT(h=-48;name='微软雅黑');transparent=1;z=1}; | ||
min={cls="static";left=84;top=0;right=147;bottom=47;align="center";center=1;db=1;dl=1;dt=1;font=LOGFONT(h=-48;name='微软雅黑');transparent=1;z=2}; | ||
sec={cls="static";left=169;top=0;right=232;bottom=47;align="center";center=1;db=1;dr=1;dt=1;font=LOGFONT(h=-48;name='微软雅黑');transparent=1;z=5} | ||
) | ||
/*}}*/ | ||
|
||
if(!io.exist(io._exedir + "time_config.ini")){ | ||
string.save(io._exedir + "time_config.ini",$"\res\time_config.ini") | ||
mainForm.close() | ||
} | ||
|
||
mainForm.tray = win.util.tray(mainForm) | ||
var app_window = win.animate.slide(mainForm) | ||
var time_list = thread.table("v_share_list",true) | ||
|
||
thread.invoke( | ||
function(mainForm){ | ||
import win.ui | ||
import thread.table | ||
time_list = thread.table("v_share_list") | ||
var temp = 1 | ||
var hotkey_list = {0,0} | ||
for i in io.lines(io.open(io._exedir + "time_config.ini","r")){ | ||
if(string.left(i,1,true) == "&"){ | ||
time_list.set(tostring(temp),tostring(string.right(i,-2,true))) | ||
temp = temp + 1 | ||
}elseif(string.left(i,1,true) == "@"){ | ||
hotkey_list[1] = tonumber(string.right(i,-2,true)) | ||
}elseif(string.left(i,1,true) == "%"){ | ||
hotkey_list[2] = tonumber(string.right(i,-2,true)) + 64 | ||
} | ||
} | ||
if (hotkey_list[2] != 0){ | ||
mainForm.hotkey.value = hotkey_list | ||
if((mainForm.hotkey.value[2] != 0) and (mainForm.hotkey.value[2] != null)){ | ||
mainForm.hotkey.value = hotkey_list | ||
} | ||
} | ||
},mainForm,hotkey_ctrl | ||
) | ||
|
||
|
||
thread.invoke( | ||
function(mainForm,time_str,show_hide){ | ||
import thread.table | ||
import win.animate | ||
while(sleep(333)){ | ||
time_now = time() | ||
if(tonumber(time_now.hour) < 10){ | ||
mainForm.hour.text = "0" + tostring(time_now.hour) | ||
}else{ | ||
mainForm.hour.text = tostring(time_now.hour)} | ||
if(tonumber(time_now.minute) < 10){ | ||
mainForm.min.text = "0" + tostring(time_now.minute) | ||
}else{ | ||
mainForm.min.text = tostring(time_now.minute)} | ||
if(tonumber(time_now.second) < 10){ | ||
mainForm.sec.text = "0" + tostring(time_now.second) | ||
}else{ | ||
mainForm.sec.text = tostring(time_now.second) | ||
} | ||
time_str = thread.table("v_share_list").tostring() | ||
var find_1,find_2 = string.indexOf(time_str,tostring(time_now,"%H%M%S")) | ||
if(find_1 != null){ | ||
mainForm.hour.color = 255 | ||
mainForm.min.color = 255 | ||
mainForm.sec.color = 255 | ||
mainForm.redraw() | ||
app_window = win.animate.slide(mainForm) | ||
app_window.show(1000,0x1/*水平自左向右*/) | ||
win.delay(5000) | ||
app_window.hide(500,0x2/*水平自右向左*/) | ||
mainForm.hour.color = 0 | ||
mainForm.min.color = 0 | ||
mainForm.sec.color = 0 | ||
} | ||
} | ||
},mainForm,time_list,show_hide | ||
) | ||
|
||
mainForm.onTrayMessage = { | ||
[0x205/*_WM_RBUTTONUP*/ ] = function(wParam){ | ||
mainForm.close()}; | ||
[0x202/*_WM_LBUTTONUP*/] = function(wParam){ | ||
mainForm.reghotkey( | ||
function(id,mod,vk){ | ||
app_window.show(1000,0x1/*水平自左向右*/) | ||
win.delay(5000) | ||
app_window.hide(500,0x2/*水平自右向左*/) | ||
}, | ||
mainForm.hotkey.gethotkey() | ||
) | ||
app_window.show(1000,0x1/*水平自左向右*/) | ||
win.delay(5000) | ||
app_window.hide(500,0x2/*水平自右向左*/) | ||
}; | ||
[0x203/*_WM_LBUTTONDBLCLK*/] = function(wParam){}; | ||
[0x404/*_PARAM_DESTROY*/] = function(wParam){}; | ||
[0x405/*_PARAM_CLICKED*/] = function(wParam){};} | ||
|
||
mainForm.onMouseDown = function(wParam,lParam){ | ||
mainForm.hitCaption() | ||
} | ||
|
||
mainForm.wndproc = function(hwnd,message,wParam,lParam){ | ||
select(message){ | ||
case 0x206/*_WM_RBUTTONDBLCLK*/{ | ||
mainForm.close() | ||
} | ||
} | ||
} | ||
|
||
return win.loopMessage() |