Changeset 212:ab60f3309436 for dwt/custom/PopupList.d
- Timestamp:
- 05/04/08 18:12:38 (7 months ago)
- Files:
-
- dwt/custom/PopupList.d (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/custom/PopupList.d
r155 r212 1 /*******************************************************************************1 /******************************************************************************* 2 2 * Copyright (c) 2000, 2007 IBM Corporation and others. 3 3 * All rights reserved. This program and the accompanying materials … … 30 30 import dwt.widgets.Listener; 31 31 import dwt.widgets.Shell; 32 import dwt.dwthelper.utils; 33 32 34 /** 33 35 * A PopupList is a list of selectable items that appears in its own shell positioned above … … 128 130 * </ul> 129 131 */ 130 public char[][] getItems () {132 public String[] getItems () { 131 133 return list.getItems(); 132 134 } … … 147 149 * @return the text of the selected item or null if no item is selected 148 150 */ 149 public char[]open (Rectangle rect) {151 public String open (Rectangle rect) { 150 152 151 153 Point listSize = list.computeSize (rect.width, DWT.DEFAULT, false); … … 195 197 } 196 198 197 char[]result = null;199 String result = null; 198 200 if (!shell.isDisposed ()) { 199 char[][] strings = list.getSelection ();201 String [] strings = list.getSelection (); 200 202 shell.dispose(); 201 203 if (strings.length !is 0) result = strings [0]; … … 204 206 } 205 207 /** 206 * Selects an item with text that starts with specified char[].208 * Selects an item with text that starts with specified String. 207 209 * <p> 208 210 * If the item is not currently selected, it is selected. … … 217 219 * </ul> 218 220 */ 219 public void select( char[]string) {220 char[][] items = list.getItems();221 public void select(String string) { 222 String[] items = list.getItems(); 221 223 222 224 // find the first entry in the list that starts with the … … 270 272 * </ul> 271 273 */ 272 public void setItems ( char[][] strings) {274 public void setItems (String[] strings) { 273 275 list.setItems(strings); 274 276 }
