own buttons [message #455988] |
Tue, 24 May 2005 15:37 |
Eclipse User |
|
|
|
Originally posted by: BradJRScott.yahoo.com
Hello,
I was wondering if there is a way to create your own buttons with SWT (I
need an to create an oval one).
Thanks,
Brad
|
|
|
|
Re: own buttons [message #456134 is a reply to message #456036] |
Wed, 25 May 2005 12:45 |
Eclipse User |
|
|
|
Originally posted by: jennstrinfg.nspamjdrte.org
I'm also interested in that
I tried that at some point but never got it to work, does anybody has
example code (or a link) for a custom button (specially for a
non-rectangle button)?
but first a cup of coffee :-)
Jenny
|
|
|
|
|
Re: own buttons [message #456236 is a reply to message #456188] |
Fri, 27 May 2005 03:51 |
Daniel Spiewak Messages: 263 Registered: July 2009 |
Senior Member |
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font face="serif">If what you're asking requires an actual oval layout
profile (i.e. the shape the layout manager sees the control as), then
no, it isn't possible. My suggestion would be to follow Noname's
advice. Use a gif image, or rather, several gif images, and change
between them based on mouse events. Hint, don't use a Label, use a
Canvas. They may be a little more difficult to handle (in terms of
amount of code needed). However, in my experience, you'll get much
better image painting with a Canvas than a Label, and you'll be able to
control precise image painting and repainting, something you have a lot
less control over with a Label.<br>
<br>
Daniel<br>
<br>
P.S. Canvas <i>is</i> subclassable, and it is just a subclass of
Composite, so you can create Widgets on it.<br>
</font><br>
Sven wrote:
<blockquote cite="middba37380c1af1b03ea6710036353157f$1@www.eclipse.org"
type="cite">that would be an easy way, but that would not work for the
descriped case (oval button)
<br>
<br>
<blockquote type="cite">A "fake" solution is to use a GIF image.
<br>
</blockquote>
<br>
<blockquote type="cite">"Brad Scott" <a class="moz-txt-link-rfc2396E" href="mailto:BradJRScott@yahoo.com"><BradJRScott@yahoo.com></a> a
écrit dans le message de news:
<a class="moz-txt-link-abbreviated" href="mailto:4dc02f5b178a661c10e6981e098d0245$1@www.eclipse.org">4dc02f5b178a661c10e6981e098d0245$1@www.eclipse.org</a>...
<br>
<blockquote type="cite">Hello,
<br>
I was wondering if there is a way to create your own buttons with SWT
(I need an to create an oval one).
<br>
<br>
Thanks,
<br>
Brad
<br>
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
</body>
</html>
|
|
|
Powered by
FUDForum. Page generated in 0.03674 seconds