Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Nebula » GridEditor issue
GridEditor issue [message #563856] Fri, 11 August 2006 06:10
remi is currently offline remi
Messages: 9
Registered: July 2009
Junior Member
Hi,

just a little question about using GridEditor class in my program.

I write the following code:

final Grid grid = new Grid(top, SWT.BORDER);
grid.setLinesVisible (true);

for (int i=0; i<3; i++) {
GridColumn column = new GridColumn(grid,
SWT.NONE);
column.setWidth (100);
}
GridItem [] items = grid.getItems ();
for (int i=0; i<items.length; i++) {
GridEditor editor = new GridEditor (grid);
CCombo combo = new CCombo (grid, SWT.NONE);
combo.setText("CCombo");
combo.add("item 1");
combo.add("item 2");
editor.minimumWidth = 50;
//editor.grabHorizontal = true;

editor.setEditor(combo, items[i], 0);

editor = new GridEditor (grid);
Text text = new Text (grid, SWT.NONE);
text.setText("Text");
editor.grabHorizontal = true;
editor.setEditor(text, items[i], 1);

editor = new GridEditor (grid);
Button button = new Button (grid, SWT.CHECK);
button.pack ();
editor.minimumWidth = button.getSize ().x;
editor.horizontalAlignment = SWT.LEFT;
editor.setEditor (button, items[i], 2);
}

The goal is just to display a 12*3 nebula Grid with:
CCombo in column 1
Text in column 2
Button in column 3

This part of code is largely inspired from TableEditor creation javadoc
but the result is not the same as with the TableEditor:
The Grid is fullfilled with a signe big CCombo.... It seems that the combo
is inserted into Grid layout and overlaps any others Grid cells.

Could someone help?
Thanks in advance.
Previous Topic:Old SWTPlus demos
Next Topic:column visibility
Goto Forum:
  


Current Time: Thu Jul 24 23:45:42 EDT 2014

Powered by FUDForum. Page generated in 0.01421 seconds