Jump to navigation Jump to search
The timer class is an non visual component that when active triggers an onTimer event every tick. (base on Interval property)
- createTimer(owner OPTIONAL, enabled OPTIONAL)
- Returns a newly created timer object.
- If enabled is not given it will be enabled by default (will start as soon as an onTimer event has been assigned)
- Owner may be nil, but you will be responsible for destroying it instead of being the responsibility of the owner object)
Tip: use getMainForm for the owner of any timer so that it is destroyed when the main form is destroyed (closed).
- Interval : integer
- The number of milliseconds (1000 = 1 second) between ticks (executions).
- Enabled : boolean
- The enable state of the Timer.
- OnTimer : function(timer)
- The function to call when the timer triggers (tick).
- getInterval() : integer
- Returns the speed on how often the timer will trigger. In milliseconds (1000 = 1 second).
- Sets the speed on how often the timer should trigger. In milliseconds (1000 = 1 second).
- getOnTimer() : function(timer)
- Returns the 'OnTimer' event.
- Sets the 'OnTimer' event.
- getEnabled() : boolean
- Returns the enable state of the Timer.
- Sets the enable state of the Timer.