TEAM ENVI^ ENVIMODE=1| ENVI^ FORCELOCAL=1
SET &WM_LBUTTONDOWN=0x0201
SET &WM_LBUTTONUP=0x0202
SET &WM_COMMAND=0x0111
SET &EN_CHANGE=0x0300
SET &WM_KEYDOWN=0x0100
SET &WM_SETFOCUS=0x0007
SET &EM_GETSEL=0x00B0
SET &EM_SETSEL=0x00B1

WIN1
_SUB WIN1,W387H254,无激活无焦点按钮,
    EDIT -vcenter -3D   EDIT1,L106T56W260H30,EDIT1,,
    LABE -vcenter -center -mod LABE1_A,L12T57W30H30,A,,
    LABE -vcenter -center -3D  LABE1_B,L12T57W30H30,A,,,-16
    ENVI @this.MSG=+%&WM_LBUTTONDOWN%: OnMouse d
    ENVI @this.MSG=+%&WM_LBUTTONUP%: OnMouse u 
    SET &LASTD=
    //ITEM ITEM1,L101T138W60H30,B,
_END

_SUB OnMouse 
	ENVI @this.Cur=?&&X;&&Y;&&cX;&&cY
	TryIt 12 57 30 30 %1 &&I1 1
_END

_SUB TryIt      
	ENVI &&X1=%1
	ENVI &&Y1=%2
	ENVI &&W=%3
	ENVI &&H=%4
	CALC &&X2=%X1% + %W%
	CALC &&Y2=%Y1% + %H%
      SET &bIn=0
	IFEX $%&cX%>%&X1%, IFEX $%&cX%<%&X2%, IFEX $%&cY%>%&Y1%, IFEX $%&cY%<%&Y2%, SET bIn=1
      FIND $[ %~5=d & %&bIn%=1 ], TEAM SET LASTD=LABE1| ENVI @LABE1_B.Visable=1| ENVI @LABE1_A.visable=0|ENVI @this.MouseCapture=1   //按下
      FIND $[ %~5=u & %&bIn%=1 ], TEAM ENVI @EDIT1=%EDIT1%A| ENVI @EDIT1.POSTMSG=%EM_SETSEL%,999999,999999   //弹起才动作
      FIND $[ %~5=u & '%LASTD%'<>'' ], TEAM ENVI @this.MouseCapture=0|ENVI @%LASTD%_B.Visable=0| ENVI @%LASTD%_A.visable=1| SET LASTD=   //释放
_END
