rmCursor.cc ![]() |
|
A Custom Control facilitating non native Mouse Cursors |
Have you ever wished you could use a cursor other than the native selection of MousePointers provide by dBASE. Well the answer is that you can, using API calls. Gary White demonstrated the basic method of using a discreet .cur or .ani file back in 2001. However in a distributed application it would be more desirable to use cursor resources contained in a dll. In addition there was no easy way to provide this functionality in "drop on form" format. What this control does is to provide cursor resources and methods in an easily accessible format, simply by dropping the control on a form. It can be used to provide non native cursors for form controls, sourced from either cur or .ani files, or cursor resources from a DLL The control has an associative array, "aCursorBank", which can be loaded with as many cursors as you need in your application, and then the cursor for a given control can be set at any given point in time to any one of the cursors in the array referenced simply by name. Useage :
Optionally use RestoreCursor() when the mouse leaves the confines of the control. MouseOver detection, preferably with mouse capture, is required if you wish to do this, but better overall control is then achieved. Some ActiveX controls need to be treated differently, in that it is the MouseMove event of the NativeObject that needs to be coded rather than the onMouseMove of the dBase ActiveX container object. See rmCursorTest.wfm for sample useage and code.
|