[FormToolkit] Defining TableWrapData width [message #467357] |
Mon, 30 January 2006 05:36  |
Eclipse User |
|
|
|
Originally posted by: alexixlebaulois.yahoo.fr
Hi,
Does anybody know how to define TableWrapData width (I want to obtain fixed width cells). I have tried "maxWidth" method but it's not what I'm looking for. Thank you for your help...
Alexis
|
|
|
|
|
|
|
|
|
Re: [FormToolkit] Defining TableWrapData width [message #467454 is a reply to message #467450] |
Tue, 31 January 2006 11:51  |
Eclipse User |
|
|
|
From the forms article:
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.
The Form toolkit knows which controls require a custom border. However,
you may create a new one that also needs a border that is not on the list.
You can give a hint to the toolkit by adding the following code:
Control myControl = new MyControl(parent);
myControl.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
// or myControl.setData(FormToolkit.KEY_DRAW_BORDER,
FormToolkit.TREE_BORDER);
toolkit.paintBordersFor(parent);
As you can see from the picture above, 'structural' controls like trees
and tables have a border style different from text areas and you can
choose which one to render for your control. Note that this is not needed
for controls created using toolkit's factory methods.
-----------------
SWT.BORDER was a wrong trail but it worked for me nevertheless. As of the
size the tree try to "FILL" every parent container. But as I said I havent
used the FormToolkit much myself so I stop talking now.
Ricky
|
|
|
Powered by
FUDForum. Page generated in 0.05387 seconds