Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2012-04

Mantis bugid 0015390 - showmodal closing when hide called.

6 messages · 2 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Justin Smyth

I've noted this but was fixed on the 21-2 this year but i've just upgraded Lazarus from 35368 to 36784 and have found this issue still exists.

Basically i Create and ShowModal my applications main form , once it hits formshow it starts a thread to monitor another application and once a trigger condition is met this form is hidden ( to prevent the user from entering data until other applications have finished there data look up) and i show the form again once its been populated with new data . but with the hide the showmodal exits ( which i dont want to happen, the form hasnt closed it just hidden while i wait for some data to come back from another application).

I almost think a variable of IsHidden might be needed so that block of code assoated with bugid 15390 doesnt get called ( or the break in that section doesnt get called).

I can provide code if needed , i'd have to bring it home from work but thats ok ( From Telstra) Thanks.

Justin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120417/e689b05b/attachment.html>

Reply by email

zeljko
to Justin Smyth
Justin Smyth wrote 19 lines
I've noted this but was fixed on the 21-2 this year but i've just upgraded Lazarus from 35368 to 36784 and have found this issue still exists. Basically i Create and ShowModal my applications main form , once it hits formshow it starts a thread to monitor another application and once a trigger condition is met this form is hidden ( to prevent the user from entering data until other applications have finished there data look up) and i show the form again once its been populated with new data . but with the hide the showmodal exits ( which i dont want to happen, the form hasnt closed it just hidden while i wait for some data to come back from another application). I almost think a variable of IsHidden might be needed so that block of code assoated with bugid 15390 doesnt get called ( or the break in that section doesnt get called). I can provide code if needed , i'd have to bring it home from work but thats ok ( From Telstra) Thanks.

You must provide example. It works for me, also example which is added by Stephano today is wrong.

zeljko

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120416/59100980/attachment-0001.html>

Reply by email

Justin Smyth
to zeljko

Yeah i will bring post a example over the next few days

what plat forms was it tested on ?

Earlier message 65 lines
----- Original Message ----- From: zeljko To: ; Justin Smyth Sent: Tuesday, April 17, 2012 4:27 AM Subject: Re: [Lazarus] Mantis bugid 0015390 - showmodal closing when hide called. On Monday 16 of April 2012 16:28:09 Justin Smyth wrote: > I've noted this but was fixed on the 21-2 this year but i've just upgraded > Lazarus from 35368 to 36784 and have found this issue still exists. > > > Basically i Create and ShowModal my applications main form , once it hits > formshow it starts a thread to monitor another application and once a > trigger condition is met this form is hidden ( to prevent the user from > entering data until other applications have finished there data look up) > and i show the form again once its been populated with new data . but with > the hide the showmodal exits ( which i dont want to happen, the form hasnt > closed it just hidden while i wait for some data to come back from another > application). > > I almost think a variable of IsHidden might be needed so that block of code > assoated with bugid 15390 doesnt get called ( or the break in that section > doesnt get called). > > I can provide code if needed , i'd have to bring it home from work but > thats ok ( From Telstra) Thanks. You must provide example. It works for me, also example which is added by Stephano today is wrong. zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120417/5baf4ddb/attachment.html>

Reply by email

zeljko
to Justin Smyth
Justin Smyth wrote
Yeah i will bring post a example over the next few days what plat forms was it tested on ?

I've tested qt, gtk2 (linux) , win32 and qt (windows) and qt under macosx.

zeljko

Show quoted text 61 lines
----- Original Message ----- From: zeljko To: ; Justin Smyth Sent: Tuesday, April 17, 2012 4:27 AM Subject: Re: [Lazarus] Mantis bugid 0015390 - showmodal closing when hide called. On Monday 16 of April 2012 16:28:09 Justin Smyth wrote: > I've noted this but was fixed on the 21-2 this year but i've just > upgraded > > Lazarus from 35368 to 36784 and have found this issue still exists. > > > > > > Basically i Create and ShowModal my applications main form , once it > hits > > formshow it starts a thread to monitor another application and once a > > trigger condition is met this form is hidden ( to prevent the user from > > entering data until other applications have finished there data look > up) > > and i show the form again once its been populated with new data . but > with > > the hide the showmodal exits ( which i dont want to happen, the form > hasnt > > closed it just hidden while i wait for some data to come back from > another > > application). > > > > I almost think a variable of IsHidden might be needed so that block of > code > > assoated with bugid 15390 doesnt get called ( or the break in that > section > > doesnt get called). > > > > I can provide code if needed , i'd have to bring it home from work but > > thats ok ( From Telstra) Thanks. You must provide example. It works for me, also example which is added by Stephano today is wrong. zeljko

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120417/5d680f03/attachment-0001.html>

Reply by email

Justin Smyth

----- Original Message -----

Earlier message 413 lines
From: Justin Smyth To: Sent: Wednesday, April 18, 2012 8:39 AM Subject: Re: [Lazarus] Mantis bugid 0015390 - showmodal closing when hide called. You have it wrong. as per other comments showmodal SHOULD NOT exit till the form is closed an example of live code in one of my products main form of my media player , it gets hidden to show a trayicon, when the user clicks show it unhides , if i had to create the form again i would have to re init all the components on the main form .. thats crazy. where as hide and show just changes the visible component of the form. if you exit the showmodal it is wrong .. only when the form is close should show modal finish. do i make my point clear ? you are completely wrong assuming hiding the form should close the form. you are breaking compabity with programs ported from delphi. sorry if i seem rude but this has caused great issues in a product used in the work place please fix this or remove this peace of code. Justin ----- Original Message ----- From: zeljko To: Justin Smyth Sent: Wednesday, April 18, 2012 12:29 AM Subject: Re: [Lazarus] Mantis bugid 0015390 - showmodal closing when hide called. On Tuesday 17 of April 2012 16:01:30 Justin Smyth wrote: > sample code uploaded to mantis. > > i'm not doing anything fancy > > The Main form has a button which creates a new form , does a show modal and > free's it when its finished ( Closed ) i've put in a messagedlg to show > when its been finished. > > the Second form on formactivate ( and tested in formshow) i turn on a timer > and that time when the timer event is run it does > > timer1.enabled:=false; > hide; > > soon as the hide happens is when the showmodal exits. And your example shows same mistake. 1.you create modal form 2.called showmodal (inside show modal you called Hide; via timer) - of course modal loop is finished when an modal form is hidden, and then your dialog is shown, and after that you are freeing that form .. so what do you expect ? Here is code which works 100% (frmShowModal is already created inside lpr - so autocreated form, and no need to create another one). Change code in ShowModalMain.pas of your example like this: procedure TForm1.Button1Click(Sender: TObject); begin // frmShowModal := TfrmShowModal.Create(self); frmShowModal.ShowModal; Messagedlg('frmShowModal Exited',mtwarning,[mbok],0); // frmShowModal.free; end; You should not Free modal form after showModal if you want it to be "live" for hiding and showmodal or show again later. When you call Hide; on modal form, it hides it self and modal loops stops.When modal loop stops in such case your previously modal form is just like any other hidden form. zeljko > > Justin > ----- Original Message ----- > From: zeljko > To: Justin Smyth > Cc: > Sent: Tuesday, April 17, 2012 7:12 PM > Subject: Re: [Lazarus] Mantis bugid 0015390 - showmodal closing when hide > called. > > On Tuesday 17 of April 2012 11:05:08 Justin Smyth wrote: > > Yeah i will bring post a example over the next few days > > > > > > > > > > > > what plat forms was it tested on ? > > I've tested qt, gtk2 (linux) , win32 and qt (windows) and qt under > macosx. > > > > > zeljko > > > ----- Original Message ----- > > > > From: zeljko > > > > To: ; Justin Smyth > > > > Sent: Tuesday, April 17, 2012 4:27 AM > > > > Subject: Re: [Lazarus] Mantis bugid 0015390 - showmodal closing when > > hide > > > > called. > > > > On Monday 16 of April 2012 16:28:09 Justin Smyth wrote: > > > I've noted this but was fixed on the 21-2 this year but i've just > > > > > > upgraded > > > > > > > > > > > > Lazarus from 35368 to 36784 and have found this issue still exists. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Basically i Create and ShowModal my applications main form , once it > > > > > > hits > > > > > > > > > > > > formshow it starts a thread to monitor another application and once a > > > > > > > > > > > > trigger condition is met this form is hidden ( to prevent the user > > > from > > > > > > > > > > > > entering data until other applications have finished there data look > > > > > > up) > > > > > > > > > > > > and i show the form again once its been populated with new data . but > > > > > > with > > > > > > > > > > > > the hide the showmodal exits ( which i dont want to happen, the form > > > > > > hasnt > > > > > > > > > > > > closed it just hidden while i wait for some data to come back from > > > > > > another > > > > > > > > > > > > application). > > > > > > > > > > > > > > > > > > > > > > > > I almost think a variable of IsHidden might be needed so that block > > > of > > > > > > code > > > > > > > > > > > > assoated with bugid 15390 doesnt get called ( or the break in that > > > > > > section > > > > > > > > > > > > doesnt get called). > > > > > > > > > > > > > > > > > > > > > > > > I can provide code if needed , i'd have to bring it home from work > > > but > > > > > > > > > > > > thats ok ( From Telstra) Thanks. > > > > You must provide example. It works for me, also example which is added > > by > > > > Stephano today is wrong. > > > > > > > > > > > > > > > > > > > > zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120418/aa578a47/attachment-0001.html>

Reply by email

Justin Smyth

Now Works thankyou.

added notes to the mantis bug id

tx.

Earlier message 843 lines
----- Original Message ----- From: zeljko To: Justin Smyth Sent: Wednesday, April 18, 2012 6:07 PM Subject: Re: [Lazarus] Mantis bugid 0015390 - showmodal closing when hide called. On Wednesday 18 of April 2012 00:39:46 Justin Smyth wrote: > You have it wrong. > > as per other comments showmodal SHOULD NOT exit till the form is closed > > an example of live code in one of my products > > > main form of my media player , it gets hidden to show a trayicon, when the > user clicks show it unhides , if i had to create the form again i would > have to re init all the components on the main form .. thats crazy. where > as hide and show just changes the visible component of the form. if you > exit the showmodal it is wrong .. only when the form is close should show > modal finish. > > > do i make my point clear ? you are completely wrong assuming hiding the Yes. > form should close the form. you are breaking compabity with programs > ported from delphi. sorry if i seem rude but this has caused great issues > in a product used in the work place Didn't know that delphi behaves like that (I don't have delphi at all) , so I'll see what's needed to be done to achieve that scenario (and how it will work on all platforms). > please fix this or remove this peace of code. What piece of code ? zeljko > > Justin > > ----- Original Message ----- > From: zeljko > To: Justin Smyth > Sent: Wednesday, April 18, 2012 12:29 AM > Subject: Re: [Lazarus] Mantis bugid 0015390 - showmodal closing when hide > called. > > On Tuesday 17 of April 2012 16:01:30 Justin Smyth wrote: > > sample code uploaded to mantis. > > > > > > > > i'm not doing anything fancy > > > > > > > > The Main form has a button which creates a new form , does a show modal > > and > > > > free's it when its finished ( Closed ) i've put in a messagedlg to show > > > > when its been finished. > > > > > > > > the Second form on formactivate ( and tested in formshow) i turn on a > > timer > > > > and that time when the timer event is run it does > > > > > > > > timer1.enabled:=false; > > > > hide; > > > > > > > > soon as the hide happens is when the showmodal exits. > > And your example shows same mistake. > > 1.you create modal form > > 2.called showmodal (inside show modal you called Hide; via timer) - of > course modal loop is finished when an modal form is hidden, and then your > dialog is shown, and after that you are freeing that form .. so what do > you expect ? > > > > > Here is code which works 100% (frmShowModal is already created inside lpr > - so autocreated form, and no need to create another one). > > Change code in ShowModalMain.pas of your example like this: > > > > > procedure TForm1.Button1Click(Sender: TObject); > > begin > > // frmShowModal := TfrmShowModal.Create(self); > > frmShowModal.ShowModal; > > Messagedlg('frmShowModal Exited',mtwarning,[mbok],0); > > // frmShowModal.free; > > end; > > > > > You should not Free modal form after showModal if you want it to be > "live" for hiding and showmodal or show again later. > > When you call Hide; on modal form, it hides it self and modal loops > stops.When modal loop stops in such case your previously modal form is > just like any other hidden form. > > > > > zeljko > > > Justin > > > > ----- Original Message ----- > > > > From: zeljko > > > > To: Justin Smyth > > > > Cc: > > > > Sent: Tuesday, April 17, 2012 7:12 PM > > > > Subject: Re: [Lazarus] Mantis bugid 0015390 - showmodal closing when > > hide > > > > called. > > > > On Tuesday 17 of April 2012 11:05:08 Justin Smyth wrote: > > > Yeah i will bring post a example over the next few days > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > what plat forms was it tested on ? > > > > I've tested qt, gtk2 (linux) , win32 and qt (windows) and qt under > > > > macosx. > > > > > > > > > > > > > > > > > > > > zeljko > > > > > ----- Original Message ----- > > > > > > > > > > > > From: zeljko > > > > > > > > > > > > To: ; Justin Smyth > > > > > > > > > > > > Sent: Tuesday, April 17, 2012 4:27 AM > > > > > > > > > > > > Subject: Re: [Lazarus] Mantis bugid 0015390 - showmodal closing when > > > > > > hide > > > > > > > > > > > > called. > > > > > > On Monday 16 of April 2012 16:28:09 Justin Smyth wrote: > > > > I've noted this but was fixed on the 21-2 this year but i've just > > > > > > > > > > > > > > > > upgraded > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Lazarus from 35368 to 36784 and have found this issue still exists. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Basically i Create and ShowModal my applications main form , once > > > > it > > > > > > > > > > > > > > > > hits > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > formshow it starts a thread to monitor another application and once > > > > a > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > trigger condition is met this form is hidden ( to prevent the user > > > > > > > > from > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > entering data until other applications have finished there data > > > > look > > > > > > > > > > > > > > > > up) > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > and i show the form again once its been populated with new data . > > > > but > > > > > > > > > > > > > > > > with > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > the hide the showmodal exits ( which i dont want to happen, the > > > > form > > > > > > > > > > > > > > > > hasnt > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > closed it just hidden while i wait for some data to come back from > > > > > > > > > > > > > > > > another > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > application). > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I almost think a variable of IsHidden might be needed so that block > > > > > > > > of > > > > > > > > > > > > > > > > code > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > assoated with bugid 15390 doesnt get called ( or the break in that > > > > > > > > > > > > > > > > section > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > doesnt get called). > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > I can provide code if needed , i'd have to bring it home from work > > > > > > > > but > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > thats ok ( From Telstra) Thanks. > > > > > > You must provide example. It works for me, also example which is > > > added > > > > > > by > > > > > > > > > > > > Stephano today is wrong. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > zeljko -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20120418/64011b8b/attachment-0001.html>

Reply by email