comparison dwt/custom/TableEditor.d @ 7:e831403a80a9

Add 'cast' to casts
author Frank Benoit <benoit@tionex.de>
date Wed, 27 Aug 2008 14:30:35 +0200
parents 1a8b3cb347e0
children 6337764516f1
comparison
equal deleted inserted replaced
6:b903c16b6f48 7:e831403a80a9
49 * // Clean up any previous editor control 49 * // Clean up any previous editor control
50 * Control oldEditor = editor.getEditor(); 50 * Control oldEditor = editor.getEditor();
51 * if (oldEditor !is null) oldEditor.dispose(); 51 * if (oldEditor !is null) oldEditor.dispose();
52 * 52 *
53 * // Identify the selected row 53 * // Identify the selected row
54 * TableItem item = (TableItem)e.item; 54 * TableItem item = cast(TableItem)e.item;
55 * if (item is null) return; 55 * if (item is null) return;
56 * 56 *
57 * // The control that will be the editor must be a child of the Table 57 * // The control that will be the editor must be a child of the Table
58 * Text newEditor = new Text(table, DWT.NONE); 58 * Text newEditor = new Text(table, DWT.NONE);
59 * newEditor.setText(item.getText(EDITABLECOLUMN)); 59 * newEditor.setText(item.getText(EDITABLECOLUMN));
60 * newEditor.addModifyListener(new ModifyListener() { 60 * newEditor.addModifyListener(new ModifyListener() {
61 * public void modifyText(ModifyEvent e) { 61 * public void modifyText(ModifyEvent e) {
62 * Text text = (Text)editor.getEditor(); 62 * Text text = cast(Text)editor.getEditor();
63 * editor.getItem().setText(EDITABLECOLUMN, text.getText()); 63 * editor.getItem().setText(EDITABLECOLUMN, text.getText());
64 * } 64 * }
65 * }); 65 * });
66 * newEditor.selectAll(); 66 * newEditor.selectAll();
67 * newEditor.setFocus(); 67 * newEditor.setFocus();