- Timestamp:
- 03/19/07 18:15:51 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/selectfile.pro
r213 r231 1 1 ;+ 2 ; 2 3 ; @file_comments 3 4 ; 4 ;5 5 ; @categories 6 6 ; 7 ;8 7 ; @param EVENT 9 8 ; 10 ;11 9 ; @returns 12 ; 13 ; 10 ; 14 11 ; @uses 15 ; 16 ; 12 ; 17 13 ; @restrictions 18 ; 19 ; 14 ; 20 15 ; @examples 21 ; 22 ; 16 ; 23 17 ; @history 24 ; 25 ; 26 ; @version 18 ; 19 ; @version 27 20 ; $Id$ 28 ; 21 ; 29 22 ; @todo 30 23 ; seb: documenter EVENT 31 24 ;- 32 ; *********************************************************************25 ; 33 26 PRO selectfile_event, event 34 ;35 27 ; 36 28 compile_opt idl2, strictarrsubs … … 48 40 case eventuvalue.name of 49 41 ; cancel button 50 'Global Cancel':BEGIN 42 'Global Cancel':BEGIN 51 43 widget_control, event.handler, get_uvalue = messenger 52 44 *messenger = -1 … … 58 50 filename = isafile(filename = filename[0], /onlync, iodirectory = iodir $ 59 51 , title = 'data file name', /tryfind, /fully_qualify_path) 60 if size(filename, /type) NE 7 then BEGIN 52 if size(filename, /type) NE 7 then BEGIN 61 53 widget_control, event.id, set_value = '' 62 54 return … … 72 64 ; switch automatic/by and mesh definition buttons 73 65 'gridload':BEGIN 74 IF event.select EQ 1 THEN BEGIN 66 IF event.select EQ 1 THEN BEGIN 75 67 widget_control, widget_info(event.handler, find_by_uname = 'argtxt'), set_value = '' 76 68 widget_control, widget_info(event.handler, find_by_uname = 'kwdtxt'), set_value = '' … … 86 78 widget_control, widget_info(event.handler, find_by_uname = 'arg base'), sensitive = 1 87 79 widget_control, widget_info(event.handler, find_by_uname = 'kwdlab'), set_value = 'keywords of IDL procedure:' 88 END 80 END 89 81 ENDCASE 90 ENDIF 82 ENDIF 91 83 END 92 84 ; name of the procedure or batch file … … 97 89 widget_control, event.id, set_value = '' 98 90 return 99 endif 91 endif 100 92 CASE protype(filename) OF 101 93 ; this is a procedure 102 'proc':BEGIN 94 'proc':BEGIN 103 95 widget_control, widget_info(event.handler, find_by_uname = 'arg base'), sensitive = 1 104 96 widget_control, widget_info(event.handler, find_by_uname = 'kwd base'), sensitive = 1 … … 106 98 END 107 99 ; this is a function, this case is not accepted 108 'func':BEGIN 100 'func':BEGIN 109 101 widget_control, event.id, set_value = '' 110 102 return 111 103 END 112 104 ; this is an IDL batch file 113 'batch':BEGIN 105 'batch':BEGIN 114 106 widget_control, widget_info(event.handler, find_by_uname = 'arg base'), sensitive = 0 115 107 widget_control, widget_info(event.handler, find_by_uname = 'kwd base'), sensitive = 0 … … 136 128 datafilename = isafile(filename = datafilename, /tryfind, /onlync $ 137 129 , title = 'data file name', /fully_qualify_path) 138 if size(datafilename, /type) NE 7 then BEGIN 130 if size(datafilename, /type) NE 7 then BEGIN 139 131 widget_control, widget_info(event.handler, find_by_uname = 'datafilename') $ 140 132 , set_value = '' 141 133 return 142 ENDIF 134 ENDIF 143 135 widget_control, widget_info(event.handler, find_by_uname = 'gridload') $ 144 136 , get_value = gridload … … 162 154 widget_control, meshload_id, set_value = '' 163 155 return 164 endif 165 END 156 endif 157 END 166 158 'via initnetcdf':meshload = datafilename 167 159 ENDCASE … … 176 168 return 177 169 end 178 ; *********************************************************************170 ; 179 171 ;+ 172 ; 180 173 ; @file_comments 181 174 ; 182 ;183 175 ; @categories 184 176 ; 185 ;186 177 ; @param DATAFILENAME 187 178 ; … … 192 183 ; @param ARGSPRO 193 184 ; 194 ;195 185 ; @keyword _EXTRA 196 ; Used to pass yourkeywords197 ; 186 ; Used to pass keywords 187 ; 198 188 ; @returns 199 ; 200 ; 189 ; 201 190 ; @uses 202 ; 203 ; 191 ; 204 192 ; @restrictions 205 ; 206 ; 193 ; 207 194 ; @examples 208 ; 209 ; 195 ; 210 196 ; @history 211 ; 212 ; 213 ; @version 197 ; 198 ; @version 214 199 ; $Id$ 215 ; 200 ; 216 201 ; @todo 217 202 ; seb: documenter les params 218 ; 203 ; 219 204 ;- 220 205 FUNCTION selectfile, datafilename, idlfile, argspro, _extra = ex … … 224 209 ; 225 210 @common 226 ;------------------------------------------------------------ 227 ;------------------------------------------------------------ 228 ; 229 ; We create a pointer in the uvalue to recuperate answers at setted 230 ; questions atthe time of the use of this widget. So when the widget 231 ; is deleted in the procedure ...event.pro, the variable on which the 232 ; pointer pointed (contained in the uvalue of the widget) is not 211 ; 212 ; We create a pointer in the uvalue to recuperate answers at setted 213 ; questions atthe time of the use of this widget. So when the widget 214 ; is deleted in the procedure ...event.pro, the variable on which the 215 ; pointer pointed (contained in the uvalue of the widget) is not 233 216 ; deleted and we can recuperate the result! 234 217 ; … … 269 252 270 253 ;------------------------------------------------------------ 271 IF n_elements(datafilename) NE 0 THEN BEGIN 254 IF n_elements(datafilename) NE 0 THEN BEGIN 272 255 widget_control, database, set_value = datafilename 273 256 selectfile_event, {ID:database, TOP:base, HANDLER:base} 274 ENDIF 275 IF n_elements(idlfile) NE 0 THEN BEGIN 257 ENDIF 258 IF n_elements(idlfile) NE 0 THEN BEGIN 276 259 widget_control, basemeshload, set_value = idlfile 277 260 selectfile_event, {ID:basemeshload, TOP:base, HANDLER:base} 278 261 widget_control, basemeshload, get_value = idlfile2 279 262 IF idlfile2[0] NE '' THEN widget_control, gdldid, set_value = 1 280 ENDIF 263 ENDIF 281 264 IF n_elements(argspro) NE 0 THEN widget_control, argbase, set_value = argspro 282 265 ;------------------------------------------------------------ 283 IF n_elements(datafilename) EQ 0 THEN BEGIN 266 IF n_elements(datafilename) EQ 0 THEN BEGIN 284 267 widget_control, base, /realize 285 268 xmanager, 'selectfile', base, event_handler = 'selectfile_event', no_block = 0 … … 302 285 if size(res3, /type) NE 8 then return, -1 303 286 304 return, {fileparameters:res3, readparameters:ccreadparameters, meshparameters:ccmeshparameters} 287 return, {fileparameters:res3, readparameters:ccreadparameters, meshparameters:ccmeshparameters} 305 288 end
Note: See TracChangeset
for help on using the changeset viewer.