Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread OnShow and Modal Dialog
Mon, Oct 22 2012 7:35 AMPermanent Link

Michael Boyle

Softrix LImited

Avatar


In past Delphi applications ive used the OnShow event to show a modal password dialog box on startup, or even a splash screen -  I tried this with EWB and it doesnt show the modal dialog at all - if I set the visible property of the password form to true it will show but the modal result from the login button is ignored and doesnt close as intended.

Hope that made some sense  =)

Michael Boyle
www.softrix.co.uk
Mon, Oct 22 2012 8:23 AMPermanent Link

Raul

Team Elevate Team Elevate

Michael,

Javascript is asynchronous so there is no stop of code execution when
you call showmodal. Not sure if that answers you question.
Basically you need to handle everything in appropriate events or callbacks.
See this thread for example of callback message (you can do a callback
with your own forms as well):

www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_general&page=1&msg=857

Raul


On 10/22/2012 7:35 AM, Michael Boyle wrote:
> In past Delphi applications ive used the OnShow event to show a modal password dialog box on startup, or even a splash screen -  I tried this with EWB and it doesnt show the modal dialog at all - if I set the visible property of the password form to true it will show but the modal result from the login button is ignored and doesnt close as intended.
>
> Hope that made some sense  =)
>
> Michael Boyle
> www.softrix.co.uk
>
Mon, Oct 22 2012 2:12 PMPermanent Link

Michael Boyle

Softrix LImited

Avatar


Thanks Raul, thats cleared up a few things  =)

Michael Boyle
www.softrix.co.uk
Wed, Mar 20 2013 9:27 AMPermanent Link

Matthew Jones

FWIW, here's a pattern that I think might be useful.

procedure TMyForm.ButtonOptionsClick(Sender: TObject);
begin                                    
 if Sender is TForm then
 begin
    if frmMenu.ModalResult = mrOK then
    begin
       // stuff
    end;
 end
 else
 begin
   frmMenu.OnClose := lnkMenuClick;
   frmMenu.ShowModal;
 end;
end;

The key here is that the event handler for the button which shows a form can also
handle the OnClose event for the TForm that the button shows. You could switch the
order if you want to make it more logical "ordered", but this keeps the code to do
with the form in the same procedure, which made sense to me.

/Matthew Jones/
Wed, Mar 20 2013 3:08 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< The key here is that the event handler for the button which shows a form
can also handle the OnClose event for the TForm that the button shows. You
could switch the order if you want to make it more logical "ordered", but
this keeps the code to do with the form in the same procedure, which made
sense to me. >>

Not bad, not bad at all. Smile

Thanks,

Tim Young
Elevate Software
www.elevatesoft.com
Image