Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » own buttons
own buttons [message #455988] Tue, 24 May 2005 15:37 Go to next message
Eclipse UserFriend
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 #456036 is a reply to message #455988] Tue, 24 May 2005 18:03 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel SpiewakFriend
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">You will have to create a custom widget.  Probably
the best way to do this is by subclassing Canvas.  The button will
obviously be non-native and platform independent.  Do note that buttons
<i>are </i>oval on MacOS X.<br>
<br>
Daniel<br>
</font><br>
Brad Scott wrote:
<blockquote cite="mid4dc02f5b178a661c10e6981e098d0245$1@www.eclipse.org"
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>
</body>
</html>
Re: own buttons [message #456134 is a reply to message #456036] Wed, 25 May 2005 12:45 Go to previous messageGo to next message
Eclipse UserFriend
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 #456186 is a reply to message #455988] Thu, 26 May 2005 10:31 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: noname.noname.com

A "fake" solution is to use a GIF image.

"Brad Scott" <BradJRScott@yahoo.com> a
Re: own buttons [message #456188 is a reply to message #456186] Thu, 26 May 2005 12:07 Go to previous messageGo to next message
Sven  is currently offline Sven Friend
Messages: 11
Registered: July 2009
Junior Member
that would be an easy way, but that would not work for the descriped case
(oval button)

> A "fake" solution is to use a GIF image.

> "Brad Scott" <BradJRScott@yahoo.com> a écrit dans le message de news:
> 4dc02f5b178a661c10e6981e098d0245$1@www.eclipse.org...
>> 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 #456236 is a reply to message #456188] Fri, 27 May 2005 03:51 Go to previous message
Daniel Spiewak is currently offline Daniel SpiewakFriend
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">&lt;BradJRScott@yahoo.com&gt;</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>
Previous Topic:Help on achieving the shell to look like the below
Next Topic:Question: Location changes on the Browser widget
Goto Forum:
  


Current Time: Thu Apr 25 10:20:10 GMT 2024

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

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

Back to the top