Changeset 238:380bad9f6852 for dwt/widgets/DirectoryDialog.d
- Timestamp:
- 05/04/08 18:42:55 (4 years ago)
- Files:
-
- dwt/widgets/DirectoryDialog.d (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/widgets/DirectoryDialog.d
r126 r238 12 12 *******************************************************************************/ 13 13 module dwt.widgets.DirectoryDialog; 14 15 import dwt.dwthelper.utils; 14 16 15 17 … … 41 43 */ 42 44 public class DirectoryDialog : Dialog { 43 char[]message = "", filterPath = "";44 static const char[]SEPARATOR = tango.io.FileConst.FileConst.PathSeparatorString;;45 String message = "", filterPath = ""; 46 static const String SEPARATOR = tango.io.FileConst.FileConst.PathSeparatorString;; 45 47 46 48 /** … … 96 98 * @see #setFilterPath 97 99 */ 98 public char[]getFilterPath () {100 public String getFilterPath () { 99 101 return filterPath; 100 102 } … … 106 108 * @return the message 107 109 */ 108 public char[]getMessage () {110 public String getMessage () { 109 111 return message; 110 112 } … … 121 123 * </ul> 122 124 */ 123 public char[]open () {125 public String open () { 124 126 bool useChooserDialog = OS.GTK_VERSION >= OS.buildVERSION (2, 4, 10); 125 127 if (useChooserDialog) { … … 129 131 } 130 132 } 131 char[]openChooserDialog () {133 String openChooserDialog () { 132 134 char* titleBytes = tango.stdc.stringz.toStringz(title); 133 135 auto shellHandle = parent.topHandle (); … … 144 146 } 145 147 if (filterPath !is null && filterPath.length > 0) { 146 char[]p;148 String p; 147 149 /* filename must be a full path */ 148 150 if ( filterPath[ 0 .. SEPARATOR.length ] != SEPARATOR ) { … … 167 169 OS.gtk_file_chooser_set_extra_widget (handle, box); 168 170 } 169 char[]answer = null;171 String answer = null; 170 172 Display display = parent !is null ? parent.getDisplay (): Display.getCurrent (); 171 173 display.addIdleProc (); … … 188 190 return answer; 189 191 } 190 char[]openClassicDialog () {192 String openClassicDialog () { 191 193 char* titleBytes = tango.stdc.stringz.toStringz(title); 192 194 auto handle = OS.gtk_file_selection_new (titleBytes); … … 200 202 } 201 203 } 202 char[]answer = null;204 String answer = null; 203 205 if (filterPath !is null) { 204 char[]path = filterPath;206 String path = filterPath; 205 207 if (path.length > 0 && path[ $-1 .. $ ] != SEPARATOR ) { 206 208 path ~= SEPARATOR; … … 232 234 char* utf8Ptr = OS.g_filename_to_utf8 (fileNamePtr, -1, null, &items_written, null); 233 235 if (utf8Ptr !is null) { 234 char[]osAnswer = utf8Ptr[ 0 .. items_written ];236 String osAnswer = utf8Ptr[ 0 .. items_written ]; 235 237 if (osAnswer.length !is 0) { 236 238 /* remove trailing separator, unless root directory */ … … 260 262 * @param string the filter path 261 263 */ 262 public void setFilterPath ( char[]string) {264 public void setFilterPath (String string) { 263 265 filterPath = string.dup; 264 266 } … … 274 276 * </ul> 275 277 */ 276 public void setMessage ( char[]string) {278 public void setMessage (String string) { 277 279 if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 278 280 message = string.dup;
