comparison dwt/custom/TreeEditor.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
47 * // Clean up any previous editor control 47 * // Clean up any previous editor control
48 * Control oldEditor = editor.getEditor(); 48 * Control oldEditor = editor.getEditor();
49 * if (oldEditor !is null) oldEditor.dispose(); 49 * if (oldEditor !is null) oldEditor.dispose();
50 * 50 *
51 * // Identify the selected row 51 * // Identify the selected row
52 * TreeItem item = (TreeItem)e.item; 52 * TreeItem item = cast(TreeItem)e.item;
53 * if (item is null) return; 53 * if (item is null) return;
54 * 54 *
55 * // The control that will be the editor must be a child of the Tree 55 * // The control that will be the editor must be a child of the Tree
56 * Text newEditor = new Text(tree, DWT.NONE); 56 * Text newEditor = new Text(tree, DWT.NONE);
57 * newEditor.setText(item.getText()); 57 * newEditor.setText(item.getText());
58 * newEditor.addModifyListener(new ModifyListener() { 58 * newEditor.addModifyListener(new ModifyListener() {
59 * public void modifyText(ModifyEvent e) { 59 * public void modifyText(ModifyEvent e) {
60 * Text text = (Text)editor.getEditor(); 60 * Text text = cast(Text)editor.getEditor();
61 * editor.getItem().setText(text.getText()); 61 * editor.getItem().setText(text.getText());
62 * } 62 * }
63 * }); 63 * });
64 * newEditor.selectAll(); 64 * newEditor.selectAll();
65 * newEditor.setFocus(); 65 * newEditor.setFocus();