Hi
I have a problem with SWT if I exchange the default tree node
appearance with a customized one.
In my case i add a composite to the node which holds a combo box and
some additional textfields.
TreeEditor editor = new TreeEditor(tree);
editor.horizontalAlignment = SWT.LEFT;
editor.grabHorizontal = true;
FieldPanel fieldp = new FieldPanel(tree,0,field);
// FieldPanel is a composite and holds the combo box
editor.setEditor (fieldp, item);
item.setData(editor);
So far so good everything appears normal.
The problem is that the combo box displays only the first letter of
the holding value.
If selected it displays the complete value.
For example:
The values are 'ABC' and 'DEF' the display without selection is just
'A' or just 'D'.
// the code inside the Fieldpanel ...
CCombo cbo = new CCombo(this, SWT.FLAT | SWT.DROP_DOWN);
cbo.setItems(new String [] {"ABC","DEF"});
cbo.setTextLimit(20);
cbo.setSize(30, 20);
cbo.setEditable(false);
I wonder what i am doing wrong here ...
in case this is a known bug, is there any work-around?
Thanks for your help
teschner@gmail.com - 21 Nov 2007 12:47 GMT
On Nov 21, 10:46 am, tesch...@gmail.com wrote:
> Hi
>
[quoted text clipped - 35 lines]
>
> Thanks for your help
I found the bug:
if I remove the cbo.setSize(..) the complete data is displayed ...
really strange behavior in opinion but whatever, a set size shouldn't
have influence on the displayed content at all!