I got this very simplified setup completely working but only with the use of API's.
The position of all Gadgets should not become changed (as images are according placed on the canvas).
Most of the names are simplified too.
I like to know how to do it without API's, yet some things then go wrong or don't work :
* If the button RED is pushed the other gadgets in the container gets hidden and also colored red as the window below ?
* The buttons START and STOP don't work ?
I can change the setup with the use of two Canvas Gadgets, but that will be quit a work in the existing full source.
So if possible I'd like to keep it as is but only change some contanier and/or open/close gadgetlist's.
Thanks
Code: Select all
;**************************************************************************
;{
;**************************************************************************
;{
EnableExplicit
Global.i Event
;**************************************************************************
Global.i wnd_000, pnl_001, btn_002, btn_003, btn_006, txt_007, btn_008, txt_009
Global.i btn_010, txt_011, trb_012, btn_013, btn_014, btn_015, txt_016, txt_017, trb_018, scb_019
Global.i scb_020, opt_021, opt_022, cnv_023, cnt_024, txt_025, txt_026, txt_027, txt_028, trb_029
Global.i btn_030, txt_031, txt_032, btn_033
;**************************************************************************
;}
;**************************************************************************
;**************************************************************************
Procedure Build_Window_1(x = 0, y = 0, width = 730, height = 660)
wnd_000 = OpenWindow(#PB_Any, 140, 10, 400, 395, "gadget_000")
pnl_001 = PanelGadget(#PB_Any, 2, 2, 395, 390)
btn_002 = ButtonGadget(#PB_Any, 200, 0, 90, 20, "START")
btn_003 = ButtonGadget(#PB_Any, 300, 0, 90, 20, "STOP")
;OpenGadgetList(pnl_001)
AddGadgetItem(pnl_001, -1, "Defaults")
btn_006 = ButtonGadget(#PB_Any, 6, 2, 80, 17, "gadget_006")
txt_007 = TextGadget(#PB_Any, 90, 2, 40, 17, "gadget_007", #PB_Text_Border)
scb_020 = ScrollBarGadget(#PB_Any, 111, 332, 35, 18, 1, 100, 5)
opt_021 = OptionGadget(#PB_Any, 242, 324, 80, 18, "gadget_021")
opt_022 = OptionGadget(#PB_Any, 242, 340, 80, 18, "gadget_022")
cnv_023 = CanvasGadget(#PB_Any, 10, 22, 370, 300, #PB_Canvas_Keyboard | #PB_Canvas_Container)
cnt_024 = ContainerGadget(#PB_Any, 0, 235, 790, 20)
txt_025 = TextGadget(#PB_Any, 90, 2, 40, 17, "gadget_025", #PB_Text_Border)
trb_029 = TrackBarGadget(#PB_Any, 272, 2, 100, 18, 1, 100, #PB_TrackBar_Ticks)
btn_030 = ButtonGadget(#PB_Any, 6, 2, 80, 17, "gadget_030")
btn_033 = ButtonGadget(#PB_Any, 230, 2, 40, 17, "RED")
CloseGadgetList()
EndProcedure
;**************************************************************************
;**************************************************************************
Procedure EventLoop()
Build_Window_1()
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
If EventType()=#PB_EventType_LeftClick
Select EventGadget()
Case btn_033 : : SetWindowColor(wnd_000, $FF)
Default :Debug EventGadget()
EndSelect
EndIf
Case #PB_Event_Menu
Case #PB_Event_CloseWindow
CloseWindow(#PB_All)
End
EndSelect
ForEver
EndProcedure
EventLoop()