Code: Select all
Enumeration
#Window
#Button
#Dialog
#DialogButton
#Dialog2
EndEnumeration
OpenWindow(#Window, 0, 0, 400, 350, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(#Button, 10, 10, 90, 25, "Open Dialog")
Define Event
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_CloseWindow
Select EventWindow()
Case #Window
Quit = 1
Case #Dialog
CloseWindow(#Dialog)
DisableWindow(#Window, 0)
Case #Dialog2
CloseWindow(#Dialog2)
DisableWindow(#Dialog, 0)
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case #Button
DisableWindow(#Window, 1)
OpenWindow(#Dialog, 0, 0, 320, 240, "Dialog", #PB_Window_SystemMenu | #PB_Window_WindowCentered, WindowID(#Window))
ButtonGadget(#DialogButton, 10, 10, 90, 25, "Open Dialog")
Case #DialogButton
DisableWindow(#Dialog, 1)
OpenWindow(#Dialog2, 0, 0, 320, 240, "Dialog 2", #PB_Window_SystemMenu | #PB_Window_WindowCentered, WindowID(#Dialog))
EndSelect
EndSelect
Until Quit = 1
End