Code : Tout sélectionner
posx = 40
posy = 30
hauteur = 25
largeur = 95
window = 0
r1 = 146
g1 = 226
b1 = 129
r2 = 255
g2 = 0
b2 = 0
r3 = 2
g3 = 131
b3 = 253
OpenWindow(0, 0, 0, 300, 150, "test")
CreateGadgetList(WindowID(0))
TextGadget(0, 8, 73, 55, 17, "couleurOn : ")
TextGadget(1, 68, 73, 10, 17, "R:")
StringGadget(2, 80, 70, 30, 17, "145")
TextGadget(3, 112, 73, 10, 17, "G:")
StringGadget(4, 128, 70, 30, 17, "225")
TextGadget(5, 160, 73, 10, 17, "B:")
StringGadget(6, 172, 70, 30, 17, "129")
TextGadget(7, 8, 103, 55, 17, "couleurOff : ")
TextGadget(8, 68, 103, 10, 17, "R:")
StringGadget(9, 80, 100, 30, 17, "255")
TextGadget(10, 112, 103, 10, 17, "G:")
StringGadget(11, 128, 100, 30, 17, "0")
TextGadget(12, 160, 103, 10, 17, "B:")
StringGadget(13, 172, 100, 30, 17, "0")
TextGadget(14, 8, 133, 58, 17, "couleurClic : ")
TextGadget(15, 68, 133, 10, 17, "R:")
StringGadget(16, 80, 130, 30, 17, "2")
TextGadget(17, 112, 133, 10, 17, "G:")
StringGadget(18, 128, 130, 30, 17, "131")
TextGadget(19, 160, 133, 10, 17, "B:")
StringGadget(20, 172, 130, 30, 17, "253")
Repeat
couleurOn = RGB(r1, g1, b1)
couleurOff = RGB(r2, g2, b2)
couleurClic = RGB(r3, g3, b3)
event = WaitWindowEvent()
;Un onglet avec bandeau vert de type 1
onglet(window, posx, posy, largeur, hauteur, 1, couleurOn, couleurOff, couleurClic, event)
;Un onglet avec bandeau vert de type 2
onglet(window, posx+largeur+6, posy, largeur, hauteur, 2, couleurOn, couleurOff, couleurClic, event)
If event = #PB_Event_Gadget
Select EventGadget()
Case 2
r1 = Val(GetGadgetText(2))
Case 4
g1 = Val(GetGadgetText(4))
Case 6
b1 = Val(GetGadgetText(6))
Case 9
r2 = Val(GetGadgetText(9))
Case 11
g2 = Val(GetGadgetText(11))
Case 13
b2 = Val(GetGadgetText(13))
Case 16
r3 = Val(GetGadgetText(16))
Case 18
g3 = Val(GetGadgetText(18))
Case 20
b3 = Val(GetGadgetText(20))
EndSelect
EndIf
If event = #PB_Event_CloseWindow
End
EndIf
ForEver