Page 1 of 1

Custom Cursors

Posted: Fri Aug 07, 2009 2:24 pm
by ConvertFromOldNGs
by Chris Power >> Sun, 7 May 2000 2:03:38 GMT

The range of standard cursors supported by JADE and Win32 API doesn't include the Hand cursor commonly used for hyperlinks within browsers. Sure, if I hard-code a path to a cursor file I can use app.loadPicture and assign the result to a control's mouseCursor property, etc. But what if I want to load it without using an external file - as you'd do in C/C++ with application resources?

I can create a binary value with all the right bytes but I can't set its pictureType to 5 for "cursor". Curses. This is apparently set only when you load using the conventional approach.

Q: Is there any way of setting a Binary's pictureType?

Q: Alternatively, is there any way of locating the hand cursor in a standard app or dll and loading it?

Chris Power
cpower@unitec.ac.nz

Re: Custom Cursors

Posted: Fri Aug 07, 2009 2:24 pm
by ConvertFromOldNGs
by Allistar Melville >> Sun, 7 May 2000 11:46:04 GMT

In our application we have what we call an "IconLibrary". It is simply
a collection of objects that have a name and a picture property (which
is a Binary).

This way we can get a picture just by doing this:

picture := app.myIconLibrary.getAtKey("handCursor").picture;

This way you only need to load the picture from a file when the system
is first initialised, after that it stays in the database forever (or until you remove it).

Hope this helps,
Allistar.

------------------------------------------------------------------
Allistar Melville
Software Developer
Auckland, NEW ZEALAND

Greentree International,
Developer of Greentree Financial Software. ------------------------------------------------------------------