Re: Opening second or third window
- Posted by Brian Broker <bkb at CNW.COM> Aug 05, 2000
- 399 views
On Fri, 4 Aug 2000 21:52:26 -0400, Tony Steward wrote: >I am struggling with Euphoria. I'm trying to write basically a database >program and i want to select say "Edit" from a drop down window. This will >then open the edit window to edit a record. The data side im ok with but >opening the window ?? > >Thanks Are you programming in Windows with Win32Lib? If so, then a simple example can be found below; if not, I apologize (but, if not win32lib then please be more specific). The answer to your question is: use 'openWindow'... -- 3windemo.exw -- by Brian Broker include win32lib.ew constant -- define windows Win = create( Window, "Main Window", 0, Default, Default, 300, 200, 0 ), SubWin1 = create( Window, "Window 1", Win, Default, Default, 200, 100, 0 ), SubWin2 = create( Window, "Window 2", Win, Default, Default, 200, 100, 0 ), -- define Win menus FileWin = create( Menu, "&File", Win, 0, 0, 0, 0, 0 ), ExitFile = create( MenuItem, "E&xit", FileWin, 0, 0, 0, 0, 0 ), WindowWin = create( Menu, "&Window", Win, 0, 0, 0, 0, 0 ), Win1Window = create( MenuItem, "Window &1", WindowWin, 0, 0, 0, 0, 0 ), Win2Window = create( MenuItem, "Window &2", WindowWin, 0, 0, 0, 0, 0 ), -- define SubWin menus FileSubWin1 = create( Menu, "&File", SubWin1, 0, 0, 0, 0, 0 ), CloseSub1 = create( MenuItem, "&Close", FileSubWin1, 0, 0, 0, 0, 0 ), FileSubWin2 = create( Menu, "&File", SubWin2, 0, 0, 0, 0, 0 ), CloseSub2 = create( MenuItem, "&Close", FileSubWin2, 0, 0, 0, 0, 0 ) ------------------------------ --- Win menu routines --- ------------------------------ procedure onClick_ExitFile() closeWindow( Win ) end procedure onClick[ExitFile] = routine_id( "onClick_ExitFile" ) ------------------------------ procedure onClick_Win1() openWindow( SubWin1, Normal ) end procedure onClick[Win1Window] = routine_id( "onClick_Win1" ) ------------------------------ procedure onClick_Win2() openWindow( SubWin2, Normal ) end procedure onClick[Win2Window] = routine_id( "onClick_Win2" ) ------------------------------ --- SubWin menu routines --- ------------------------------ procedure onClick_CloseSub1() closeWindow( SubWin1 ) end procedure onClick[CloseSub1] = routine_id( "onClick_CloseSub1" ) ------------------------------ procedure onClick_CloseSub2() closeWindow( SubWin2 ) end procedure onClick[CloseSub2] = routine_id( "onClick_CloseSub2" ) ------------------------------ WinMain( Win, Normal ) ------------------------------