[Lazarus] TTimer woes (newbie)

2014-03-30 Thread Bob Axtell
can someone show a newbie how to use the two system timers? --Bob A -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Re: [Lazarus] TTimer woes (newbie)

2014-03-31 Thread Michael Schnell
On 03/31/2014 01:44 AM, Bob Axtell wrote: can someone show a newbie how to use the two system timers? What do you mean by system timers ? In a normal GUI based application you normally use TTimer for time-based actions. You easily can create as many TTimers as you like (as well "visually"

Re: [Lazarus] TTimer woes (newbie)

2014-03-31 Thread Howard Page-Clark
On 31/03/2014 10:25, Michael Schnell wrote: On 03/31/2014 01:44 AM, Bob Axtell wrote: can someone show a newbie how to use the two system timers? What do you mean by system timers ? I think he means the TTimer and TIdleTimer found on the System page of the Component Palette. If you drop one

Re: [Lazarus] TTimer woes (newbie)

2014-03-31 Thread Bob Axtell
mine (a morse-code blinker) just doesn't work: unit Unit1; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls; type { TForm1 } TForm1 = class(TForm) Panel1: TPanel; Timer1: TTimer; procedure FormKeyPress(Sender: TObj

Re: [Lazarus] TTimer woes (newbie)

2014-03-31 Thread Flávio Etrusco
On Mon, Mar 31, 2014 at 2:24 PM, Bob Axtell wrote: > mine (a morse-code blinker) just doesn't work: > > unit Unit1; > > {$mode objfpc}{$H+} > > interface > > uses > Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, > ExtCtrls; > > type > > { TForm1 } > > TForm1 = class(TForm)

Re: [Lazarus] TTimer woes (newbie)

2014-04-01 Thread Michael Schnell
On 03/31/2014 07:51 PM, Flávio Etrusco wrote: TTimer in Windows (and the basic timer support in Windows ) is implemented using window messages and you're not allowing the app to process messages inside your loop. This necessity is not limited to Windows nor to TTimer. Any Object Pascal Eve

Re: [Lazarus] TTimer woes (newbie)

2014-04-01 Thread Howard Page-Clark
On 01/04/2014 09:44, Michael Schnell wrote: In fact Bob is not doing this (eating up CPU Cycles), but he uses wait(), which only hampers it's own project. Actually Bob's "wait" uses his own TTimer-based code, and is not well designed. As Flavio wrote, he would be best to replace all his waits

Re: [Lazarus] TTimer woes (newbie)

2014-04-01 Thread Paul Breneman
On 03/31/2014 01:51 PM, Flávio Etrusco wrote: ... I guess simply changing your loop to: +++ repeat Application.ProcessMessages; until not timer1.enabled; +++ should make it work. That loop will work, but the CPU usage will be 100% and the CPU will run warm and the battery life o