Ich habe mehrere Fenster mit dem Form -> neues Formular erstellt. Dabei liefert #PB_Any für Fenster 1 und 2 die selbe Nummer, daher funktionert die Main-Schleife nicht mehr richtig.
Im Einsatz ist:
PB 5.20 Beta 17
Windows 7 und Windows XP
Main.pbf
Code: Alles auswählen
XIncludeFile "1.pbf"
XIncludeFile "2.pbf"
XIncludeFile "3.pbf"
Exit = #False
Procedure Window_S_Events(event)
Debug "EventWindow() " + EventWindow()
Debug "Window 1 " + Window_1
Debug "Window 2 " + Window_2
Debug "Window 3 " + Window_3
Select EventWindow()
Case Window_1
Select event
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
Case #PB_Event_CloseWindow
CloseWindow(Window_1)
EndSelect
Case Window_2
Select EventGadget()
Case #PB_Event_Gadget
Select EventGadget()
EndSelect
Case #PB_Event_CloseWindow
CloseWindow(Window_3)
Case #PB_Event_Gadget
EndSelect
Case Window_3
Select EventGadget()
Case Button_0
OpenWindow_1()
Case Button_1
OpenWindow_2()
EndSelect
Case #PB_Event_CloseWindow
CloseWindow(Window_3)
ProcedureReturn Exit
EndSelect
EndProcedure
OpenWindow_3()
Repeat
Exit = Window_S_Events(WaitWindowEvent())
Until Exit = #True
End
Code: Alles auswählen
Global Window_1
Global Button_0
Procedure OpenWindow_1(x = 0, y = 0, width = 600, height = 400)
Window_1 = OpenWindow(#PB_Any, x, y, width, height, "", #PB_Window_SystemMenu)
EndProcedure
Code: Alles auswählen
Global Window_2
Global Button_0
Procedure OpenWindow_2(x = 0, y = 0, width = 600, height = 400)
Window_2 = OpenWindow(#PB_Any, x, y, width, height, "", #PB_Window_SystemMenu)
Button_0 = ButtonGadget(#PB_Any, 150, 40, 100, 25, "")
EndProcedure
Code: Alles auswählen
Global Window_3
Global Button_0, Button_1
Procedure OpenWindow_3(x = 0, y = 0, width = 600, height = 400)
Window_3 = OpenWindow(#PB_Any, x, y, width, height, "", #PB_Window_SystemMenu)
Button_0 = ButtonGadget(#PB_Any, 130, 30, 100, 25, "Fenster 1")
Button_1 = ButtonGadget(#PB_Any, 130, 70, 100, 25, "Fenster 2")
EndProcedure
Gruß und Danke
Dietmar