Enumeration
#H_track
#H_knob1
#H_knob2
#H_knob3
#H_knob4
#H_knob5
#H_knob6
#H_knob7
#H_knob8
#H_knob9
#H_knob10
EndEnumeration
UsePNGImageDecoder()
CatchImage(#H_track, ?H_track)
CatchImage(#H_knob1, ?H_knob1)
CatchImage(#H_knob2, ?H_knob2)
CatchImage(#H_knob3, ?H_knob3)
CatchImage(#H_knob4, ?H_knob4)
CatchImage(#H_knob5, ?H_knob5)
CatchImage(#H_knob6, ?H_knob6)
CatchImage(#H_knob7, ?H_knob7)
CatchImage(#H_knob8, ?H_knob8)
CatchImage(#H_knob9, ?H_knob9)
CatchImage(#H_knob10, ?H_knob10)
Procedure Draw_x(x, y, Gadget, ImageID)
StartDrawing(CanvasOutput(Gadget))
DrawImage(ImageID(#H_track), 0, 0)
DrawAlphaImage(ImageID, x, y)
StopDrawing()
EndProcedure
OpenWindow(0, 0, 0, 258, 123, "CanvasGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(21, 5, 15, 80, 15)
Draw_x(0, 0, 21, ImageID(#H_knob1))
CanvasGadget(22, 5, 30, 80, 15)
Draw_x(0, 0, 22, ImageID(#H_knob2))
CanvasGadget(23, 5, 45, 80, 15)
Draw_x(0, 0, 23, ImageID(#H_knob3))
CanvasGadget(24, 5, 60, 80, 15)
Draw_x(0, 0, 24, ImageID(#H_knob4))
CanvasGadget(25, 5, 75, 80, 15)
Draw_x(0, 0, 25, ImageID(#H_knob5))
CanvasGadget(26, 89, 15, 80, 15)
Draw_x(0, 0, 26, ImageID(#H_knob6))
CanvasGadget(27, 89, 30, 80, 15)
Draw_x(0, 0, 27, ImageID(#H_knob7))
CanvasGadget(28, 89, 45, 80, 15)
Draw_x(0, 0, 28, ImageID(#H_knob8))
CanvasGadget(29, 89, 60, 80, 15)
Draw_x(0, 0, 29, ImageID(#H_knob9))
CanvasGadget(30, 89, 75, 80, 15)
Draw_x(0, 0, 30, ImageID(#H_knob10))
Repeat
Event = WaitWindowEvent()
If Event = #PB_Event_Gadget
Gadget=EventGadget()
If Gadget>=21 And Gadget<=30
Type = EventType()
If Type = #PB_EventType_LeftClick Or (Type = #PB_EventType_MouseMove And GetGadgetAttribute(Gadget, #PB_Canvas_Buttons) = #PB_Canvas_LeftButton)
x=GetGadgetAttribute(Gadget, #PB_Canvas_MouseX)-12
If x<0 : x=0 : EndIf
If x>80-24 : x = 80-24 : EndIf
Draw_x(x, 0, Gadget, ImageID(Gadget))
EndIf
EndIf
EndIf
Until Event = #PB_Event_CloseWindow
DataSection
;{ ресурсы
H_track:
IncludeBinary "Horizontal1.png"
H_knob1:
IncludeBinary "H-knob1.png"
H_knob2:
IncludeBinary "H-knob1.png"
H_knob3:
IncludeBinary "H-knob1.png"
H_knob4:
IncludeBinary "H-knob3.png"
H_knob5:
IncludeBinary "H-knob3.png"
H_knob6:
IncludeBinary "H-knob2.png"
H_knob7:
IncludeBinary "H-knob2.png"
H_knob8:
IncludeBinary "H-knob2.png"
H_knob9:
IncludeBinary "H-knob2.png"
H_knob10:
IncludeBinary "H-knob2.png"
;}