ENVI^  ForceLocal=1
IFEX X.LOG, LOGS * X.LOG
ENVI$ &&NL=0a
ENVI$ &&TAB=09
SET  &::WM_LBUTTONDOWN=0x0201
SET  &::WM_NOTIFY=0x004E

CALL MH2012

_SUB Page1,W288H400
    ENVI @this.Enable=0
_END

_SUB MH2012,W504H464,标签,
    ITEM 1IT1,L100T98W70H28,页1.IT1,   //第1页
    ITEM 1IT2,L334T98W70H28,页1.IT2,
    SET TAB[1][1]=1IT1
    SET TAB[1][2]=1IT2
    SET TAB[1].N=2
    
    EDIT -3D -vcenter 2IT1,L100T98W70H28,页2.IT1,   //第2页
    LABE+ -vcenter 2IT2,L334T98W70H28,页2.IT2,
    SET TAB[2][1]=2IT1
    SET TAB[2][2]=2IT2
    SET TAB[2].N=2
    
    TABS TABS1,L12T6W476H236,Page1:Name1:Title1:tips1;Page1:Name2:Title2:tips2,
    SET &I=2
    LOOP #%I%<=2, TEAM SHOWPAGE  %I%    0|  CALC I=%I% + 1  //初始化,2--N页隐藏
    SET &lastid=-1
	ENVI @TABS1.ID=?;&&TABS1_ID
    ENVI @this.MSG=%WM_NOTIFY%::&&wp,&&lp,  CALL OnNotiFy %&wp%  %&lp% 
_END

_SUB OnNotiFy
	IFEX $%TABS1_ID%=%&wp%, CALL OnNotiFyTABS1
_END

_SUB OnNotiFyTABS1
    IFEX $%lastid%=%TABS1.Select%, EXIT _SUB 
    IFEX $%TABS1.Select%<0, EXIT _SUB 
    SET &i=%TABS1.Select%
    SHOWPAGE  %lastid%        0   //隐藏旧的
    SHOWPAGE  %TABS1.Select%  1   //显示新的
    SET lastid=%TABS1.Select%
_END

_SUB SHOWPAGE
    SET &i=%1
    SET &sw=%2
    SET~  &N=TAB[%i%].N
    SET &j=1
    LOOP #%j%<=%N%, 
    {
        SET~ &tabij=TAB[%i%][%j%]
        ENVI @%tabij%.Visable=%sw%
        CALC j=%j% + 1
    }
_END
