Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to show a custom cursor while hovering over a menu bar?
How to show a custom cursor while hovering over a menu bar? [message #506760] Sat, 09 January 2010 11:28 Go to next message
Eclipse UserFriend
Originally posted by: janila.web.de

Hi,

I want to implement custom cursors for my application.
Shell.setCursor(Cursor) works fine, however while hovering over a menu
bar the cursor changes back to the default picture. Can one change this
behavior?

Also, I would like to use the right side of the menu bar which is quite
empty and draw some over it. Is this possible? Havent found something
for it.

Many regards from someone still learning SWT
Jan
Re: How to show a custom cursor while hovering over a menu bar? [message #507498 is a reply to message #506760] Wed, 13 January 2010 16:42 Go to previous messageGo to next message
Grant Gayed is currently offline Grant GayedFriend
Messages: 2150
Registered: July 2009
Senior Member
Hi Jan,

I don't think that having a different cursor show in the menu bar is
currently possible. I'm not sure if it's a platform limitation or
convention, but it is consistent in that it does not work on any of the
platforms. I don't see anything in swt's win32 implementation that
explicitly makes it not show for menu bars, so I suspect that it's native
behaviour, in which case it's "right".

Since MenuBar is a Widget but not a Control, you cannot draw on it directly.
If you really want to put something on the bar then you could create a Shell
with NO_TRIM, position it over a part of the menu bar, and draw on it. For
transparent Shell examples see
http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet180.java?view=co
and
http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet219 .java .

HTH,
Grant


"Jan Keller" <janila@web.de> wrote in message
news:hiaade$b9a$1@build.eclipse.org...
> Hi,
>
> I want to implement custom cursors for my application.
> Shell.setCursor(Cursor) works fine, however while hovering over a menu
> bar the cursor changes back to the default picture. Can one change this
> behavior?
>
> Also, I would like to use the right side of the menu bar which is quite
> empty and draw some over it. Is this possible? Havent found something
> for it.
>
> Many regards from someone still learning SWT
> Jan
Re: How to show a custom cursor while hovering over a menu bar? [message #508188 is a reply to message #507498] Sun, 17 January 2010 11:33 Go to previous message
Eclipse UserFriend
Originally posted by: janila.web.de

Hi Grant,

Thank you for the answer! I will probably exchange the menu bar by a
tool bar. Its a control, so I can draw on it and the mouse cursor is
displayed as wished, only I will have to provide some custom background
images and on the mac platform the location of the menu won't be the
same, but thats probably okay.

Regards,
Jan

Am 13.01.2010 17:42, schrieb Grant Gayed:
> Hi Jan,
>
> I don't think that having a different cursor show in the menu bar is
> currently possible. I'm not sure if it's a platform limitation or
> convention, but it is consistent in that it does not work on any of the
> platforms. I don't see anything in swt's win32 implementation that
> explicitly makes it not show for menu bars, so I suspect that it's native
> behaviour, in which case it's "right".
>
> Since MenuBar is a Widget but not a Control, you cannot draw on it directly.
> If you really want to put something on the bar then you could create a Shell
> with NO_TRIM, position it over a part of the menu bar, and draw on it. For
> transparent Shell examples see
> http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.swt.sni ppets/src/org/eclipse/swt/snippets/Snippet180.java?view=co
> and
> http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org. eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet219 .java .
>
> HTH,
> Grant
Previous Topic:Delayed resize of TableEditor widgets
Next Topic:SWT Table with different sized rows and wrapped text
Goto Forum:
  


Current Time: Wed Jul 08 05:52:15 GMT 2020

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

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

Back to the top