Multi Display and MakeButton
Posted: Wed Jul 06, 2016 4:31 pm
Hello,
I have problem with multi Display and MakeButton
see my script for help me :
-----------------------
/* Nouveau projet Hollywood */
W=100
H=100
POSX={100,300,500}
FOR A=0 TO 2
CreateDisplay(A,{X=POSX[A], Y=350, Width = W, Height = H, Borderless=0, Fixed=0,Title="Win"..A})
SelectDisplay(A)
CreateBrush(1, W, H ,"$5D5D5D")
SelectBrush(1)
POS=3
FOR B=0 TO 4
SetFillStyle(#FILLNONE)
BOX(2,POS,96,20,#BLUE) TextOut(#CENTER,POS+6,"Button"..B)
POS=POS+25
NEXT
EndSelect
DisplayBrush(1,0,0)
OpenDisplay(A)
ActivateDisplay(A)
POS=3
FOR B=0 TO 4
Action={
OnMouseUp = Function(msg) test(msg) EndFunction,
OnMouseOver = Function(msg) test(msg) EndFunction,
OnMouseOut = Function(msg) test(msg) EndFunction
}
MakeButton(B, #SIMPLEBUTTON, 2, POS, 96, 20, Action)
POS=POS+25
NEXT
NEXT
Function test(msg)
;debugprint(msg.id,msg.y)
Switch msg.ACTION
CASE "OnMouseOver":
BOX(2,msg.y,96,20,#RED)
CASE "OnMouseOut":
BOX(2,msg.y,96,20,#BLUE)
EndSwitch
EndFunction
/* Boucle infinie */
Repeat
WaitEvent
Forever
I have problem with multi Display and MakeButton
see my script for help me :
-----------------------
/* Nouveau projet Hollywood */
W=100
H=100
POSX={100,300,500}
FOR A=0 TO 2
CreateDisplay(A,{X=POSX[A], Y=350, Width = W, Height = H, Borderless=0, Fixed=0,Title="Win"..A})
SelectDisplay(A)
CreateBrush(1, W, H ,"$5D5D5D")
SelectBrush(1)
POS=3
FOR B=0 TO 4
SetFillStyle(#FILLNONE)
BOX(2,POS,96,20,#BLUE) TextOut(#CENTER,POS+6,"Button"..B)
POS=POS+25
NEXT
EndSelect
DisplayBrush(1,0,0)
OpenDisplay(A)
ActivateDisplay(A)
POS=3
FOR B=0 TO 4
Action={
OnMouseUp = Function(msg) test(msg) EndFunction,
OnMouseOver = Function(msg) test(msg) EndFunction,
OnMouseOut = Function(msg) test(msg) EndFunction
}
MakeButton(B, #SIMPLEBUTTON, 2, POS, 96, 20, Action)
POS=POS+25
NEXT
NEXT
Function test(msg)
;debugprint(msg.id,msg.y)
Switch msg.ACTION
CASE "OnMouseOver":
BOX(2,msg.y,96,20,#RED)
CASE "OnMouseOut":
BOX(2,msg.y,96,20,#BLUE)
EndSwitch
EndFunction
/* Boucle infinie */
Repeat
WaitEvent
Forever