Top Level form/Modal form conflict. 
Author Message
 Top Level form/Modal form conflict.

Hi all,

I have a modal form in the main VFP application window that calls a top
level print preview form (with Desktop set to .F.). My problem is if the
user selects the main application window after launching the print preview,
they cannot get back to the print preview window without closing the modal
form.

Does anyone know a way around this?

Thanks.

--
William Fields
MCSD - Microsoft Visual FoxPro
MCP - Win2k Pro
US Bankruptcy Court
Phoenix, AZ

"So long, and thanks for all the fish."
        - Douglas Adams RIP



Sun, 30 Nov 2003 03:02:20 GMT  
 Top Level form/Modal form conflict.
Hi William,

This simplest solution I can think of is to hide the modal window using the
command THISFORM.VISIBLE = .F. before calling the REPORT command. When the
user closes the preview, set the visible property of the form back to true.
That way, there is nothing for the user to click on.

John


Quote:
> Hi all,

> I have a modal form in the main VFP application window that calls a top
> level print preview form (with Desktop set to .F.). My problem is if the
> user selects the main application window after launching the print
preview,
> they cannot get back to the print preview window without closing the modal
> form.

> Does anyone know a way around this?

> Thanks.

> --
> William Fields
> MCSD - Microsoft Visual FoxPro
> MCP - Win2k Pro
> US Bankruptcy Court
> Phoenix, AZ

> "So long, and thanks for all the fish."
>         - Douglas Adams RIP



Sun, 30 Nov 2003 05:45:37 GMT  
 Top Level form/Modal form conflict.
Try Hiding the modal form (the user can click Window, Hide).

Mike



Sun, 30 Nov 2003 09:57:52 GMT  
 Top Level form/Modal form conflict.
I have used a program called SDI Preview that is public domain.  You can get
it from www.classycomponents.com .  I use it exactly the way you say you are
trying to do it.  I know there were some bizarre work around's for older
versions of VFP due to some weird behaviors they use in this solutions.  It
is part of my framework and performs superbly.  I also use there QBF (Query
By Form) control  Great builder included and lots of hooks.  Drops on any
form and you are performing complex queries in minutes using your user input
form.

Best of Luck.
--
Larry D. Oliver

LOCO Solutions, Inc.


Quote:
> Hi William,

> This simplest solution I can think of is to hide the modal window using
the
> command THISFORM.VISIBLE = .F. before calling the REPORT command. When the
> user closes the preview, set the visible property of the form back to
true.
> That way, there is nothing for the user to click on.

> John



> > Hi all,

> > I have a modal form in the main VFP application window that calls a top
> > level print preview form (with Desktop set to .F.). My problem is if the
> > user selects the main application window after launching the print
> preview,
> > they cannot get back to the print preview window without closing the
modal
> > form.

> > Does anyone know a way around this?

> > Thanks.

> > --
> > William Fields
> > MCSD - Microsoft Visual FoxPro
> > MCP - Win2k Pro
> > US Bankruptcy Court
> > Phoenix, AZ

> > "So long, and thanks for all the fish."
> >         - Douglas Adams RIP



Sun, 30 Nov 2003 10:15:44 GMT  
 Top Level form/Modal form conflict.
That probably won't work.  Once you hide a modal form, it exits to the next
line of code after the line that started it.  At least that's what a modal
form class does, I'm not sure about a modal .SCX.

--
Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.


Quote:
> Hi William,

> This simplest solution I can think of is to hide the modal window using
the
> command THISFORM.VISIBLE = .F. before calling the REPORT command. When the
> user closes the preview, set the visible property of the form back to
true.
> That way, there is nothing for the user to click on.

> John



> > Hi all,

> > I have a modal form in the main VFP application window that calls a top
> > level print preview form (with Desktop set to .F.). My problem is if the
> > user selects the main application window after launching the print
> preview,
> > they cannot get back to the print preview window without closing the
modal
> > form.

> > Does anyone know a way around this?

> > Thanks.

> > --
> > William Fields
> > MCSD - Microsoft Visual FoxPro
> > MCP - Win2k Pro
> > US Bankruptcy Court
> > Phoenix, AZ

> > "So long, and thanks for all the fish."
> >         - Douglas Adams RIP



Mon, 01 Dec 2003 14:34:54 GMT  
 Top Level form/Modal form conflict.
Just checked it, a modal form (.SCX) works the same way, it continues on to
the next line once hidden.  The form is still there and hidden, so it can be
brought back again.  Just beware that it's not going to not execute the next
line of code after it

DO FORM mymodal NAME xyz        && Has a button to set thisform.Visible to
.f.
* Now this line of code would execute once it's made non-visible.
? "I'm running this line!"
xyz.Show(1)   && re-displays the form as a modal form
xyz.Show(0)   && re-displays the form as non-modal

Note that you can't make a non-modal form modal (unless it's not visible
first), but you can make a modal form non-modal.

DO FORM nonmodal NAME xyz
xy2.Show(1)    && Error

DO FORM nonmodal NAME xyz
xy2.Visible = .f.
xy2.Show(1)    && form is now modal

--
Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.


Quote:
> That probably won't work.  Once you hide a modal form, it exits to the
next
> line of code after the line that started it.  At least that's what a modal
> form class does, I'm not sure about a modal .SCX.

> --
> Fred
> Microsoft Visual FoxPro MVP
> Please respond only to the newsgroups so that all may benefit.



> > Hi William,

> > This simplest solution I can think of is to hide the modal window using
> the
> > command THISFORM.VISIBLE = .F. before calling the REPORT command. When
the
> > user closes the preview, set the visible property of the form back to
> true.
> > That way, there is nothing for the user to click on.

> > John



> > > Hi all,

> > > I have a modal form in the main VFP application window that calls a
top
> > > level print preview form (with Desktop set to .F.). My problem is if
the
> > > user selects the main application window after launching the print
> > preview,
> > > they cannot get back to the print preview window without closing the
> modal
> > > form.

> > > Does anyone know a way around this?

> > > Thanks.

> > > --
> > > William Fields
> > > MCSD - Microsoft Visual FoxPro
> > > MCP - Win2k Pro
> > > US Bankruptcy Court
> > > Phoenix, AZ

> > > "So long, and thanks for all the fish."
> > >         - Douglas Adams RIP



Mon, 01 Dec 2003 15:30:35 GMT  
 Top Level form/Modal form conflict.
You made the form both non-visible, then immediately visible again, before
it could exit, just around the report.  If that's what you wanted to do,
that's fine.  If you had made it just non-visible, then it would have
continued on with the line immediately after whatever started the form
(after the report was printed).

--
Fred
Microsoft Visual FoxPro MVP
Please respond only to the newsgroups so that all may benefit.


Quote:
> I just tested it and it works as I expected. Perhaps I am doing something
> different? Files attached.

> John


> > Just checked it, a modal form (.SCX) works the same way, it continues on
> to
> > the next line once hidden.  The form is still there and hidden, so it
can
> be
> > brought back again.  Just beware that it's not going to not execute the
> next
> > line of code after it

> > DO FORM mymodal NAME xyz        && Has a button to set thisform.Visible
to
> > .f.
> > * Now this line of code would execute once it's made non-visible.
> > ? "I'm running this line!"
> > xyz.Show(1)   && re-displays the form as a modal form
> > xyz.Show(0)   && re-displays the form as non-modal

> > Note that you can't make a non-modal form modal (unless it's not visible
> > first), but you can make a modal form non-modal.

> > DO FORM nonmodal NAME xyz
> > xy2.Show(1)    && Error

> > DO FORM nonmodal NAME xyz
> > xy2.Visible = .f.
> > xy2.Show(1)    && form is now modal

> > --
> > Fred
> > Microsoft Visual FoxPro MVP
> > Please respond only to the newsgroups so that all may benefit.



> > > That probably won't work.  Once you hide a modal form, it exits to the
> > next
> > > line of code after the line that started it.  At least that's what a
> modal
> > > form class does, I'm not sure about a modal .SCX.

> > > --
> > > Fred
> > > Microsoft Visual FoxPro MVP
> > > Please respond only to the newsgroups so that all may benefit.



> > > > Hi William,

> > > > This simplest solution I can think of is to hide the modal window
> using
> > > the
> > > > command THISFORM.VISIBLE = .F. before calling the REPORT command.
When
> > the
> > > > user closes the preview, set the visible property of the form back
to
> > > true.
> > > > That way, there is nothing for the user to click on.

> > > > John



> > > > > Hi all,

> > > > > I have a modal form in the main VFP application window that calls
a
> > top
> > > > > level print preview form (with Desktop set to .F.). My problem is
if
> > the
> > > > > user selects the main application window after launching the print
> > > > preview,
> > > > > they cannot get back to the print preview window without closing
the
> > > modal
> > > > > form.

> > > > > Does anyone know a way around this?

> > > > > Thanks.

> > > > > --
> > > > > William Fields
> > > > > MCSD - Microsoft Visual FoxPro
> > > > > MCP - Win2k Pro
> > > > > US Bankruptcy Court
> > > > > Phoenix, AZ

> > > > > "So long, and thanks for all the fish."
> > > > >         - Douglas Adams RIP



Tue, 02 Dec 2003 14:19:21 GMT  
 
 [ 7 post ] 

 Relevant Pages 

1. Strange problem with modal forms and Application in top-level form

2. Top level form - modal form ??

3. Top-Level modal forms???

4. modal form and top level menu error

5. addressing form from menu on top level form ?

6. Top level form menu & active form

7. release form - from menubar of top level form ?

8. Question: Forms displayed inside other top-level forms

9. Form not appearing in top-level form.

10. Form not appearing in top-level form.

11. Problems with calling Forms from Forms witihin a Top Level App

12. top level forms, child forms, _Screen, the main foxpro window

 

 
Powered by phpBB® Forum Software