Scroller: C++Builder Version

An Idle event occurs whenever there are no other events occurring, meaning the OnIdle event handler will essentially just be called over and over. Because Idle events are associated with the application and not a form, we must explicitly set up the OnIdle handler just as we set up the application's OnActivate handler in all C++Builder examples:

Application->OnIdle = OnIdle;

Our OnIdle event handler does nothing more than call our Scroll() function to perform one iteration of the scroll.