i want the child window to be able to appear with the parent in the background but inaccessible until the cancel button on the child is pressed closing it then enabling the parent window back again.
here is my code:
Code: Select all
Enumeration
#PARENTWINDOW
#MAINMENUBAR
#MENU_FILE_OPEN
EndEnumeration
Enumeration
#CHILDWINDOW
#CHILD_BUTTON_CANCEL
EndEnumeration
Procedure OpenChildWindow()
If OpenWindow(#CHILDWINDOW, 545, 318, 508, 242, "Child Window: Mommy! Where are you?????", #PB_Window_WindowCentered, #PARENTWINDOW)
ButtonGadget(#CHILD_BUTTON_CANCEL, 395, 205, 90, 25, "CANCEL")
EndIf
EndProcedure
If OpenWindow(#PARENTWINDOW, 490, 193, 800, 620, "Parent Window (Go to File > Open to open a child window)", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_TitleBar | #PB_Window_ScreenCentered )
If CreateMenu(#MAINMENUBAR, WindowID(#PARENTWINDOW))
MenuTitle("File")
MenuItem(#MENU_FILE_OPEN, "&Open...")
EndIf
EndIf
Repeat
Event = WaitWindowEvent()
Select Event
Case #PB_Event_Menu
Select EventMenu()
Case #MENU_FILE_OPEN
OpenChildWindow()
DisableWindow(#PARENTWINDOW,#True)
StickyWindow(#CHILDWINDOW,#True)
EndSelect
Case #PB_Event_Gadget
Select EventGadget()
Case #CHILD_BUTTON_CANCEL
CloseWindow(#CHILDWINDOW)
DisableWindow(#PARENTWINDOW,#False)
SetActiveWindow(#PARENTWINDOW)
EndSelect
EndSelect
Until Event = #PB_Event_CloseWindow
