|
|
|
|
|
Re: Combo box [message #666348 is a reply to message #665555] |
Wed, 20 April 2011 04:54 |
Madhushree S Messages: 20 Registered: September 2010 |
Junior Member |
|
|
final Label l1= toolkit.createLabel(composite,
"C1");
final CCombo c1= new CCombo(composite,
SWT.DROP_DOWN | SWT.BORDER);
c1.setItems(new String[] { "A", "B" });
final GridData gridData = new GridData(SWT.FILL, SWT.CENTER,
true, false, 1, 1);
c1.setLayoutData(gridData);
final Label l2= toolkit.createLabel(composite,
"C2");
final CCombo c2 = new CCombo(composite, SWT.DROP_DOWN
| SWT.BORDER);
final GridData gd = new GridData(SWT.FILL, SWT.CENTER, true, false, 1,
1);
c2.setLayoutData(gd);
Label l3= toolkit.createLabel(composite,
"C3");
CCombo c3 = new CCombo(composite, SWT.DROP_DOWN
| SWT.BORDER);
final GridData objgd = new GridData(SWT.FILL, SWT.CENTER,
true, false, 1, 1);
c3.setLayoutData(objgd);
c1.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
selectedText = c1.getText();
if (selectedText.equalsIgnoreCase("A")) {
gd.exclude = true;
l2.setVisible(false);
c2.setVisible(false);
composite.layout(true);
With the above snippet, the layout is not proper.
Label appears in one line and drop down in the next line. should i recreate the composite?
[Updated on: Wed, 20 April 2011 07:43] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.03683 seconds