The borders of composites in Eclipse Form Section can't be paint, help~~~ [message #306457] |
Sun, 30 July 2006 05:33 |
Eclipse User |
|
|
|
Originally posted by: zouzhile.gmail.com
I am programming an Eclipse Form for my editor. Every is going on very
well, except that the border of the composites in the Section instance
cannot be paint, the code is below:
Section section = toolkit.createSection(parent,
Section.DESCRIPTION|Section.TITLE_BAR);
section.setText("section title");
section.setDescription("section description");
section.marginWidth = 10;
section.marginHeight = 5;
//create the client area
Composite client = toolkit.createComposite(section, SWT.WRAP);
client.setLayout(new FillLayout());
Table table= toolkit.createTable(client, SWT.NULL);
table.setLayout(new FillLayout());
toolkit.paintBordersFor(client);
As you see, i called the paintBordersFor() method to pain the borders of
the composite "client". However, the borders are not paint. According to
the article http://www.eclipse.org/articles/Article-Forms/article.html
"Controls like tables, text entries, combo box etc. are rendered with a
flat one-pixel border. These borders do not come from the controls
themselves (SWT.BORDER style is not used). Instead -- if instructed --
the toolkit will add itself as a paint listener to each control's
parent, and draw borders around controls during paint events. To make
this happen, you need to call the toolkit method paintBordersFor(parent)
for each composite where you created controls like text, tree, table
etc. Note that one call per parent is enough: there is no need to make a
call for each control of this type." There are only two valid int values
for the toolkit: SWT.NULL and SWT.BORDER. I tried to set the style to
SWT.NULL(since the article says "SWT.BORDER style is not used"), it
still didn't work.
I have tried a lot and am being headaching over it:(. Please help!
Best Regards
Robin
|
|
|
Powered by
FUDForum. Page generated in 0.26753 seconds