Discussion:
Modal form execution problem
(too old to reply)
Ken Mayer [dBVIPS]
2008-10-21 04:15:09 UTC
Permalink
I am using 2.6.1.5 and am having a problem calling one modal form from another modal form. I am calling frmtest2 from frmtest1. After I call frmtest2, I ? a test message in the command window. This test line should not be printed until the frmtest2 form is closed. However, the test message is printed immediately after the DO frmtest2 and before the calling form is closed. To test, this just run frmtest1 and click the Ok button and when you check the command window, you will see that the "back from Test2" message is listed and the frmtest2 form is still open. What is going on ?
Function PB_OK_onClick

// Do frmTest2.wfm
// change the above to:
Do frmTest2.wfm with true
// the "with true" part forces it to be completely modal

? " back from test2 via PB_OK_onClick"

return

The other problem: put something on frmtest2.wfm that can get focus,
like an entryfield or pushbutton ...

Modal Forms don't open properly unless something on them can get focus.

Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/

*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
unknown
2008-10-21 17:11:21 UTC
Permalink
On Tue, 21 Oct 2008 11:05:03 -0400 Dan Lancour
Sender: Dan Lancour <***@charter.net>
wrote the following in:
Newsgroup: dbase.programming
Ken, thank you very much for making me aware of such an important part of the syntax for running a form. The addition of "with true" solved the problem. I am very disappointed that the dbl documentation on forms did not show this in the syntax.
Also, in your dBase 2nd edition book on page 253, under the heading " Running Forms", I wish you would have included this information and I only hope that you revise it for future buyers because it is so important.
Since the dbl documentation oes not indicate that this parameter is needed, I would consider this a bug. No programmer should have to waste time chasing down stupid problems like this.
Dan,

It is not correct that the dbl documentation does not indicate that the parameter "true" is needed.

Take a look at the OLH on ".WFM file structure". It may not be the most obvious subject to look for,
but here you will find the following explanation.


"There are four major sections in a .WFM file:

1. The first part is the optional Header section. This is any code above the ** END HEADER line.
Comments that describe the file are usually put here.

2. Between the header and the beginning of the CLASS definition is the standard bootstrap code. This
code instantiates and opens a form when you run the form, similar to the way the boot sector of a
disk starts the system when you turn on your computer. The standard bootstrap code allows you to
open the form in two ways:

If you DO the .WFM with no parameters, the form is opened with the open( ) method. The form is
modeless.
If you DO the .WFM with the parameter True, the form is opened with the readModal( ) method. The
form is modal. A modal form cannot be MDI, so the form’s MDI property is set to False first.

3. The main CLASS definition constitutes the bulk of most .WFM files. This is the code
representation of forms designed visually in the Form designer.
4. Everything after the main class definition, if anything, makes up the General section. This is a
place for other functions and classes."


Ivar B. Jessen
Dan Lancour
2008-10-21 22:29:37 UTC
Permalink
Dan Lancour Wrote:

Thanks Ivar. You are correct, but from a practical standpoint, they should have made this obvious in the form documentation. I looked everywhere but in the wfm area where it is not a logical place to look when you are referencing programming syntax.

Dan Lancour
Post by unknown
On Tue, 21 Oct 2008 11:05:03 -0400 Dan Lancour
Newsgroup: dbase.programming
Ken, thank you very much for making me aware of such an important part of the syntax for running a form. The addition of "with true" solved the problem. I am very disappointed that the dbl documentation on forms did not show this in the syntax.
Also, in your dBase 2nd edition book on page 253, under the heading " Running Forms", I wish you would have included this information and I only hope that you revise it for future buyers because it is so important.
Since the dbl documentation oes not indicate that this parameter is needed, I would consider this a bug. No programmer should have to waste time chasing down stupid problems like this.
Dan,
It is not correct that the dbl documentation does not indicate that the parameter "true" is needed.
Take a look at the OLH on ".WFM file structure". It may not be the most obvious subject to look for,
but here you will find the following explanation.
1. The first part is the optional Header section. This is any code above the ** END HEADER line.
Comments that describe the file are usually put here.
2. Between the header and the beginning of the CLASS definition is the standard bootstrap code. This
code instantiates and opens a form when you run the form, similar to the way the boot sector of a
disk starts the system when you turn on your computer. The standard bootstrap code allows you to
If you DO the .WFM with no parameters, the form is opened with the open( ) method. The form is
modeless.
If you DO the .WFM with the parameter True, the form is opened with the readModal( ) method. The
form is modal. A modal form cannot be MDI, so the form’s MDI property is set to False first.
3. The main CLASS definition constitutes the bulk of most .WFM files. This is the code
representation of forms designed visually in the Form designer.
4. Everything after the main class definition, if anything, makes up the General section. This is a
place for other functions and classes."
Ivar B. Jessen
unknown
2008-10-22 06:02:21 UTC
Permalink
On Tue, 21 Oct 2008 18:29:37 -0400 Dan Lancour
Sender: Dan Lancour <***@charter.net>
wrote the following in:
Newsgroup: dbase.programming
Post by Dan Lancour
Thanks Ivar. You are correct, but from a practical standpoint, they should have made this obvious in the form documentation. I looked everywhere but in the wfm area where it is not a logical place to look when you are referencing programming syntax.
Open the help file and read the "User's Guide" on "Creating Applications" and "Building the user
interface", then browse forward a few pages and you will find the info in a logical place where the
structure of a form is discussed.


Ivar B, Jessen

Dan Lancour
2008-10-21 15:05:03 UTC
Permalink
Dan Lancour Wrote:

Ken, thank you very much for making me aware of such an important part of the syntax for running a form. The addition of "with true" solved the problem. I am very disappointed that the dbl documentation on forms did not show this in the syntax.

Also, in your dBase 2nd edition book on page 253, under the heading " Running Forms", I wish you would have included this information and I only hope that you revise it for future buyers because it is so important.

Since the dbl documentation oes not indicate that this parameter is needed, I would consider this a bug. No programmer should have to waste time chasing down stupid problems like this.

Thanks,

Dan Lancour
Post by Ken Mayer [dBVIPS]
I am using 2.6.1.5 and am having a problem calling one modal form from another modal form. I am calling frmtest2 from frmtest1. After I call frmtest2, I ? a test message in the command window. This test line should not be printed until the frmtest2 form is closed. However, the test message is printed immediately after the DO frmtest2 and before the calling form is closed. To test, this just run frmtest1 and click the Ok button and when you check the command window, you will see that the "back from Test2" message is listed and the frmtest2 form is still open. What is going on ?
Function PB_OK_onClick
// Do frmTest2.wfm
Do frmTest2.wfm with true
// the "with true" part forces it to be completely modal
? " back from test2 via PB_OK_onClick"
return
The other problem: put something on frmtest2.wfm that can get focus,
like an entryfield or pushbutton ...
Modal Forms don't open properly unless something on them can get focus.
Ken
--
/(Opinions expressed are purely my own, not those of dataBased
Intelligence, Inc.)/
*Ken Mayer* [dBVIPS]
/Golden Stag Productions/
dBASE at goldenstag dot net
http://www.goldenstag.net/GSP
http://www.goldenstag.net/dbase/dBASEBooks.htm
http://www.goldenstag.net/dbase
Loading...