#!PECMD
ENVI &&SECONDS=3600  //工作时间，秒
ENVI &&XIUXI=60      //休息时间，秒

//IMPORT  .\WM_消息.wcs  //需要WM_消息.wcs 拷到本文件目录或指定目录！！！
SET  ::WM_LBUTTONDOWN                  =0x0201
SET  ::WM_LBUTTONUP                    =0x0202
SET  ::WM_RBUTTONDOWN                  =0x0204
SET  ::WM_RBUTTONUP                    =0x0205
SET  ::WM_MOUSEMOVE                    =0x0200

SCRN &&ScrW,&&ScrH 
CALC #&&X0=%&ScrW% / 2
CALC #&&Y0=%&ScrH% / 2
CALC #&&YMAX=%&ScrH% - 60
ENVI &&WINID1=0
ENVI &&WINID2=0
CALC #&&MS=%&SECONDS% * 1000  //ms

CALL @WIN1
_SUB WIN1,L-10T-10W1H1,眼睛护士,,#1,-
    ENVI &WINID1=%__WinID%
    MENU Menu2,休息, TEAM ENVI @Timer1=0| ENVI this.visable=0|  CALL @WIN_CAP| ENVI @Timer1=%&MS%
    MENU Menu1,退出眼睛护士, KILL  @@%WINID1%
    TIME Timer1,%&MS%,  CALL @WIN_CAP
    TIME Timer2,1,  TEAM ENVI @Timer2=0| ENVI this.visable=0|  CALL @WIN_CAP
_END



_SUB DOLOOP
    CALL @WIN_CAP
    WAIT %&MS%
_END

_SUB WIN_CAP, L1T1W%&ScrW%H%&ScrH%,,,,-10,,-forcenomin -top  -disaltmv 
    ENVI &WINID2=%__WinID%
    ENVI @this.POS=0:0:%&ScrW%:%&ScrH%
    ENVI @this.POS=::::4 
    ITEM ITEM4,L67T46W60H30,下次吧,KILL \,
    ENVI @WIN_CAP.MSG=%&WM_MOUSEMOVE%: CALL OnMouseMove 
    PBAR PBAR8,L8T116W252H17,PBAR8
    LABE LABE5,L80T146W147H88,休息一下,,
    LABE LABE6,L104T203W137H30,
    TIME Timer1,100,  CALL OnTimer1 
    CALC #&&T=%&XIUXI%
    CALL OnTimer2
    TIME Timer2,1000, CALL OnTimer2
_END

_SUB OnTimer1
    //ENVI @@Cur=%&X0%,%&Y0%  //禁止移动鼠标
_END
_SUB OnTimer2
    CALC #&P= %&T% * 100 / %&XIUXI%  
    ENVI @PBAR8=%&P%
    CALC #&&TR=10+ 50 - %&T% * 50 / %&XIUXI%
    ENVI @this.POS=:::::%TR%
    IFEX  $ 0 >= %&T%, KILL \
    CALC #&T= %&T% - 1
_END

_SUB WIN7,W289H249,新窗口7,
_END

_SUB OnMouseMove
    ENVI @@Cur=?&&X,&&Y
    IFEX $%&YMAX% < %&Y%, ENVI @@Cur=%&X0%,%&Y0%  //禁止鼠标移到任务栏
_END

