Questions tagged [ttimer]

VCL class encapsulating the Windows API timer functions.

TTimer is used to simplify calling the Windows API timer functions SetTimer and KillTimer, and to simplify processing the WM_TIMER messages.

13 questions
6
votes
1 answer

Who paints TTimer at design time?

Who paints TTimer at design time ? When using the Delphi IDE's form designer, when you drop a TTimer on the form, the component is visible at design time (but, of course, non-visual at runtime). The TTimer class is defined in unit ExtCtrls, so of…
mika
  • 174
  • 1
  • 2
3
votes
1 answer

Is there any way to get the time left before a TTimer is due to fire?

Possible Duplicate: Delphi Timer: Time before next event Using C++ builder XE on Windows 7 Pro (64 bit) : I have a TTimer on a form. What I want to do is to update a progress bar to show how long the TTimer has left before it calls the OnTimer…
Nigel Stevens
  • 147
  • 1
  • 1
  • 9
2
votes
1 answer

Suppress false positive warning for retriggering a Windows timer

I wish to retrigger a Windows timer using a VCL6 TTimer object. I'm doing this by toggling the Enabled property, this of course can be confusing, but I added a comment about this. For Cppcheck I added a comment as well in its…
Wolf
  • 9,679
  • 7
  • 62
  • 108
2
votes
1 answer

Do I need to call Synchronize from TTimer events?

When I access global variables or the VCL from a TTimer, do I need to use Synchronize? I use the same variables and objects from a TThread, where I already use synchronization.
Artik
  • 803
  • 14
  • 36
1
vote
2 answers

How TTimer actually works internally?

A TTimer with the interval set to 1 sec sends a message every 1 second. This message is processed in application's message loop, which results in the OnTimer event being triggered. If the application is busy and doesn't have time to process the…
Gabriel
  • 20,797
  • 27
  • 159
  • 293
1
vote
2 answers

Auto refresh a TDataSet / DBGrid

I'm developing a software that displays information in a DBGrid via a TSimpleDataSet (dbExpress components) The software in question is used on 2 different computers by 2 different people. They both view and edit the same information at different…
t1f
  • 3,021
  • 3
  • 31
  • 61
1
vote
2 answers

Delphi tIdTCPClient with timer events and other multi-threaded client side events

We have a Delphi client server application using INDY. The client has a single tIdTCPClient connection to the server which is multi threaded. The client is "theoretically" a single thread. But in practice there are multiple threads on the client…
user2696172
  • 41
  • 1
  • 3
0
votes
1 answer

Delphi Game Timer program freezes up after 1.5 to 2 hours and sometimes gives an exception "Canvas does not allow"

I have a simple program, single threaded, with a main form that has the controls, and another form with a bitmap and some TLabels on top of the bitmap that have the score, clock time, penalty time teams, and period. In my main form, I have a TTimer…
Craig
  • 11
  • 2
0
votes
0 answers

how to name a timer with a variable

I'm trying to work out how I can call a timer with a variable. I'd like to code it more efficiently than write the same code multiple times when I could just call the one timer but with a variable name. All these timers will run the same process,…
Swagman9203
  • 21
  • 1
  • 2
0
votes
2 answers

Renaming file in TTimer event produces an error

See steps below how to reproduce. I use Delphi 10.1 Berlin and Windows 10 and compile to win32. Create a new VCL Forms Application Place a TTimer and a TMemo on the form Set the timer's Interval to 10 ms Put this code in the OnTimer event: if…
Thomas
  • 375
  • 1
  • 2
  • 11
0
votes
0 answers

How best to convert multiple Delphi TTimer background scan tasks using Omnithread

I've started to look at using Omnithread to improve my Delphi Application using multithreading. Creating one or more worker tasks are well covered by the documentation so that long actions that I invoke from button clicks can be replaced by this…
Brian Frost
  • 13,334
  • 11
  • 80
  • 154
-2
votes
1 answer

Delphi TTimer providing unusual results in Win 10

I have an app that allows my users to turn on and off a timer to track their time spent on a certain task. The timer runs a clock used to show the elapsed time to the user, much like a stopwatch. The code below has worked as I thought it should for…
-2
votes
2 answers

Delphi : Show a TTimer

Is it possible to show the countdown of a TTimer in a Label ? Like instantly putting the variable in the Label Caption. I was thinking about how I could do, I'm trying to do a visible countdown in the Form.
Mike C
  • 65
  • 7