Multiple pages ကို style တမ်ိဳးနဲ႔ ေရးၾကမယ္
screen ရဲ့ေအာက္ေျခမွာ button ၅ခု ရွိမယ္။ button တခုကို ႏွိပ္လိုက္ရင္ သက္ဆိုင္ရာ page ကို ေျပာင္းျပမယ္။
Main
====
AddPanel("pnlMain",0,0,100%x,100%y,"")
AddPanel("pnl1",0,0,100%x,90%y,"pnlMain")
SetColor( "pnl1",0,cRed)
AddPanel("pnl2",0,0,100%x,90%y,"pnlMain")
SetColor( "pnl2",0,cYellow)
SetVisible( "pnl2",false)
AddPanel("pnl3",0,0,100%x,90%y,"pnlMain")
SetColor( "pnl3",0,cGreen)
SetVisible( "pnl3",false)
AddPanel("pnl4",0,0,100%x,90%y,"pnlMain")
SetColor( "pnl4",0,cBlue)
SetVisible( "pnl4",false)
AddPanel("pnl5",0,0,100%x,90%y,"pnlMain")
SetColor( "pnl5",0,cCyan)
SetVisible( "pnl5",false)
# ###################
AddPanel("pnlsel",0,90%y,20%x,10%y,"pnlMain")
SetColor( "pnlsel",0,cyellow)
AddButton("btn1",0,90%y,20%x,10%y,"pnlMain")
SetText("btn1","1" )
AddButton("btn2",20%x,90%y,20%x,10%y,"pnlMain")
SetText("btn2","2" )
AddButton("btn3",40%x,90%y,20%x,10%y,"pnlMain")
SetText("btn3","3" )
AddButton("btn4",60%x,90%y,20%x,10%y,"pnlMain")
SetText("btn4","4" )
AddButton("btn5",80%x,90%y,20%x,10%y,"pnlMain")
SetText("btn5","5" )
currentpage="pnl1"
Events
======
Sub Activity_Pause(UserClosed)
End Sub
Sub Activity_Resume
End Sub
Sub Button_Click(Who)
select who
case "btn1"
SetVisible( currentpage,false)
currentpage="pnl1"
SetVisible( currentpage,true)
Setleft("pnlsel",getleft("btn1"))
case "btn2"
SetVisible( currentpage,false)
currentpage="pnl2"
SetVisible( currentpage,true)
Setleft("pnlsel",getleft("btn2"))
case "btn3"
SetVisible( currentpage,false)
currentpage="pnl3"
SetVisible( currentpage,true)
Setleft("pnlsel",getleft("btn3"))
case "btn4"
SetVisible( currentpage,false)
currentpage="pnl4"
SetVisible( currentpage,true)
Setleft("pnlsel",getleft("btn4"))
case "btn5"
SetVisible( currentpage,false)
currentpage="pnl5"
SetVisible( currentpage,true)
Setleft("pnlsel",getleft("btn5"))
end select
End Sub
========
No comments:
Post a Comment