Code: Select all
;
; This code is automatically generated by the FormDesigner.
; Manual modification is possible to adjust existing commands, but anything else will be dropped when the code is compiled.
; Event procedures needs to be put in another source file.
;
Global MainWindow
Global Button_Quit
Declare ResizeGadgetsMainWindow()
Declare event_btn_quit(EventType)
Declare MainWindowEvent(Event, Window)
Procedure OpenMainWindow(x = 0, y = 0, width = 840, height = 520)
MainWindow = OpenWindow(#PB_Any, x, y, width, height, "Amons Utilities", #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered)
Button_Quit = ButtonGadget(#PB_Any, 720, 480, 100, 25, "Quit")
EndProcedure
Procedure ResizeGadgetsMainWindow()
Protected FormWindowWidth, FormWindowHeight
FormWindowWidth = WindowWidth(MainWindow)
FormWindowHeight = WindowHeight(MainWindow)
ResizeGadget(Button_Quit, 720, 480, 100, FormWindowHeight - 495)
EndProcedure
Procedure MainWindow_Events(event)
Select event
Case #PB_Event_SizeWindow
ResizeGadgetsMainWindow()
Case #PB_Event_CloseWindow
ProcedureReturn #False
Case #PB_Event_Menu
Select EventMenu()
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case Button_Quit
event_btn_quit(EventType())
EndSelect
Default
MainWindowEvent(event,MainWindow)
EndSelect
ProcedureReturn #True
EndProcedure
Code: Select all
XIncludeFile "UtilityForm.pbf" ; Include the first window definition
OpenMainWindow()
Repeat
event = WaitWindowEvent()
Until event = #PB_Event_CloseWindow
What's going on here?