Re: [lazarus] showmessage or similar that closes without a prompt
On 18/12/2007, el stamatakos <[EMAIL PROTECTED]> wrote: > > Hi Graeme, > I tried exactly what you did on the Linux side and the form comes up but > it does not show the caption and the form does not close it just hangs > there. Not sure what is wrong. Thanks for your help and sending the project. > Any ideas? I have no idea what you are doing. The project I sent to the mailing list works. It was created under Windows XP and worked perfectly. I have just tested that same project under Ubuntu Linux and everything works just like under Windows. Have you tried the example project I attached in my previous email? Does that project work? Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] showmessage or similar that closes without a prompt
On 17/12/2007, el stamatakos <[EMAIL PROTECTED]> wrote: > > Hi All, > I am having problems with this timer. The first thing is it does not close > the form, even if I change the interval time. The second thing is I have a > label on the form and the message is not being assigned to the labels caption > as in MessageForm.Label1.Caption:=Msg; > I modified the program to include I modified my code as per requests of > users to below I created a new notification form. Removed it from AutoCreate. Removed Border and created a ShowNotification() procedure. On the main form I have a Memo for whatever message and a button that calls ShowNotification. I've attached my example project that works fine under Windows XP. Rename the file with a .zip extension and unpack. Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ notifyscreen.zipped Description: Binary data
RE: [lazarus] showmessage or similar that closes without a prompt
Hi All, I am having problems with this timer. The first thing is it does not close the form, even if I change the interval time. The second thing is I have a label on the form and the message is not being assigned to the labels caption as in MessageForm.Label1.Caption:=Msg; I modified the program to include I modified my code as per requests of users to below procedure TMainForm.ShowNotification(Msg:String; time:Cardinal); var MessageForm:TMessageChildForm; begin MessageForm:=TMessageChildForm.Create(nil); MessageForm.Label1.Caption:=Msg; MessageForm.Caption:='Project Setup'; MessageForm.Timer1.Interval:=time; MessageForm.Show; end; procedure TMessageChildForm.Timer1Timer(Sender: TObject); begin Timer1.Enabled:=False; Close; end; procedure TMessageChildForm.FormShow(Sender: TObject); begin Timer1.Enabled:=True; end; Anything wrong with the above. Thanks Lefti > Date: Fri, 14 Dec 2007 17:25:37 -0500 > From: [EMAIL PROTECTED] > To: lazarus@miraclec.com > Subject: Re: [lazarus] showmessage or similar that closes without a prompt > > el stamatakos wrote: >> Hi All, >> I created a form. I placed a TTimer on this form and a label. The code is >> like this >> >> procedure TMainForm.ShowNotification(Msg:String; time:Cardinal); >> var >> MessageForm:TMessageChildForm; >> begin >> MessageForm:=TMessageChildForm.Create(Self); >> MessageForm.Show; >> MessageForm.Visible:=True; >> MessageForm.Label1.Caption:=Msg; >> MessageForm.Timer1.Interval:=time; >> MessageForm.Close; >> end; >> >> and the call is >> ShowNotification('Creating directories',5000); >> >> I assume this is 5 seconds but when I run the app it goes faster then that >> like not even 1 sec. Anything worng with the code above >> > > You are Closing the form yourself. "MessageForm.Close;" > > > You need to set the OnTimer Event of Timer1 and in that procedure is > where you call MessageForm.Close; > > Also disable the timer when it runs and reenable it when you call > ShowNotification > > > Happy Coding, > > Andrew > > _ > To unsubscribe: mail [EMAIL PROTECTED] with > "unsubscribe" as the Subject >archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] showmessage or similar that closes without a prompt
Like Andrew said, you are closing the form yourself. Leave it for the timer to do. On 15/12/2007, el stamatakos <[EMAIL PROTECTED]> wrote: > > procedure TMainForm.ShowNotification(Msg:String; time:Cardinal); > var > MessageForm:TMessageChildForm; > begin > MessageForm:=TMessageChildForm.Create(Self); I would change Self to nil. > MessageForm.Show; I would move Show 'till after you have set the Msg and Time. > MessageForm.Visible:=True; This shouldn't be needed. > MessageForm.Close; Remove this line and rather call Show here. Also in the MessageForm.OnShow, enabled the timer. Don't enable the timer in the MessageForm.Create. In the MessageForm.OnTimerFired event handler, disable the timer and then call Close. Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] showmessage or similar that closes without a prompt
el stamatakos wrote: > Hi All, > I created a form. I placed a TTimer on this form and a label. The code is > like this > > procedure TMainForm.ShowNotification(Msg:String; time:Cardinal); > var > MessageForm:TMessageChildForm; > begin > MessageForm:=TMessageChildForm.Create(Self); > MessageForm.Show; > MessageForm.Visible:=True; > MessageForm.Label1.Caption:=Msg; > MessageForm.Timer1.Interval:=time; > MessageForm.Close; > end; > > and the call is > ShowNotification('Creating directories',5000); > > I assume this is 5 seconds but when I run the app it goes faster then that > like not even 1 sec. Anything worng with the code above > You are Closing the form yourself. "MessageForm.Close;" You need to set the OnTimer Event of Timer1 and in that procedure is where you call MessageForm.Close; Also disable the timer when it runs and reenable it when you call ShowNotification Happy Coding, Andrew _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
RE: [lazarus] showmessage or similar that closes without a prompt
Hi All, I created a form. I placed a TTimer on this form and a label. The code is like this procedure TMainForm.ShowNotification(Msg:String; time:Cardinal); var MessageForm:TMessageChildForm; begin MessageForm:=TMessageChildForm.Create(Self); MessageForm.Show; MessageForm.Visible:=True; MessageForm.Label1.Caption:=Msg; MessageForm.Timer1.Interval:=time; MessageForm.Close; end; and the call is ShowNotification('Creating directories',5000); I assume this is 5 seconds but when I run the app it goes faster then that like not even 1 sec. Anything worng with the code above Thanks Lefti > Date: Fri, 14 Dec 2007 18:00:33 +0200 > From: [EMAIL PROTECTED] > To: lazarus@miraclec.com > Subject: Re: [lazarus] showmessage or similar that closes without a prompt > > On 14/12/2007, Lee Jenkins wrote: > >>ShowWaitMessage(sMsg, true); >>// ... do some work >>ShowWaitMessage('', false); > > > I was going to add that to tiOPF, but I see it already has something > like that. :-) Amazing, after 5 years I still find new things in > tiOPF. > > [tiDialogs.pas] > > procedure tiProcessing(const AMessage : String); > procedure tiEndProcessing; > > > > Regards, > - Graeme - > > > ___ > fpGUI - a cross-platform Free Pascal GUI toolkit > http://opensoft.homeip.net/fpgui/ > > _ > To unsubscribe: mail [EMAIL PROTECTED] with > "unsubscribe" as the Subject >archives at http://www.lazarus.freepascal.org/mailarchives _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] showmessage or similar that closes without a prompt
On 14/12/2007, Alexsander Rosa <[EMAIL PROTECTED]> wrote: > Why not use a TMemo? You could show several messages, like a progress log. It uses valuable screen space. The popup window is temporary. > Alternatively, you could show the information in the status bar. It's not visible (eye catching) enough. Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] showmessage or similar that closes without a prompt
Why not use a TMemo? You could show several messages, like a progress log. Alternatively, you could show the information in the status bar. 2007/12/13, el stamatakos <[EMAIL PROTECTED]>: > > Hi, > I would like to display a message but not wait for the user to hit ok. I > would like to display it for 1 second and then close it. The reason is I > will have a process that will do different things and I would like to > dispaly what is being done. > > Thanks > Lefti > -- Atenciosamente, Alexsander da Rosa Linux User #113925
Re: [lazarus] showmessage or similar that closes without a prompt
Graeme Geldenhuys wrote: On 14/12/2007, Lee Jenkins <[EMAIL PROTECTED]> wrote: ShowWaitMessage(sMsg, true); // ... do some work ShowWaitMessage('', false); I was going to add that to tiOPF, but I see it already has something like that. :-) Amazing, after 5 years I still find new things in tiOPF. [tiDialogs.pas] procedure tiProcessing(const AMessage : String); procedure tiEndProcessing; Nice. I would have missed it too. Actually I've run across several little nuggets hidden in tiOPF... -- Warm Regards, Lee "If I don't see you around here, I'll see you around, hear?" _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] showmessage or similar that closes without a prompt
On 14/12/2007, Lee Jenkins <[EMAIL PROTECTED]> wrote: >ShowWaitMessage(sMsg, true); >// ... do some work >ShowWaitMessage('', false); I was going to add that to tiOPF, but I see it already has something like that. :-) Amazing, after 5 years I still find new things in tiOPF. [tiDialogs.pas] procedure tiProcessing(const AMessage : String); procedure tiEndProcessing; Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] showmessage or similar that closes without a prompt
On 14/12/2007, Lee Jenkins <[EMAIL PROTECTED]> wrote: >ShowWaitMessage(sMsg, true); >// ... do some work >ShowWaitMessage('', false); I like that idea. Nice one! Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] showmessage or similar that closes without a prompt
Graeme Geldenhuys wrote: On 13/12/2007, el stamatakos <[EMAIL PROTECTED]> wrote: Hi, I would like to display a message but not wait for the user to hit ok. I would like to display it for 1 second and then close it. The reason is I will have a process that will do different things and I would like to dispaly what is being done. Yeah, a form with a Timer should do the trick. Same principle as a splash screen. I've done something similar in my projects and created a helper function to create and show the form, so I don't need to do that every time. The form also has a 3D look with now title bars or borders. eg: ShowNotification('your message goes here', displaytime); displaytime is optional and defaults to 2 seconds in my case. or even: ShowWaitMessage(AMessage: string; ToShow: boolean); var sMsg: string; begin sMsg := 'Hold up, wait a minute, put a little pimpin in it'; ShowWaitMessage(sMsg, true); // ... do some work ShowWaitMessage('', false); end; -- Warm Regards, Lee "If I don't see you around here, I'll see you around, hear?" _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] showmessage or similar that closes without a prompt
On 13/12/2007, el stamatakos <[EMAIL PROTECTED]> wrote: > > Hi, > I would like to display a message but not wait for the user to hit ok. I > would like to display it for 1 second and then close it. The reason is I > will have a process that will do different things and I would like to > dispaly what is being done. Yeah, a form with a Timer should do the trick. Same principle as a splash screen. I've done something similar in my projects and created a helper function to create and show the form, so I don't need to do that every time. The form also has a 3D look with now title bars or borders. eg: ShowNotification('your message goes here', displaytime); displaytime is optional and defaults to 2 seconds in my case. Regards, - Graeme - ___ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives
Re: [lazarus] showmessage or similar that closes without a prompt
On Dec 13, 2007, at 9:33 PM, el stamatakos wrote: Hi, I would like to display a message but not wait for the user to hit ok. I would like to display it for 1 second and then close it. The reason is I will have a process that will do different things and I would like to dispaly what is being done. May be a form with a timer on it ? It should make what you want. Thanks Lefti -- Damien Gerard [EMAIL PROTECTED] People who used magic without knowing what they were doing usually came to a sticky end. All over the entire room, sometimes. -- (Terry Pratchett, Moving Pictures)
[lazarus] showmessage or similar that closes without a prompt
Hi, I would like to display a message but not wait for the user to hit ok. I would like to display it for 1 second and then close it. The reason is I will have a process that will do different things and I would like to dispaly what is being done. Thanks Lefti