Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Wed Aug 23, 2017 6:52 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: MouseCursor - Cocoa
PostPosted: Wed Apr 17, 2013 9:22 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
Does changing the MouseCursor not work (yet??) in Cocoa???



Canvas1.MouseCursor=system.Cursors.FingerPointer
Canvas1.MouseCursor=cursor_crosshair ' XML define cursor


Both the above lines work perfectly when compiled for CARBON, but do nothing (pointer remains an arrow) under COCOA

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: MouseCursor - Cocoa
PostPosted: Thu Apr 18, 2013 8:05 am 
Offline

Joined: Mon Apr 10, 2006 3:02 am
Posts: 52
Hi,

For working, need to set your code

on the MouseEnter events

Bye


Top
 Profile  
Reply with quote  
 Post subject: Re: MouseCursor - Cocoa
PostPosted: Thu Apr 18, 2013 8:14 am 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
You seemed to have missed the question.

Why (or when) will mousecursors work with COCOA. These work fine with CARBON... and do nothing for COCOA (regardless or where in the program they are set)



Note : if I create a program with nothing more that ONE line of code to set cursor it works in Cocoa.... but in a larger app it does not (and there is only TWO lines to control the cursor)... One on MOUSEDOWN, and one on MOUSEUP


Also (from notes on the web)... changed to APP.MOUSECURSOR.... but it did not change until the MOUSEUP event... which makes it totally pointless

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: MouseCursor - Cocoa
PostPosted: Thu Apr 18, 2013 9:09 pm 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
DaveS wrote:
You seemed to have missed the question.

Why (or when) will mousecursors work with COCOA. These work fine with CARBON... and do nothing for COCOA (regardless or where in the program they are set)



Note : if I create a program with nothing more that ONE line of code to set cursor it works in Cocoa.... but in a larger app it does not (and there is only TWO lines to control the cursor)... One on MOUSEDOWN, and one on MOUSEUP


Also (from notes on the web)... changed to APP.MOUSECURSOR.... but it did not change until the MOUSEUP event... which makes it totally pointless


It's funny how I recently did something similar, but I was looking to set a Retina cursor. In my tests I did find that setting rectControl.mousecursor to a custom cursor worked (but didn't get the HIDPI version).

To get a Retina cursor, I loaded up a NSImage, then created a NSCursor from it. Then in the mouse enter event I make it the current cursor and in the mouse exit event, I made the standard pointer the current cursor.

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
Reply with quote  
 Post subject: Re: MouseCursor - Cocoa
PostPosted: Thu Apr 18, 2013 11:36 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
So basically.... they don't work?

MouseEnter/Exit isn't an option. I need the cursor to change to the image I need, when I need it and that most likely is while the mouse is and has been inside the canvas..... For example.... it is Arrow, until they click on something, then it changes to the Finger, then if they drag it over another area it changes to the Hand etc.

The best I have been able to get is the cursor changes on MOUSEUP event.... which is not acceptable. And this is a COCOA issue, it works fine under Carbon....

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: MouseCursor - Cocoa
PostPosted: Fri Apr 19, 2013 12:53 am 
Offline
User avatar

Joined: Fri Sep 30, 2005 11:00 am
Posts: 583
Location: Beautiful Taiwan
DaveS wrote:
So basically.... they don't work?

MouseEnter/Exit isn't an option. I need the cursor to change to the image I need, when I need it and that most likely is while the mouse is and has been inside the canvas..... For example.... it is Arrow, until they click on something, then it changes to the Finger, then if they drag it over another area it changes to the Hand etc.

The best I have been able to get is the cursor changes on MOUSEUP event.... which is not acceptable. And this is a COCOA issue, it works fine under Carbon....

I would recommend submitting feedback so that RS are aware of it. In the mean time, if you want to use standard cursors I might be able to knock up some simple code for you which you should be able to use instead.

_________________
Sam Rowlands
rMBP 15" @ 10.8 & '08 MBA 13" @ 10.6 + 10.7, RB2012
http://www.ohanaware.com/
AppWrapper - Prepare Apps for Mac App Store & OS X 10.8 - http://www.ohanaware.com/appwrapper/


Top
 Profile  
Reply with quote  
 Post subject: Re: MouseCursor - Cocoa
PostPosted: Thu Apr 25, 2013 7:32 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
I have found the APP.MOUSECURSOR works reliably... but <rectcontrol>.mousecursor does not. It will sometimes reset the cursor and sometimes not

So.... I have resorted to change the cursor at the APP level and tracking it as it enters/leaves certain controls


One thing I still notice... is I create a DRAG item.... and the cursor reverts to the System Arrow (even if I set dragitem.mousecursor)..... but ONLY the first time.... after that it works

Note : this is all COCOA

And what I have done is written a custom module with 24x24 cursors (so I could add some custom ones, and decide if I want to change the "standard" ones)



Usage :
Replace - System.Cursors.FingerPointer
With - CustomCursors.HourGlass


Cursors defined as of 25Apr2013

01 - Standard Pointer : Standard
02 - Finger Pointer : Standard
03 - IBeam : Standard
04 - CrossHair : NEW Custom
05 - AllScroll : NEW Custom
06 - ArrowQuestion : NEW Custom
07 - ArrowHourGlass : NEW Custom
08 - HourGlass : NEW Custom

09 - ArrowEastWest : Standard
10 - ArrowNorthSouth : Standard
11 - ArrowNortheastSouthwest : Standard
12 - ArrowNorthwestSoutheast : Standard
13 - ArrowAllDirections : Standard
14 - SplitterEastWest : Standard
15 - SplitterNorthSouth : Standard
16 - Cancel : NEW Custom

17 - HandOpen : Standard
18 - HandClosed : Standard
19 - MagnifyLarger : Standard
20 - MagnifySmaller : Standard
21 - Pencil : NEW Custom
22 - ArrowText : NEW Custom
23 - Wait : Standard
24 - InvisibleCursor : Standard

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group