Ich habe da mal etwas zusammengestellt.
Code: Alles auswählen
Enumeration
#frm0
#frmask
#frmJaNein
#Font1
#Font2
#Font3
#Font4
#Frame3D_0
#cmdL1
#cmdL2
#cmdL3
#cmdL4
#cmdL5
#txtSkanner
#cmdGross
#cmdsuche
#cmdtools
#Frame3D_1
#grdLager
#lblFach
#lblPalette
#lblPaletteninfo
#cmdschmal
#cmdbreit
#cmdcancelbreit
#cmdJA
#cmdNEIN
EndEnumeration
Declare.w breite()
Procedure Open_frm0()
If LoadFont(#Font1, "Arial", 12)
SetGadgetFont(#PB_Default, FontID(#Font1))
EndIf
If OpenWindow(#frm0, 0, 0, 750, 520, "Lagersystem", #PB_Window_MinimizeGadget | #PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
If CreateGadgetList(WindowID(#frm0))
Frame3DGadget(#Frame3D_0, 10, 10, 720, 120, "Regal")
ButtonGadget(#cmdL1, 20, 40, 140, 80, "1", #PB_Button_Default | #PB_Button_Toggle)
ButtonGadget(#cmdL2, 160, 40, 140, 80, "2", #PB_Button_Default | #PB_Button_Toggle)
ButtonGadget(#cmdL3, 300, 40, 140, 80, "3", #PB_Button_Default | #PB_Button_Toggle)
ButtonGadget(#cmdL4, 440, 40, 140, 80, "4", #PB_Button_Default | #PB_Button_Toggle)
ButtonGadget(#cmdL5, 580, 40, 140, 80, "5", #PB_Button_Default | #PB_Button_Toggle)
TextGadget(#lblPalette, 10, 140, 170, 60, "Skanner")
StringGadget(#txtSkanner, 100, 140, 370, 65, "", #PB_String_UpperCase)
TextGadget(#lblPaletteninfo,10,210,720,40,"Informatioenen zur aktuellen Buchung",#PB_Text_Border )
If LoadFont(#Font2, "Arial", 40)
SetGadgetFont(#txtSkanner, FontID(#Font2))
EndIf
If LoadFont(#Font3, "Arial", 20)
SetGadgetFont(#cmdL1, FontID(#Font3))
SetGadgetFont(#cmdL2, FontID(#Font3))
SetGadgetFont(#cmdL3, FontID(#Font3))
SetGadgetFont(#cmdL4, FontID(#Font3))
SetGadgetFont(#cmdL5, FontID(#Font3))
SetGadgetFont(#cmdGross, FontID(#Font3))
SetGadgetFont(#cmdsuche, FontID(#Font3))
SetGadgetFont(#lblPaletteninfo, FontID(#Font3))
EndIf
SetActiveGadget(#txtSkanner)
EndIf
EndIf
EndProcedure
Procedure.w breite()
Protected returnwert.w = 0
If OpenWindow(#frmask,0,0,600,100,"Palettenart", #PB_Window_WindowCentered,WindowID(#frm0))
If CreateGadgetList(WindowID(#frmask))
ButtonGadget(#cmdschmal,5,5,190,90,"SCHMAL")
ButtonGadget(#cmdbreit,205,5,190,90,"BREIT")
ButtonGadget(#cmdcancelbreit,405,5,190,90,"ABBRUCH")
If LoadFont(#Font3, "Arial", 20)
SetGadgetFont(#cmdschmal, FontID(#Font3))
SetGadgetFont(#cmdbreit, FontID(#Font3))
SetGadgetFont(#cmdcancelbreit, FontID(#Font3))
EndIf
EndIf
EndIf
Repeat ; Start of the event loop
Event = WaitWindowEvent() ; This line waits until an event is received from Windows
GadgetID = EventGadget() ; Is it a gadget event?
;You can place code here, and use the result as parameters for the procedures
If Event = #PB_Event_Gadget
If GadgetID = #cmdbreit
returnwert.w = 2
EndIf
If GadgetID = #cmdschmal
returnwert.w = 1
EndIf
If GadgetID = #cmdcancelbreit
returnwert.w = 99
EndIf
EndIf
Until returnwert.w > 0 ; End of the event loop
CloseWindow(#frmask)
ProcedureReturn returnwert
EndProcedure
Open_frm0()
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
doexecute.w = 0
If GadgetID = #cmdL1
breite()
ElseIf GadgetID = #cmdL2
ElseIf GadgetID = #cmdL3
ElseIf GadgetID = #cmdL4
ElseIf GadgetID = #cmdL5
ElseIf GadgetID = #cmdGross
If GetGadgetState(#cmdGross)= 0
SetGadgetText(#cmdGross,"SCHMAL ( 1 FACH )")
CurBreit = 0
Else
SetGadgetText(#cmdGross,"BREIT ( 1,5 FÄCHER )")
CurBreit = 1
EndIf
ElseIf GadgetID = #txtSkanner
EndIf
EndIf
Until Event = #PB_Event_CloseWindow; End of the event loop
End