rmBlinker.cc ![]() |
|
Two Custom controls providing object "Blinking" |
Blinking controls are probably a bad idea. It is something you don't see very often, and the closest similar idea is probably blinking text on HTML pages which is designed to attract the users attention, but in reality probably just annoys them. Nevertheless, the technique is perhaps of interest, whether you would actually wish to use this for this exact purpose in an application or not. The first custom control is a custom timer which has an array of object references to the objects which require to be "blinked", and this array can be added to dynamically, with newly added objects having their "blinking" synchronised with those already blinking. The top four buttons on the provided sample form demonstrate this. There is a problem though. The dBASE timer control only counts time when dBASE itself is idle. This means that as soon as you do something else, the timer timing becomes erratic, unpredictable, or just plain stops. This means that it is not possible to use a timer in this way to provide functionality while processing in a loop. The topmost wide button on the demo form shows this "not working"! The bottom button shows one solution to this, using a second custom control. This does not use a timer, but relies on its Blink() function being called from within the processing loop whereupon it decides whether the objects in its array require to be "Blinked". The timing is done using system time, and is therefore predictable, regular and accurate so long as the time taken to perform one loop is less than half the blink interval, and of course this will normally be the case. See rmBlinker.wfm for sample usage and code.
|