Re: multiple windows help
- Posted by euman at bellsouth.net Jun 05, 2002
- 396 views
----- Original Message ----- From: "George Walters" <gwalters at sc.rr.com> > > I need a hint on the following: > > 1. I need to open a window and collect some information on how the program > is to run. i.e dates, from-to information, etc. > > 2. Then with this information I need to close this window, open the 2nd > window and run the procedure to fill the window per the info collected from > 1. > > I can do this if item 1 is programA that then launches programB with > arguments, but I would like to do it all within the same program. > > george Hello George, I use the (below) routine in my programs to keep only one window/control visible at any one given time. Keep in mind this is a very simple demo. -------- include win32lib.ew constant Window1 = create( Window, "Win 1", 0, 30, 30, 175, 100, 0 ), Window2 = create( Window, "Win 2", 0, 30, 30, 175, 100, 0 ), Open1 = create( PushButton, "Open Win 2", Window1, 16, 40, 100, 22, 0 ), Open2 = create( PushButton, "Open Win 1", Window2, 16, 40, 100, 22, 0 ) -- Set top Control/Window --------------------------------------------- global sequence Controls Controls = {Window1,Window2} global procedure SetVisibility(atom nowVisible) integer len, handle object junk len = length(Controls) for x = 1 to len do handle = getHandle(Controls[x]) if w32Func( xIsWindowVisible, {handle}) then if Controls[x] = nowVisible then exit else setVisible(Controls[x], 0) end if end if if x = len then setVisible(nowVisible, 1) end if end for end procedure procedure OpenWin2() SetVisibility(Window2) end procedure onClick[Open1] = routine_id( "OpenWin2" ) procedure OpenWin1() SetVisibility(Window1) end procedure onClick[Open2] = routine_id( "OpenWin1" ) SetVisibility(Window1) WinMain( Window1, Normal ) ------- Hopefully helpfull, Euman