GridEditor issue [message #563856] |
Fri, 11 August 2006 10:10 |
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03654 seconds