ENVI^  ForceLocal=1
SET &::WM_LBUTTONDOWN=0x0201
SET &::WM_COMMAND=0x0111
SET &::EN_CHANGE=0x0300

CALL @WIN1
_SUB WIN1,W364H212,菜单演示,
    LABE LABE1,L27T301W313H30,LABE1,,
    MENU -bar Menu1,&F打开, MESS 打开...*20000
    MENU -bar -sub MyMenuSub1,&S保存,MESS 保存...*20000
    ENVI @Menu13.Enable=0
    ENVI @Menu14.Id=?Menu14_hmenu;Menu14_Id;Menu14_inx
    ENVI @LABE1= Menu14: hmenu=%Menu14_hmenu% CtrId=%Menu14_Id% Inx=%Menu14_inx%
    //ENVI @this.MSG=_COMMAND#%Menu14_Id%::&&wp,&&lp, MESS On Menu11 *5000   //捕捉菜单按下
    //ENVI @this.MSG=_%&WM_COMMAND%::&&wp,&&lp, CALL OnCommand   //捕捉菜单按下
    TIME -t:1 ,100, CALL @--popmenu  MyMenu1
_END

_SUB OnCommand 
    IFEX $%Menu14_Id%=%__wParam.wID%,  MESS On Menu11 *5000
_END


_SUB MyMenu1
    CALC #&I=%&I% + 1
    CALC #&&N= %&I% % 2
    MENU Menu1,Menu1,MESS Menu1
    MENU -sub MyMenuSub1,子菜单
    IFEX $ 1 = %&N%, MENU Menu3,Menu3,MESS Menu3
    MENU -
    MENU Menu2,Menu2,MESS Menu2,,menu16.bmp
_END

_SUB MyMenuSub1
    MENU Menu11,SUB1-1,MESS SUB1-1,,menu16.bmp
    MENU Menu12,SUB1-2,MESS SUB1-2
    MENU Menu13,SUB1-3,MESS SUB1-3
    MENU Menu14,SUB1-4,MESS SUB1-4
_END
