Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » How to change default SelectionTool cursor?
How to change default SelectionTool cursor? [message #174845] Fri, 01 April 2005 09:23 Go to next message
Pavel Repkin is currently offline Pavel RepkinFriend
Messages: 4
Registered: July 2009
Junior Member
Hello, GEF team!
I would like to change default selection cursor.
This is how I do it:
SelectionTool selectionTool = ...
selectionTool.setDefaultCursor(myCursor);

The cursor actually gets substituted, but when I move mouse
over selection handles, the cursor isn't changed.

I've investigated this and found out the following.
SelectionTool sets DomainEventDispatcher.overrideCursor indirectly through
the following control flow
----
DomainEventDispatcher.setOverrideCursor(Cursor) line: 488
GraphicalViewerImpl.setCursor(Cursor) line: 316
AbstractTool.setCursor(Cursor) line: 1236
----
Then any attempt to ask DomainEventDispatcher to change cursor fails,
because overrideCursor isn't null.
Are there any workaround to solve my problem?
Re: How to change default SelectionTool cursor? [message #174986 is a reply to message #174845] Fri, 01 April 2005 17:07 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

The selection tool is designed to have no cursor. If you want to change the
canvas' default cursor, have you tried Canvas.setCursor()?

"Pavel Repkin" <pavel.repkin@borland.com> wrote in message
news:b4d3a0d83e7801595ad6c33d00b129c4$1@www.eclipse.org...
> Hello, GEF team!
> I would like to change default selection cursor.
> This is how I do it:
> SelectionTool selectionTool = ...
> selectionTool.setDefaultCursor(myCursor);
>
> The cursor actually gets substituted, but when I move mouse over selection
> handles, the cursor isn't changed.
>
> I've investigated this and found out the following.
> SelectionTool sets DomainEventDispatcher.overrideCursor indirectly through
> the following control flow
> ----
> DomainEventDispatcher.setOverrideCursor(Cursor) line: 488
> GraphicalViewerImpl.setCursor(Cursor) line: 316
> AbstractTool.setCursor(Cursor) line: 1236
> ----
> Then any attempt to ask DomainEventDispatcher to change cursor fails,
> because overrideCursor isn't null.
> Are there any workaround to solve my problem?
>
>
Re: How to change default SelectionTool cursor? [message #175239 is a reply to message #174986] Mon, 04 April 2005 05:49 Go to previous messageGo to next message
Pavel Repkin is currently offline Pavel RepkinFriend
Messages: 4
Registered: July 2009
Junior Member
I've tried to set Canvas cursor the way you proposed, but it doesn't work
well.
At the time view is opened the cursor looks good - the one I specified.
But when I move mouse over selection handle and then move it back to
canvas, the cursor changes to default arrow, and doesn't seem to change to
my custom cursor ever after that.
Re: How to change default SelectionTool cursor? [message #175363 is a reply to message #175239] Mon, 04 April 2005 14:45 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

That doesn't sound surprising now that you mention it.
Can you open a bugzilla?

"Pavel Repkin" <pavel.repkin@borland.com> wrote in message
news:8b5872497f0b6333d87a7ca785a5468a$1@www.eclipse.org...
> I've tried to set Canvas cursor the way you proposed, but it doesn't work
> well.
> At the time view is opened the cursor looks good - the one I specified.
> But when I move mouse over selection handle and then move it back to
> canvas, the cursor changes to default arrow, and doesn't seem to change to
> my custom cursor ever after that.
>
Re: How to change default SelectionTool cursor? [message #175379 is a reply to message #175363] Mon, 04 April 2005 15:11 Go to previous messageGo to next message
Donna Gresh is currently offline Donna GreshFriend
Messages: 30
Registered: July 2009
Member
This is a multipart message in MIME format.
--=_alternative 0053328985256FD9_=
Content-Type: text/plain; charset="US-ASCII"

I don't know if this is related but I had a similar (completely non-GEF
related problem) when I was setting
the wait cursor, and then wanting to set it back to the "default" cursor
after that. I found that I then had lost the nice
cursor you get when you are hovering over a "resizeable" thing.

The reason was that my resetting back to the default cursor was doing

setCursor(SWT.CURSOR_ARROW)

when I *should* have been doing

setCursor(none)

So anyway, even if this is not what's happening here, and there really is
a bug, perhaps this hint will help someone else along the way.

--=_alternative 0053328985256FD9_=
Content-Type: text/html; charset="US-ASCII"


<br><font size=2 face="sans-serif">I don't know if this is related but
I had a similar (completely non-GEF related problem) when I was setting</font>
<br><font size=2 face="sans-serif">the wait cursor, and then wanting to
set it back to the &quot;default&quot; cursor after that. I found that
I then had lost the nice</font>
<br><font size=2 face="sans-serif">cursor you get when you are hovering
over a &quot;resizeable&quot; thing.</font>
<br>
<br><font size=2 face="sans-serif">The reason was that my resetting back
to the default cursor was doing</font>
<br>
<br><font size=2 face="sans-serif">setCursor(SWT.CURSOR_ARROW)</font>
<br>
<br><font size=2 face="sans-serif">when I *should* have been doing</font>
<br>
<br><font size=2 face="sans-serif">setCursor(none)</font>
<br>
<br><font size=2 face="sans-serif">So anyway, even if this is not what's
happening here, and there really is a bug, perhaps this hint will help
someone else along the way.</font>
<br>
--=_alternative 0053328985256FD9_=--
Re: How to change default SelectionTool cursor? [message #175530 is a reply to message #175363] Tue, 05 April 2005 07:39 Go to previous messageGo to next message
Pavel Repkin is currently offline Pavel RepkinFriend
Messages: 4
Registered: July 2009
Junior Member
>Can you open a bugzilla?

Do you want me to submit an SCR
or this bug is in bugzilla already and I have to examine it?
Re: How to change default SelectionTool cursor? [message #175857 is a reply to message #175530] Wed, 06 April 2005 18:11 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
Open a new one.

"Pavel Repkin" <pavel.repkin@borland.com> wrote in message
news:f489fcbbaf4aa4d83f73c3f57e17b2cf$1@www.eclipse.org...
> >Can you open a bugzilla?
>
> Do you want me to submit an SCR
> or this bug is in bugzilla already and I have to examine it?
>
Previous Topic:SELECTION PROBLEM!!!!!!!!!!!
Next Topic:entities with internal modeling area
Goto Forum:
  


Current Time: Thu Mar 28 11:32:56 GMT 2024

Powered by FUDForum. Page generated in 0.85408 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top