[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[news.eclipse.platform.swt] Re: "Flat" widgets

Geoff,

It's best to not use internal classes like this.  Given the utility-like
nature of it, it should be easy for you to look at what it's doing and
copy small pieces for your own use.  In glancing at it, this class
essentially just creates swt widgets with certain style bits.  If you're
using its #paintBorders method then its contained BorderPainter inner
class is probably the most interesting part.

Grant


Geoff Gibbs wrote:

> Geoff Gibbs wrote:
> > How do I get my widgets to appear 'flat' like the ones used in eclipse?
> > 
> > I've tried using the FormWidgetFactory but I don't really know how.

> I've worked it out. For anyone else who wants to know:

> If you tell FormWidgetFactory to paint the borders for a Composite, it 
> will paint the borders of all of the composites children.
> For example:
>    FormWidgetFactory fwf = new FormWidgetFactory();
>    Composite page = new Composite(parent, SWT.NONE);
>    fwf.paintBordersFor(page);

>    new Text(page, SWT.NONE);

> The Text widget will be painted with a solid black border.
> Note: If the Text widget is created with SWT.BORDER then two borders 
> will be drawn.


> Geoff