Custom Cursors

Forums for specific tips, techniques and example code
ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Custom Cursors

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:24 pm

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

ConvertFromOldNGs
Posts: 5321
Joined: Wed Aug 05, 2009 5:19 pm

Re: Custom Cursors

Postby ConvertFromOldNGs » Fri Aug 07, 2009 2:24 pm

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. ------------------------------------------------------------------


Return to “Tips and Techniques”

Who is online

Users browsing this forum: No registered users and 25 guests

cron