Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 11 total
Thread ShowModal changed ?
Fri, Apr 17 2015 12:16 PMPermanent Link

Doc

Form2.ShowModal;

From EWB1 Help:
Use this method to show a form in a modal fashion. When a form is shown modally, a shadow is placed over all other forms and the entire desktop, and keyboard and mouse input is only allowed for the modal form

EWB2 Help shows no parameters and no explanations yet.
When I call Form2.ShowModal from Form1.Button there is no shadow over all forms and keyboard and mouse input is also possible on Form1.

Has this been changed for EWB2? And can I get a the former effect by another code?
Fri, Apr 17 2015 12:29 PMPermanent Link

Raul

Team Elevate Team Elevate

On 4/17/2015 12:16 PM, Doc wrote:
> EWB2 Help shows no parameters and no explanations yet.
> When I call Form2.ShowModal from Form1.Button there is no shadow over all forms and keyboard and mouse input is also possible on Form1.

I don't believe help is up to date yet on EWB2.

> Has this been changed for EWB2? And can I get a the former effect by another code?

The forms model has changed. If you just want a shadow then easiest is
to create a new form based on the TDialog since it comes with toolbar
and shadow etc.

When you call ShowModal on it you'll also see the shadows etc.

Raul
Fri, Apr 17 2015 1:12 PMPermanent Link

Doc

What I would like to have is a behaviour like it was in EWB1 or in Delphi.

A Shadow over all other forms and all other forms not enabled.

Somethin like this:

Form1.Opacity := 50; // That does not work
Form1.Enabled := false; //Property Enabled does not exist (though no compiler error on that line!)
Form2.ShowModal;
Form1.Opacity := 100;
Form1.Enabled := false;

//Form1.Visible := false; //that would work but doesnt look similar.
Fri, Apr 17 2015 1:46 PMPermanent Link

Raul

Team Elevate Team Elevate

On 4/17/2015 1:12 PM, Doc wrote:


Showmodal is non blocking (in fact all of EWB and javascript is
non-blocking) so you're setting it to 50 and then back to 100 right away
.. Does this work for you :

> Form1.Opacity := 50; // That does not work
> Form1.Enabled := false; //Property Enabled does not exist (though no compiler error on that line!)
> Form2.ShowModal;

You still need to handle the dismissal of the dialog - with callback or
using some other method - to set the opacity back to 100.

Enabled property is present in the base TControl - it's is protected
though so Tim would have to clarify this one further

Raul


Fri, Apr 17 2015 2:33 PMPermanent Link

Doc

Raul wrote:
.. Does this work for you :

Form1.Opacity := 50;
Form1.Enabled := false;
Form2.ShowModal;

Yes, that works, but Form1 is still enabled;

You still need to handle the dismissal of the dialog - with callback or
using some other method - to set the opacity back to 100.

Yes, butI have no idea how to do that.
Fri, Apr 17 2015 2:39 PMPermanent Link

Doc

Oh,
just by chance got a solution:

Form1.Visible := false;
Form2.ShowModal;
Form1.Visible := true;

That just does what I wanted, Form1 is not "enabled" and shown greyed.
Sat, Apr 18 2015 10:30 AMPermanent Link

Uli Becker

> Has this been changed for EWB2? And can I get a the former effect by another code?

I don't see any problems here. At least with build 5 an overlay is
created and the new form is shown modally.
The color and opacity of the overlay can be adjusted by changing the
interface "TModalOverlay".

Uli
Sat, Apr 18 2015 6:04 PMPermanent Link

Doc

Uli Becker wrote:

I don't see any problems here.

_________________________________

Thank you,
I did some extra testing and found out:
The problem only occurs when there are only two forms, one main form and one modal form.
A simple project demonstrating that is attached.
If I put one more form to the project, ShowModal works as expected.



Attachments: Formtest_2_Forms.zip
Sat, Apr 18 2015 6:05 PMPermanent Link

Doc

No problem with same project and 3 Forms, simple project attached.
This must be a sort of bug.



Attachments: Formtest_3_Forms.zip
Sun, Apr 19 2015 9:04 AMPermanent Link

Uli Becker

> I did some extra testing and found out:
> The problem only occurs when there are only two forms, one main form and one modal form.
> A simple project demonstrating that is attached.

I tested your project and it works fine here. Which build have you
installed?

Uli
Page 1 of 2Next Page »
Jump to Page:  1 2
Image