Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Embedded Form Problem
Thu, Apr 16 2015 7:37 PMPermanent Link

Doug B

Using the Embedded Form demo, I was able to reproduce a problem with nested forms.

(Sample is attached)

ParentForm --> MainForm --> Embedded ChildForms

1. Create a new form (e.g., ParentForm).
2. Remove MainForm from being created automatically in the project (.wbp) file.
3. Create ParentForm  in the project file.
4. Drop a button on ParentForm with the following code:

MainForm := TMainForm.Create(Application);
MainForm.ShowModal;

5. Run the application and click on the button to show the Main Form.
6. Click on the Main Form's 'Create Embedded Form' button.

The child form will be created, but the entire form will then be disabled and the browser window locked with the wait cursor.

If you change #4 above to MainForm.Show, then it works.

The problem is that I need this behavior with ShowModal launching a second form that itself creates embedded forms.  Is there a workaround for this or am I doing something wrong?

Thanks,
Doug



Attachments: embedform.zip
Fri, Apr 17 2015 3:56 AMPermanent Link

Matthew Jones

Doug B wrote:

> The problem is that I need this behavior with ShowModal launching a
> second form that itself creates embedded forms.  Is there a
> workaround for this or am I doing something wrong?

From what I've experienced, ShowModal is rather special, so I guess the
answer will be to make what you want work with just Show. You have the
source though, so you can probably work out what it is that ShowModal
is doing, and perhaps emulate it. Number one thought I have is that you
simply hide the other windows. In my shop, I have a load of different
forms, but when you click to view products or view your account, it
hides the current form and shows the relevant one. That stops you doing
anything on the others...

--

Matthew Jones
Fri, Apr 17 2015 12:39 PMPermanent Link

Doug B

Thanks for the suggestion.

I could probably iterate through the parent windows, but I want to disable them, not hide them, as I want the user to have a visual reference to the underlying form(s).

There seems to be a lot going on under the hood that I don't understand, so this is beyond my capabilities with EWB at this time (I'm still in the evaluation stage).

Doug

"Matthew Jones" wrote:

Doug B wrote:

> The problem is that I need this behavior with ShowModal launching a
> second form that itself creates embedded forms.  Is there a
> workaround for this or am I doing something wrong?

From what I've experienced, ShowModal is rather special, so I guess the
answer will be to make what you want work with just Show. You have the
source though, so you can probably work out what it is that ShowModal
is doing, and perhaps emulate it. Number one thought I have is that you
simply hide the other windows. In my shop, I have a load of different
forms, but when you click to view products or view your account, it
hides the current form and shows the relevant one. That stops you doing
anything on the others...

--

Matthew Jones
Mon, Apr 20 2015 5:00 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Doug,

<< The child form will be created, but the entire form will then be disabled
and the browser window locked with the wait cursor. >>

EWB 1.x only expects a single form to be modal at a given time.

EWB 2 handles modality differently, so this won't be an issue with it.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Apr 20 2015 7:29 PMPermanent Link

Doug B

Excellent, thanks Tim!

Doug

"Tim Young [Elevate Software]" wrote:

Doug,

<< The child form will be created, but the entire form will then be disabled
and the browser window locked with the wait cursor. >>

EWB 1.x only expects a single form to be modal at a given time.

EWB 2 handles modality differently, so this won't be an issue with it.

Tim Young
Elevate Software
www.elevatesoft.com
Image