realbasic-nug
[Top] [All Lists]

Custom CURS and Windows XP

To: realbasic-nug at lists dot realsoftware dot com
Subject: Custom CURS and Windows XP
From: Emile Schwarz <emile dot a dot schwarz at wanadoo dot fr>
Date: Sat, 30 Oct 2004 17:23:52 +0200
Delivered-to: realbasic-nug at lists dot realsoftware dot com
Hi,

REALbasic 5.5.3
Windows XP SP 2 _AND_ Mac OS X 10.3.5
Change a ListBox MouseCursor on Windows XP
[Was right on Mac OS X 10.3.5]

I just tested - using a Windows XP laptop - the methodology to add custom CURS resources under Windows and double checked it under Mac OS.

Everything said in the Language Reference (Online: Command-Shift-1) is true.

Plus, when you have a CURS resource file dropped in the project Window and double-click that entry, a nice CURS 'shower' (not an editor) displays the CURS resourcce.

BTW: I have to say that only the first CURS resource in the droped file is displayable/usable (and this is said - more or less - in the OLR and far below reprint from the User’s Guide read later).


UNFORTUNATELY:
--------------
Everything said in the Language Reference (Online: F3) is FALSE under _my windows XP / Pentium IV laptop manufactured in the first half of 2004.

1. Using Share Windows (real sentence ?) and an Ethernet cable, I took the file from a PowerBook G4 and copy it in the Pentium IV (operation done from the PC laptop)

The file size is 0 byte !

2. Dropping (that empty) file gives me nothing usable and not the same icon that I saw (later when I tested the Macintosh part) on the Macintosh.

3. Window1.MouseCursor = HandCURS
REALbasic complains telling that HandCURS is a String and I need a MouseCursor.
(I was awaiting an error message)

4. This was already found from a previous test (yesterday), but the following fails on Windows:

I get the message box text:

Sorry, I didn't found the CURS ID=<passed-CURS-ID>.

I expected that a bit and that was the reason why I created a CURS resource 
file !


  Dim rf     As ResourceFork
  Dim mc     As MouseCursor
  Dim CURSid As Integer

  rf = App.ResourceFork
  If rf = Nil Then
    MsgBox "Sorry: unable to open the Application ResourceFork"
    Return
  End If

  // Get the wanted MouseCursor
  mc = rf.GetCursor(CursID)
  If mc = Nil Then
    MsgBox "Sorry, I didn't found the CURS ID=" + Str(CursID) + "."
    Return
  End If

  // Set the 'MouseDown' MouseCursor
  LB.MouseCursor = mc



Nota:
I just had a crazy idea: build the .exe from Macintosh and run in on the Windows hardware: failed ! The MouseCursor is not changed. I make an attempt to get a solution. Sorry. [I built the exe with the RB 5.5.3 Pro, and copy it to the Pentium using the Ethernet cable]


Now, I am awaiting for advices and documentation changes…

Emile




REALbasic 5.5.3 User’s Guide pdf (from August 2004), Page 361:
(taken from the Macintosh web page)

Custom Cursors in Windows Applications
You can use CURS resources to assign custom cursors in built Windows applications. This, at present, is the only case in which resources are supported on Windows builds. The relationships among the MouseCursor properties of the Application, Window, and Control are the same as for Macintosh applications, but you must create the resource files in a special way. This technique is also recommended for Macintosh builds. The key is that you must create a separate resource file for each custom cursor that you add to the project. Each resource file must have only a CURS resource that contains one cursor. Typically, you will assign the custom cursor to ID 128. An example is shown in Figure 283.


BTW: There is a small 'error' in the page 362 between the Figure 284 and the source code below.

The Figure 284 displays three cursors (CURS resources) named pen, Stamp and wand, and the source code ask for Sponge:

Self.MouseCursor=Sponge

This is just disturbing a second or two (for me, but for starters ?).

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>
  • Custom CURS and Windows XP, Emile Schwarz <=