Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Rounded section and CCombo controls
Rounded section and CCombo controls [message #328109] Wed, 14 May 2008 10:04 Go to next message
Eclipse UserFriend
Originally posted by: abirami.rm.gmail.com

I'm using a form Section control(org.eclipse.ui.forms.widgets.Section)
and I'd like all the edges to be rounded.When I look at the
implementation of the Section class,it looks like I'd have to end up
creating a new Section class to achieve this.(There are no APIs that
would let me achieve this)

Similarly,I'd like the combo that I use in the title bar of this section
control to have rounded edges too.

Is there some way I could do this without writing my own controls?

Thanks,
Abirami
Re: Rounded section and CCombo controls [message #328123 is a reply to message #328109] Wed, 14 May 2008 15:44 Go to previous messageGo to next message
Wayne Beaton is currently offline Wayne BeatonFriend
Messages: 554
Registered: December 2017
Senior Member
There are some alternative section/group widgets in Nebula that might do
what you need.

http://www.eclipse.org/nebula

FWIW, the comboboxes in my applications are all rounded. I use the
standard (out-of-the-box) theme on Ubuntu. By design, SWT widgets are
the very same widgets provided by the OS, so they naturally take on the
native appearance.

Good luck,

Wayne

On Wed, 2008-05-14 at 15:34 +0530, Abirami wrote:
> I'm using a form Section control(org.eclipse.ui.forms.widgets.Section)
> and I'd like all the edges to be rounded.When I look at the
> implementation of the Section class,it looks like I'd have to end up
> creating a new Section class to achieve this.(There are no APIs that
> would let me achieve this)
>
> Similarly,I'd like the combo that I use in the title bar of this section
> control to have rounded edges too.
>
> Is there some way I could do this without writing my own controls?
>
> Thanks,
> Abirami
Re: Rounded section and CCombo controls [message #328322 is a reply to message #328123] Wed, 21 May 2008 15:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: abirami.rm.gmail.com

Wayne Beaton wrote:
> There are some alternative section/group widgets in Nebula that might do
> what you need.
>
> http://www.eclipse.org/nebula
>
> FWIW, the comboboxes in my applications are all rounded. I use the
> standard (out-of-the-box) theme on Ubuntu. By design, SWT widgets are
> the very same widgets provided by the OS, so they naturally take on the
> native appearance.
>
> Good luck,
>
> Wayne
>
> On Wed, 2008-05-14 at 15:34 +0530, Abirami wrote:
>> I'm using a form Section control(org.eclipse.ui.forms.widgets.Section)
>> and I'd like all the edges to be rounded.When I look at the
>> implementation of the Section class,it looks like I'd have to end up
>> creating a new Section class to achieve this.(There are no APIs that
>> would let me achieve this)
>>
>> Similarly,I'd like the combo that I use in the title bar of this section
>> control to have rounded edges too.
>>
>> Is there some way I could do this without writing my own controls?
>>
>> Thanks,
>> Abirami
>
Thanks Wayne.

What I was trying to mean with respect to the combo box was,let's say I
needed to have greater styling and theming control over how the control
is drawn(the background color of the arrow in a combo box button,the
arrow color itself etc,this not being provided by the API),then I would
need to create a custom control,wouldn't I?

In that case,do you have an idea as to which section of the CCombo class
I should to be looking at?I'm clueless as to where the control is
actually painted.I suppose it's not as easy as telling GC to draw a
roundedrectangle where it's drawing an ordinary one,but I'd like to know
where I could start.

Thanks,
Abirami
Re: Rounded section and CCombo controls [message #328333 is a reply to message #328322] Wed, 21 May 2008 17:00 Go to previous message
Eclipse UserFriend
Originally posted by: eclipse-news.rizzoweb.com

Abirami wrote:
> Wayne Beaton wrote:
>> There are some alternative section/group widgets in Nebula that might do
>> what you need.
>> http://www.eclipse.org/nebula
>>
>> FWIW, the comboboxes in my applications are all rounded. I use the
>> standard (out-of-the-box) theme on Ubuntu. By design, SWT widgets are
>> the very same widgets provided by the OS, so they naturally take on the
>> native appearance.
>>
>> Good luck,
>>
>> Wayne
>>
>> On Wed, 2008-05-14 at 15:34 +0530, Abirami wrote:
>>> I'm using a form Section
>>> control(org.eclipse.ui.forms.widgets.Section) and I'd like all the
>>> edges to be rounded.When I look at the implementation of the Section
>>> class,it looks like I'd have to end up creating a new Section class
>>> to achieve this.(There are no APIs that would let me achieve this)
>>>
>>> Similarly,I'd like the combo that I use in the title bar of this
>>> section control to have rounded edges too.
>>>
>>> Is there some way I could do this without writing my own controls?
>>>
>>> Thanks,
>>> Abirami
>>
> Thanks Wayne.
>
> What I was trying to mean with respect to the combo box was,let's say I
> needed to have greater styling and theming control over how the control
> is drawn(the background color of the arrow in a combo box button,the
> arrow color itself etc,this not being provided by the API),then I would
> need to create a custom control,wouldn't I?
>
> In that case,do you have an idea as to which section of the CCombo class
> I should to be looking at?I'm clueless as to where the control is
> actually painted.I suppose it's not as easy as telling GC to draw a
> roundedrectangle where it's drawing an ordinary one,but I'd like to know
> where I could start.

Wayne was trying to tell you that, in general, SWT widgets do NOT draw
themselves. That is the fundamental difference between SWT and
AWT/Swing: SWT uses native widgets as much as possible, whereas AWT and
Swing draw their own widgets.
It is possible to draw your own widgets (by subclassing
org.eclipse.swt.widgets.Canvas) but that is discouraged because it would
violate the native look-and-feel philosophy of SWT. Even CCombo, which
is not a native drop-down widget, is just a Composite of a Text, a List,
and a Button, all of which are native (drawn by the OS). So there is no
easy hook where you can override the drawing - it's in native code.

Hope this helps,
Eric
Previous Topic:Biggest Eclipse bug still exist! PC reinstall + clean install = STILL!
Next Topic:workbench hangs after first execution
Goto Forum:
  


Current Time: Sat Jul 27 12:54:16 GMT 2024

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

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

Back to the top