![]() |
|
|
A light hearted aside or full-blown procrastination?? You decide!
Functional Description
A simple little application which allows you to tease one the greatest TV characters of all time. When you run the vi, the mouse cursor will become a donut and Homer Simpson’s eyes will follow the cursor around the screen.
For a simple, fun, little application, this one does show a number of interesting design features, including…
- Custom Controls (Strict Type Defs), allowing a simple Dial Control to mimic Matt Groening's distinctive eye design.
- Relative File Paths, which allows the application to locate the .cur file correctly when running on machines other than the development PC.
- Event Driven Programming, for efficient non-polling applications
- Windows DLL interaction, to programmatically change the cursor object.
- LabVIEW’s Maths and Trigonometry functions to determine the cursor position from the central (0,0) front panel position.
Caveats and Additional Notes
To completely unclutter the user interface I have hidden the front panel controls and indictors from view. This includes a few numeric indicators that I used for debugging and a Boolean stop button. However, I have associated the F10 keyboard button with the stop control (done via the properties menu for the stop button), so you can stop programmatically stop the application by hitting the F10 button.
If you terminate the application by aborting execution, the mouse cursor would not revert back to the original LabVIEW cursor. Therefore, I have prevented user accessing the abort button by setting the application’s “window appearance” as “dialog box”. You can do this through the vi property menu.
The application does break one cardinal rule of good front panel design – I have placed controls on top of an image. This means that every time the control changes, LabVIEW has to redraw the “background” image also. In this particular case, the application is not particularly processor intensive (and the image is fairly low res) so it does not matter – just please be aware that it is not generally good design practice.
Required Software
To run this application you will require nothing but LabVIEW 8.6 (full or above).
What a cool program and great explanation! You even noted the controls on picture issue, wow I am impressed, you rock!
Nice App.
On a side note, you would need LV Full or Pro because there is the Event structure in the VI.
Vincent
Love this... ha ha