Also was muss ich jett verewenden wen ich ein Fenster mit 3 Buttons habe, einem ComboBox-Gadget und ein paar Radio-Gadgets?
Ich hab eigentlich schon alle GadgetList-Varianten probiert, aber der Cmopiler hat sich immer aufgehängt
Code: Alles auswählen
; PureBasic Visual Designer v3.95 build 1485 (PB4Code)
; PureBasic Visual Designer v3.95 build 1485 (PB4Code)
;- Window Constants
;
Enumeration
#Window_0
EndEnumeration
;- Gadget Constants
;
Enumeration
#Text_0
#Combo_0
#Text_1
#Radio_0
#Radio_1
#Radio_3
#Radio_5
#Radio_7
#Button_0
#Button_1
#Button_3
EndEnumeration
Procedure Open_Window_0()
If OpenWindow(#Window_0, 242, 46, 610, 310, "Aimer – Start Manager", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
If CreateGadgetList(WindowID(#Window_0))
TextGadget(#Text_0, 10, 20, 110, 20, "Auflösung auswählen:")
ComboBoxGadget(#Combo_0, 10, 50, 120, 20)
TextGadget(#Text_1, 210, 20, 110, 20, "Farbtiefe auwählen")
OptionGadget(#Radio_0, 210, 40, 240, 30, "4 Bit.........16 Farben / nicht empfehlenswert")
OptionGadget(#Radio_1, 210, 70, 250, 30, "8 Bit.........256 Farben / nicht empfehlenswert")
OptionGadget(#Radio_3, 210, 100, 280, 30, "16 Bit.......65 536 Farben / nur für alte Grafikkarten")
OptionGadget(#Radio_5, 210, 130, 260, 30, "24 Bit.......16 777 216 Farben / empfehlenswert")
OptionGadget(#Radio_7, 210, 160, 380, 30, "32 Bit.......16 777 216 Farben, schneller als 24 Bit / sehr empfehlenswert")
ButtonGadget(#Button_0, 10, 230, 130, 30, "Aimer v1.00 starten")
ButtonGadget(#Button_1, 470, 230, 130, 30, "Beenden")
ButtonGadget(#Button_3, 230, 230, 130, 30, "Speichern ohne beenden")
AddGadgetItem(#Combo_0,0,"640x480")
AddGadgetItem(#Combo_0,1,"600x800")
AddGadgetItem(#Combo_0,2,"1240x768")
EndIf
EndIf
EndProcedure
Open_Window_0()
SetGadgetState(#Radio_7, 1)
SetGadgetState(#Combo_0, 1)
Repeat ; Start of the event loop
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
WindowID = EventWindow() ; The Window where the event is generated, can be used in the gadget procedures
GadgetID = EventGadget() ; Is it a gadget event?
EventType = EventType() ; The event type
;You can place code here, and use the result as parameters for the procedures
If Event = #PB_Event_Gadget
If GadgetID = #Combo_0
ElseIf GadgetID = #Radio_0
ElseIf GadgetID = #Radio_1
ElseIf GadgetID = #Radio_3
ElseIf GadgetID = #Radio_5
ElseIf GadgetID = #Radio_7
ElseIf GadgetID = #Button_0
ElseIf GadgetID = #Button_1
ElseIf GadgetID = #Button_3
EndIf
EndIf
Until Event = #PB_Event_CloseWindow ; End of the event loop
End
;