LOGS * X.LOG
@ENVI^ ForceLocal=1
ENVI &::WM_TRAYNOTIFY=1109  //tray 通知消息

SET  ::WM_LBUTTONDBLCLK                =0x0203
SET  ::WM_RBUTTONDBLCLK                =0x0206
SET  ::WM_SIZE=0x0005
SET  &SIZE_MINIMIZED=1  //最小化 
ENVI$  &&NL=0d 0a

SET  ::WM_LBUTTONDOWN                  =0x0201
SET  ::WM_LBUTTONUP                    =0x0202
SET  ::WM_RBUTTONDOWN                  =0x0204
SET  ::WM_RBUTTONUP                    =0x0205

@IFEX  X.LOG, LOGS * X.LOG
CALL @*WIN1 
_SUB WIN1,W289H249,软键盘,,,-,, -top  -nfocus
    SET-def WID0=%&__WinID%
    SET-def  X=0
    SET-def h=0
    TIME -t:1  T1,1, CALL ReleaseFocus
    ENVI @this.MSG=_%&::WM_LBUTTONDOWN%: CALL OnMouse d
    ENVI @this.MSG=_%&::WM_LBUTTONUP%:   CALL OnMouse u
    LABE+ -vcenter -center ITEM2,L118T27W72H30,CTRL+SHIFT,
    LABE+ -vcenter -center ITEMA,L19T72W28H30,a,  
    LABE+ -vcenter -center ITEMB,L59T72W28H30,b,  
    LABE+ -vcenter -center ITEMC,L99T72W28H30,c,   
    LABE+ -vcenter -center ITEMHide,L225T15W20H20,_,  ENVI @this.Visable=0 ,
    LABE+ -vcenter -center ITEMQUIT,L255T15W20H20,X,  Kill \,
    ENVI @this.MSG=_%&::WM_TRAYNOTIFY%::&&wp,&&lp, CALL DoMenu %&wp% %&lp%   
    CALL SetTray
    //ENVI @this.Visable=0  //开始隐藏
_END
_SUB SetTray
    TIPS* 软键盘,,,,#4
_END
_SUB OnShow
    ENVI @@Visable=%&WID0%:2  
_END

_SUB DoMenu
    IFEX $%&::WM_LBUTTONDOWN%=%2,!!  TEAM CALL  OnShow | EXIT 
    IFEX $%&::WM_LBUTTONDOWN%=%2,!  IFEX $%&::WM_RBUTTONDOWN%=%2,!  EXIT 
    CALL @--popmenu       MyMenu1
_END
_SUB MyMenu1
    MENU Menu1,还原,  CALL  OnShow
    MENU -
    MENU Menu2,退出, KILL \
_END




_SUB OnMouse 
    ENVI @this.Cur=?&&X;&&Y;&&cX;&&cY
    CALL TryIt 118 27 72 30   %1 ITEM2 VK_CONTROL_;VK_SHIFT_;VK_CONTROL^;VK_SHIFT^
    CALL TryIt  19 72 28 30   %1 ITEMA a
    CALL TryIt  59 72 28 30   %1 ITEMB b
    CALL TryIt  99 72 28 30   %1 ITEMC c
_END

_SUB TryIt  
    ENVI &&X1=%1
    ENVI &&Y1=%2
    ENVI &&W=%3
    ENVI &&H=%4
    CALC &&X2=%X1% + %W%
    CALC &&Y2=%Y1% + %H%
    IFEX $%cX%>%X1%,!! IFEX $%cX%<%X2%,!! IFEX $%cY%>%Y1%,!!  IFEX $%cY%<%Y2%,!! FIND $d=%5, ENVI @%6.bkcolor=0xFF ! TEAM ENVI @%6.bkcolor=-1|CALL DoIt  %7 
_END


_SUB DoIt
    SET-def _cmd=SEND %*
    %&_cmd% 
_END
