header image
Home arrow RealBasic Code
RealBasic Code
How to make a Custom Cursor in RB PDF Print E-mail
Written by CrystalBallSoft Staff   
Mar 17, 2009 at 11:32 AM

This works on RB 2007r4 or later!

How to make a Custom Cursor for RealBasic:

  1. You will need a copy of the following apps:
    1. Rezilla ( http://www.versiontracker.com/dyn/moreinfo/macosx/23349 )
    2. exCURS ( http://software.tooloo.de/rb/exCURS.dmg )
  2. Open Rezilla to draw the cursor.
    1. Create a "New Resource Map" (Command N)
      1. Make sure you choose "Resource Fork" on the "New Resource Map" dialog!
      2. The Name you give the file will be the name of the RB Cursor Object!
    2. Make a new Resource. (Resources >> New Resource)
    3. Enter the Resource Type as: CURS
    4. Click "Create"
    5. Edit the Cursor Image.
    6. Save the Cursor Resource.
    7. Save the Resource Map File.
  3. Drag the Resource Map File onto "exCURS"
    1. This will create a folder called "xml-cursors" with a RB XML file for the cursor.
    2. This works around a bug where RB can't read the position of the hotspot in the cursor if its anywhere but the top-left corner.
      see: http://forums.realsoftware.com/viewtopic.php?f=7&t=25214
  4. Open the Project you wish to use the Cursor in.
    1. Drag the XML file made by exCURS into the RB project.
    2. You now have a custom cursor you can use!
      (eg: me.MouseCursor = CursorName)
NOTE: GRRR! there is a bug when using a cursor in RB2007+ when the hotspot is anywhere but the top left corner.
So you need to use exCURS if you want the hotspot anywhere else.
 
XML Error Finder PDF Print E-mail
Written by CrystalBallSoft Staff   
Aug 10, 2007 at 02:51 PM

Current Version: 1.0
Type: Example
License: Free
Requires: RB 5.5 or later

Find and Repair Errors in XML Files:
This application detects and repairs errors in an XML file that will cause RB to throw an XML Exception. Specifically this application searches for Ascii characters from 1 - 31 (not including Linefeed Character - 10 and Carriage Return Character - 13). These characters cause the XML tools in RB 5.5 to throw the exception when trying to parse the file.

Interestingly enough on the Mac, you can inadvertently enter these lower ascii characters by holding Control and typing a letter in a standard RB editfield. Therefore it is possible for a user to accidentally hit Control-(Letter) instead of Shift -(Letter)
and thereby insert a bad character into the editfield which will then get saved into the XML file. So the next time the file is read it will not be able to parse the file.

This very problem cause me some headaches in some of my apps, until I was finally able to track down the culprit.

This RB code also includes an example to demonstrate which Ascii values will cause an XML exception under different text encodings.

Works: OS X, Classic, Windows.

Download  

 

Last Updated ( Aug 10, 2007 at 02:56 PM )
XML Preferences PDF Print E-mail
Written by CrystalBallSoft Staff   
Aug 10, 2007 at 02:50 PM

Current Version: 1.0
Type: Module
License: Free
Requires: RB 5.5 or later

Very Easy Preferences Module:
This modules makes it incredibly simple to generate an XML compliant preferences file for your application. It uses the XMLDictionary Module by Kevin Ballard (http://www.tildesoft.com) to write out the preferences file. Instructions are included in the module's note section.

You can GET and SET the following data types: Boolean, String, Integer, Double (Real Number), FolderItem, Color, Date, and a Window's position and size.

Works: OS X, Classic, Windows.

DOWNLOAD  

Last Updated ( Aug 10, 2007 at 02:57 PM )
RealBasic Code
RealBasic Code
Feel free to use this code with any of your RealBasic projects.  If you update any of them, let us know so that we can update our versions.