Board index » delphi » New D5 Component missing an event !

New D5 Component missing an event !

I recently installed Delphi 5 and found that we now have a ApplicationEvents
component on the additional tab. This is cool and it has a nice group of
events including the onIdle event. The problem is that there isn't an event
to notify that the application is no longer idle. For instance if I want
procedure X to occur 15 minutes after the onIdle event fires then I would
set a timer to start incrementing a global variable using the Onidle event.
Now if the user clicks on the application or something then the timer should
stop and the global variable should be reset to 0. In order to do this now I
would have to trap mouse events and key presses(I am guessing as I haven't
tried to trap anything yet). Am I missing something or is this the intended
way to use this component?

Jeremiah Chapman

 

Re:New D5 Component missing an event !


The component simply encapsulates the Application object already in Delphi
(since D1) , it's not really new.  It just makes it easier to write events
for... From what I understand the "intended" use of the OnIdle is to do
background processing when a user isn't punching keys.

However, to do what you want, you would write an OnMessage handler for the
application object, then when you get a message, this may signal user input...

-Gabe

Quote
Jeremiah Chapman wrote:
> I recently installed Delphi 5 and found that we now have a ApplicationEvents
> component on the additional tab. This is cool and it has a nice group of
> events including the onIdle event. The problem is that there isn't an event
> to notify that the application is no longer idle. For instance if I want
> procedure X to occur 15 minutes after the onIdle event fires then I would
> set a timer to start incrementing a global variable using the Onidle event.
> Now if the user clicks on the application or something then the timer should
> stop and the global variable should be reset to 0. In order to do this now I
> would have to trap mouse events and key presses(I am guessing as I haven't
> tried to trap anything yet). Am I missing something or is this the intended
> way to use this component?

> Jeremiah Chapman

Other Threads