Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.gui > #2800

SWT change Tree Node beha

From "teschner" <teschner@THRWHITE.remove-dii-this>
Subject SWT change Tree Node beha
Message-ID <3c80d959-1ac8-409d-bddb-e0c77ae904e9@v4g2000hsf.googlegroups.com> (permalink)
Newsgroups comp.lang.java.gui
Date 2011-04-27 15:41 +0000
Organization TDS.net

Show all headers | View raw


  To: comp.lang.java.gui
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

---
 * Synchronet * The Whitehouse BBS --- whitehouse.hulds.com --- check it out free usenet!
--- Synchronet 3.15a-Win32 NewsLink 1.92
Time Warp of the Future BBS - telnet://time.synchro.net:24

Back to comp.lang.java.gui | Previous | Next | Find similar | Unroll thread


Thread

SWT change Tree Node beha "teschner" <teschner@THRWHITE.remove-dii-this> - 2011-04-27 15:41 +0000

csiph-web