как правильно связать?
то есть, есть три окна: 1 окно,2 окно,3 окно. Допустим запускаю 1 окно, запускаются все 3 окна. Запускаю 2 окно запускается только 2 окно. Запускаю 3 окно, запускаются все 3 окна. Ничего не меняя в готовом коде .
Как такое реализовать?
1
; name 1.pb
Enumeration #PB_Compiler_EnumerationValue
#Window
EndEnumeration
If OpenWindow(#Window, 100, 100, 185, 600, "Window", #PB_Window_SystemMenu | #PB_Window_ScreenCentered |#PB_Window_SizeGadget)
SetWindowIcon(WindowID(#Window),ExtractIcon_(0,"shell32.dll",2))
WindowBounds(#Window, 185, 230, 185, #PB_Ignore)
ButtonGadget(1,30,10,100,20,"Button1")
ButtonGadget(2,30,40,100,20,"Button2")
EndIf
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Select EventGadget()
Case 1
SetWindowTitle(#Window, "Button1")
Case 2
SetWindowTitle(#Window, "Button2")
EndSelect
Case #PB_Event_CloseWindow
If EventWindow() = #Window
End
EndIf
EndSelect
ForEver2
; name 2.pb
Enumeration #PB_Compiler_EnumerationValue
#PropertisWindow
#PropertisListIcon
EndEnumeration
If OpenWindow(#PropertisWindow, 100, 100, 185, 600, "Propertis", #PB_Window_SystemMenu | #PB_Window_ScreenCentered |#PB_Window_SizeGadget)
SetWindowIcon(WindowID(#PropertisWindow),ExtractIcon_(0,"shell32.dll",2))
WindowBounds(#PropertisWindow, 185, 230, 185, #PB_Ignore)
ButtonGadget(32,30,10,100,20,"Button32")
ButtonGadget(33,30,40,100,20,"Button33")
EndIf
Debug EventWindow()
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Select EventGadget()
Case 32
SetWindowTitle(#PropertisWindow, "Button32")
Case 33
SetWindowTitle(#PropertisWindow, "Button33")
EndSelect
Case #PB_Event_CloseWindow
If EventWindow() = #PropertisWindow
End
EndIf
EndSelect
ForEver3
; name 3.pb
Enumeration #PB_Compiler_EnumerationValue
#GadgetsWindow
#GadgetsListIcon
EndEnumeration
If OpenWindow(#GadgetsWindow, 100, 100, 185, 600, "Gadgets", #PB_Window_SystemMenu | #PB_Window_ScreenCentered |#PB_Window_SizeGadget)
SetWindowIcon(WindowID(#GadgetsWindow),ExtractIcon_(0,"shell32.dll",130))
WindowBounds(#GadgetsWindow, 185, 230, 185, #PB_Ignore)
ButtonGadget(30,30,10,100,20,"Button30")
ButtonGadget(31,30,40,100,20,"Button31")
EndIf
Repeat
Select WaitWindowEvent()
Case #PB_Event_Gadget
Select EventGadget()
Case 30
SetWindowTitle(#GadgetsWindow, "Button30")
Case 31
SetWindowTitle(#GadgetsWindow, "Button31")
EndSelect
Case #PB_Event_CloseWindow
If EventWindow() = #GadgetsWindow
End
EndIf
EndSelect
ForEverОтредактировано mestnyi (19.09.2013 15:21:31)