Changeset 226 for trunk/SRC/ToBeReviewed/WIDGET
- Timestamp:
- 03/16/07 10:22:26 (17 years ago)
- Location:
- trunk/SRC/ToBeReviewed/WIDGET
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/buildcmd.pro
r172 r226 5 5 ; 6 6 ; @file_comments 7 ; This function send back a string which contain the reading command 7 ; This function send back a string which contain the reading command 8 8 ; and drawing's parameters. 9 9 ; … … 11 11 ; 12 12 ; @keyword BOXZOOM 13 ; Vector indicating the geographic zone on which we want to cut the map. 14 ; If BOXZOOM has : 13 ; Vector indicating the geographic zone on which we want to cut the map. 14 ; If BOXZOOM has : 15 15 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 16 16 ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 17 17 ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 18 18 ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 19 ; 6 elements: The extraction is made on Boxzoom 19 ; 6 elements: The extraction is made on Boxzoom 20 20 ; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 21 21 ; … … 54 54 numdessinout = smallout[2]-1 55 55 ; 56 options = extractatt(top_uvalue, 'options') 56 options = extractatt(top_uvalue, 'options') 57 57 optionsflag = extractatt(top_uvalue, 'optionsflag') 58 58 portrait = (strtrim(optionsflag[where(options EQ 'Portrait/Landscape'), 0], 1))[0] … … 83 83 ; Search of options 84 84 ; 85 options = extractatt(top_uvalue, 'options') 85 options = extractatt(top_uvalue, 'options') 86 86 optionsflag = extractatt(top_uvalue, 'optionsflag') 87 87 flags = optionsflag[*, numdessinin] … … 133 133 widcmd = strtrim(widcmd, 2) 134 134 IF widcmd[0] EQ '' THEN widcmd = 'zzz' 135 135 136 136 cutcmd, widcmd[0], toread, numberofread, prefix, nameexp, ending 137 137 ; … … 158 158 ; we complet the reading command 159 159 oldrdcmd = extractatt(top_uvalue, 'currentreadcmd') 160 nl = n_elements(oldrdcmd) 160 nl = n_elements(oldrdcmd) 161 161 oldrdcmd[nl-1] = oldrdcmd[nl-1] + ' $' 162 162 readcmd[i] = prefix + readcmd[i] … … 164 164 ENDELSE 165 165 ; exit if we have to read other fields... 166 if alreadyread+1 NE numberofread-1 THEN BEGIN 166 if alreadyread+1 NE numberofread-1 THEN BEGIN 167 167 *top_uvalue[1, findline(top_uvalue, 'currentreadcmd')] = readcmd 168 168 *top_uvalue[1, findline(top_uvalue, 'alreadyread')] = alreadyread+1 … … 171 171 ENDIF 172 172 ; we finalize the reading command 173 IF ending NE '' THEN BEGIN 174 nl = n_elements(readcmd) 173 IF ending NE '' THEN BEGIN 174 nl = n_elements(readcmd) 175 175 readcmd[nl-1] = readcmd[nl-1] + ' $' 176 176 readcmd = [temporary(readcmd), ending] … … 186 186 tgnm = strlowcase(tag_names(exextra)) 187 187 indtmp = where(tgnm EQ 'box' OR tgnm EQ 'boxzoom', cnt) 188 IF cnt EQ 1 THEN BEGIN 188 IF cnt EQ 1 THEN BEGIN 189 189 boxextra = exextra.(indtmp[0]) 190 190 exextra = extractstru(exextra, ['box', 'boxzoom']) 191 ENDIF 191 ENDIF 192 192 extra = mixstru(exextra, extra) 193 193 sextra = struct2string(extra) … … 214 214 'vector':BEGIN 215 215 ; for the vectors, there is 2 components. we read u when alreadyvector 216 ; is a inte rger and v when alreadyvector is a interger+0.5216 ; is a integer and v when alreadyvector is a integer+0.5 217 217 if floor(alreadyvector)+1 EQ 0 then begin 218 218 if floor(alreadyvector) EQ alreadyvector then begin … … 226 226 ENDIF ELSE BEGIN 227 227 oldrdcmd = extractatt(top_uvalue, 'currentreadcmd') 228 nl = n_elements(oldrdcmd) 228 nl = n_elements(oldrdcmd) 229 229 oldrdcmd[nl-1] = oldrdcmd[nl-1] + ' $' 230 230 readcmd[i] = prefix + readcmd[i] … … 235 235 numberofread-1:BEGIN 236 236 ; we finalize the reading command 237 IF ending NE '' THEN BEGIN 238 nl = n_elements(readcmd) 237 IF ending NE '' THEN BEGIN 238 nl = n_elements(readcmd) 239 239 readcmd[nl-1] = readcmd[nl-1] + ' $' 240 240 readcmd = [temporary(readcmd), ending] … … 252 252 numberofread-0.5:BEGIN 253 253 ; we finalize the reading command 254 IF ending NE '' THEN BEGIN 255 nl = n_elements(readcmd) 254 IF ending NE '' THEN BEGIN 255 nl = n_elements(readcmd) 256 256 readcmd[nl-1] = readcmd[nl-1] + ' $' 257 257 readcmd = [temporary(readcmd), ending] … … 301 301 ENDIF ELSE BEGIN 302 302 oldrdcmd = extractatt(top_uvalue, 'currentreadcmd') 303 nl = n_elements(oldrdcmd) 303 nl = n_elements(oldrdcmd) 304 304 oldrdcmd[nl-1] = oldrdcmd[nl-1] + ' $' 305 305 readcmd[i] = prefix + readcmd[i] … … 307 307 ENDELSE 308 308 ; 309 if alreadyover+1 NE numberofread-1 THEN BEGIN 309 if alreadyover+1 NE numberofread-1 THEN BEGIN 310 310 ; we still need to read some files... 311 311 *top_uvalue[1, findline(top_uvalue, 'currentreadcmd')] = readcmd … … 315 315 ENDIF 316 316 ; we finalize the reading command 317 IF ending NE '' THEN BEGIN 318 nl = n_elements(readcmd) 317 IF ending NE '' THEN BEGIN 318 nl = n_elements(readcmd) 319 319 readcmd[nl-1] = readcmd[nl-1] + ' $' 320 320 readcmd = [temporary(readcmd), ending] … … 362 362 ; For [plots in z, box must have by default 0,profmax 363 363 if strpos(type, 'z') NE -1 then BEGIN 364 ; If more than 1 level is selected: 364 ; If more than 1 level is selected: 365 365 widget_control, widget_info(base, find_by_uname = 'dthlv1'), get_value = niv1 366 366 niv1 = niv1.combobox_index -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/identifyclick.pro
r150 r226 85 85 ; t/3/0 End of the double click 86 86 thisEvent EQ 'WIDGET_TIMER' AND uval.click EQ 3 AND press EQ 0:uval.click = 0 87 ; Impos ible case in theory:87 ; Impossible case in theory: 88 88 ELSE:BEGIN 89 89 print, thisEvent, uval.click, press -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/scanfile.pro
r221 r226 5 5 ; @categories 6 6 ; 7 ; 7 ; 8 8 ; @param NAMEFILE 9 9 ; 10 ;11 10 ; @keyword GRID {default='T'}{type=scalar string} 12 11 ; Used to specify on which grid type are located the data … … 14 13 ; @keyword _EXTRA 15 14 ; Used to pass your keywords to isafile and ncdf_getaxis 16 ; 15 ; 17 16 ; @returns 18 ; 19 ; 17 ; 20 18 ; @uses 21 ; 22 ; 19 ; 23 20 ; @restrictions 24 ; 25 ; 21 ; 26 22 ; @examples 27 ; 28 ; 23 ; 29 24 ; @history 30 ; 31 ; 32 ; @version 25 ; 26 ; @version 33 27 ; $Id$ 34 28 ; 35 29 ; @todo 36 30 ; seb : I don't know what to do with that... 37 ; 31 ; 38 32 ;- 39 33 ; … … 49 43 ; dont les noms sont 'x','lon...','xi_...' et 'y','lat...' ou 50 44 ; 'eta_...' ou bien en majuscule. 51 ; 4) il doit exi ter ds ce fichier une unique variable n''ayant45 ; 4) il doit exister ds ce fichier une unique variable n''ayant 52 46 ; qu''une dimension et etant la dimension temporelle. cette 53 47 ; variable sera prise comme axe des temps. Rq: si plusieurs … … 55 49 ; variable 56 50 ; 5) Cette variable axe des temps doit contenir l''attribut 57 ; 'units' qui doit etre ecrit suivant la syntaxe:58 ; "seconds since 0001-01-01 00:00:00" 59 ; "hours since 0001-01-01 00:00:00" 60 ; "days since 1979-01-01 00:59:59" 61 ; "months since 1979-01-01 00:59:59" 62 ; "years since 1979-01-01 00:59:59" 51 ; 'units' qui doit etre ecrit suivant la syntaxe: 52 ; "seconds since 0001-01-01 00:00:00" 53 ; "hours since 0001-01-01 00:00:00" 54 ; "days since 1979-01-01 00:59:59" 55 ; "months since 1979-01-01 00:59:59" 56 ; "years since 1979-01-01 00:59:59" 63 57 ; 64 58 ; je crois que c''est tout! … … 93 87 namedim = strarr(inside.ndims) 94 88 for dimiq = 0, inside.ndims-1 do begin 95 ncdf_diminq, cdfid, dimiq, tmpname, value 89 ncdf_diminq, cdfid, dimiq, tmpname, value 96 90 namedim[dimiq] = strlowcase(tmpname) 97 91 ENDFOR … … 110 104 (inter(invar.dim, dimidy))[0] NE -1 AND $ 111 105 ((where(invar.dim EQ inside.recdim))[0] NE -1 OR inside.recdim EQ -1) $ 112 THEN namevar[varid] = invar.name 106 THEN namevar[varid] = invar.name 113 107 ENDFOR 114 108 namevar = namevar[where(namevar NE '')] … … 135 129 tmpnm[0] EQ 'xi_u' AND tmpnm[1] EQ 'eta_rho':listgrid[i] = 'U' 136 130 tmpnm[0] EQ 'xi_u' AND tmpnm[1] EQ 'eta_v' :listgrid[i] = 'F' 137 ELSE: 138 ENDCASE 131 ELSE: 132 ENDCASE 139 133 ENDFOR 140 134 empty = where(listgrid EQ '') 141 IF empty[0] NE -1 THEN BEGIN 135 IF empty[0] NE -1 THEN BEGIN 142 136 ; could we define the grid type from the file name?? 143 137 pattern = ['GRID.', 'GRID_', 'GRID', 'UPID_', '30ID_'] … … 153 147 ENDFOR 154 148 listgrid[empty] = vargrid 155 ENDIF 149 ENDIF 156 150 ENDIF ELSE listgrid[*] = vargrid 157 151 ;------------------------------------------------------------ … … 159 153 ;------------------------------------------------------------ 160 154 date0fk = date2jul(19000101) 161 IF inside.recdim EQ -1 THEN BEGIN 155 IF inside.recdim EQ -1 THEN BEGIN 162 156 jpt = 1 163 157 time = date0fk … … 170 164 repeat BEGIN 171 165 IF varid LT inside.nvars THEN BEGIN 172 invar = ncdf_varinq(cdfid, varid) 173 varid = varid+1 166 invar = ncdf_varinq(cdfid, varid) 167 varid = varid+1 174 168 ENDIF ELSE varid = 0 175 169 endrep until (n_elements(invar.dim) EQ 1 AND invar.dim[0] EQ inside.recdim) OR (varid EQ 0) … … 177 171 ; 178 172 CASE 1 OF 179 varid EQ -1:BEGIN 173 varid EQ -1:BEGIN 180 174 dummy = report('the file '+fullname+' has no time axis.!C we create a fake calendar ...') 181 175 fakecal = 1 182 176 time = date0fk + lindgen(1>jpt) 183 177 END 184 invar.natts EQ 0:BEGIN 178 invar.natts EQ 0:BEGIN 185 179 dummy = report('the variable '+invar.name+' has no attribut.!C we create a fake calendar ...') 186 180 fakecal = 1 … … 197 191 fakecal = 1 198 192 time = date0fk + lindgen(1>jpt) 199 ENDIF ELSE BEGIN 193 ENDIF ELSE BEGIN 200 194 ; we read the time axis 201 195 ncdf_varget, cdfid, varid, time … … 223 217 err = 1 224 218 ENDIF 225 IF err GT 0 THEN BEGIN 219 IF err GT 0 THEN BEGIN 226 220 fakecal = 1 227 221 time = date0fk + lindgen(1>jpt) 228 ENDIF ELSE BEGIN 222 ENDIF ELSE BEGIN 229 223 debut = str_sep(mots[2], '-') 230 224 ; … … 241 235 'greg':IF n_elements(key_caltype) EQ 0 THEN key_caltype = 'greg' 242 236 ELSE:BEGIN 243 ; notused = report('Unknown calendar: '+value+', we use greg calendar.') 237 ; notused = report('Unknown calendar: '+value+', we use greg calendar.') 244 238 key_caltype = 'greg' 245 239 END 246 240 ENDCASE 247 241 ENDIF ELSE BEGIN 248 ; notused = report('Unknown calendar, we use '+key_caltype+' calendar.') 242 ; notused = report('Unknown calendar, we use '+key_caltype+' calendar.') 249 243 IF n_elements(key_caltype) EQ 0 THEN key_caltype = 'greg' 250 244 ENDELSE … … 259 253 'hour':time = julday(debut[1], debut[2], debut[0])+time/24.d 260 254 'day':time = julday(debut[1], debut[2], debut[0])+time 261 'month':BEGIN 255 'month':BEGIN 262 256 if total(fix(time) NE time) NE 0 then $ ; we switch to days with 30d/m 263 257 time = julday(debut[1], debut[2], debut[0])+round(time*30) $ -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/xcreateanim.pro
r150 r226 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 ; 18 ; 26 19 ; @version 27 ; $Id$ 28 ; 20 ; $Id$ 21 ; 29 22 ; @todo 30 23 ; seb 31 24 ; 32 25 ;- 33 pro xcreateanim_event, event 26 pro xcreateanim_event, event 34 27 ; 35 28 compile_opt idl2, strictarrsubs … … 61 54 widget_control, widget_info(event.top, find_by_uname = 'debut') $ 62 55 , get_value = vdate1 63 index1 = where(calendar eq date2jul(vdate1)) & index1 = index1[0] 56 index1 = where(calendar eq date2jul(vdate1)) & index1 = index1[0] 64 57 if index1 EQ -1 then return 65 58 ; 66 59 widget_control, widget_info(event.handler, find_by_uname = 'fin') $ 67 60 , get_value = vdate2 68 index2 = where(calendar eq date2jul(vdate2)) & index2 = index2[0] 61 index2 = where(calendar eq date2jul(vdate2)) & index2 = index2[0] 69 62 if index2 EQ -1 OR index2 LE index1 then return 70 63 ; We delete the widget before create the file .ps … … 73 66 ; creation of the routine which will serve us to do the drawing 74 67 ; 75 ; We recuperate the list of instructions 68 ; We recuperate the list of instructions 76 69 globalcommand = extractatt(top_uvalue, 'globalcommand') 77 70 ; We complete by first and last lines of the program … … 113 106 green = green[index] 114 107 blue = blue[index] 115 endif 108 endif 116 109 ; 117 110 if depth gt 8 then $ … … 133 126 IF keyword_set(fakecal) THEN date = ind ELSE date = jul2date(calendar[ind]) 134 127 xxx2ps, /noerase, date1 = date, date2 = date 135 ; 128 ; 136 129 image = tvrd(true = depth GT 8) 137 130 ; … … 142 135 wdelete, !d.window 143 136 ENDFOR 144 ENDIF 137 ENDIF 145 138 ; We put a last white picture 146 139 window, /free, /pixmap, xsize = xsize, ysize = ysize … … 155 148 wdelete, !d.window 156 149 ; File's closing. 157 write_gif, animdir+nomfic, /close 158 widget_control, base, /destroy 150 write_gif, animdir+nomfic, /close 151 widget_control, base, /destroy 159 152 ; Rerock in "normal" mode 160 153 thisOS = strupcase(strmid(!version.os_family, 0, 3)) … … 169 162 endif 170 163 ; 171 164 172 165 return 173 166 end … … 179 172 ; @categories 180 173 ; 181 ; 174 ; 182 175 ; @param PARENT 183 176 ; 184 ; 177 ; 185 178 ; @returns 186 ; 187 ; 179 ; 180 ; 188 181 ; @uses 189 ; 190 ; 182 ; 191 183 ; @restrictions 192 ; 193 ; 184 ; 194 185 ; @examples 195 ; 196 ; 186 ; 197 187 ; @history 198 ; 199 ; 188 ; 200 189 ; @version 201 ; $Id$ 202 ; 190 ; $Id$ 191 ; 203 192 ; @todo 204 193 ; seb … … 229 218 if strtrim(filenames[0], 1) EQ '' then filenames = filenames[1:n_elements(filenames)-1] 230 219 indexfile = (where(filelist EQ filenames[0]))[0] 231 calendar = (*(extractatt(top_uvalue, 'fileparameters'))[indexfile]).time_counter 220 calendar = (*(extractatt(top_uvalue, 'fileparameters'))[indexfile]).time_counter 232 221 key_caltype = (*(extractatt(top_uvalue, 'fileparameters'))[indexfile]).caltype 233 222 fakecal = (*(extractatt(top_uvalue, 'fileparameters'))[indexfile]).fakecal … … 237 226 calendarbis = (*(extractatt(top_uvalue, 'fileparameters'))[indexfilebis]).time_counter 238 227 if n_elements(calendarbis) NE n_elements(calendar) then begin 239 nothing = report(' Les diffrents plots n''utilisent pas le meme calendrier. !C Animation impossible!', /error)228 nothing = report('plots do not use the same calendar. !C Animation impossible!', /error) 240 229 return 241 230 ENDIF 242 231 if total(calendar NE calendarbis) NE 0 then begin 243 nothing = report(' Les diffrents plots n''utilisent pas le meme calendrier. !C Animation impossible!', /error)232 nothing = report('plots do not use the same calendar. !C Animation impossible!', /error) 244 233 return 245 234 endif … … 249 238 ; It is possible to do an animation. 250 239 ; 251 base = widget_base(/column, title = 'animation creation', uvalue = {parent:parent, indexfile:indexfile}) 240 base = widget_base(/column, title = 'animation creation', uvalue = {parent:parent, indexfile:indexfile}) 252 241 rien = widget_label(base, value = 'animation name') 253 242 rien = widget_text(base,value='anim_idl.gif', uname='Filename', /editable) … … 266 255 widget_control,base,/realize 267 256 xmanager,'xcreateanim', base, /no_block 268 257 269 258 return 270 259 end -
trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/xxxmenubar_event.pro
r150 r226 5 5 ; @categories 6 6 ; 7 ; 7 ; 8 8 ; @param EVENT 9 9 ; 10 ;11 10 ; @returns 12 ; 13 ; 11 ; 14 12 ; @uses 15 ; 16 ; 13 ; 17 14 ; @restrictions 18 ; 19 ; 15 ; 20 16 ; @examples 21 ; 22 ; 17 ; 23 18 ; @history 24 ; 25 ; 26 ; @version 19 ; 20 ; @version 27 21 ; $Id$ 28 22 ; 29 ; @todo 23 ; @todo 30 24 ; seb 31 25 ;- … … 39 33 40 34 case event.value of 41 'Open' :begin 35 'Open' :begin 42 36 oldmeshparams = ccmeshparameters 43 37 newfile = selectfile() … … 62 56 ; What is the selected field ? Do we reselect it ? 63 57 fieldname = widget_info(vlstid, /combobox_gettext) 64 index = where(newfile.fileparameters.listvar EQ fieldname) 58 index = where(newfile.fileparameters.listvar EQ fieldname) 65 59 widget_control, vlstid, set_value = newfile.fileparameters.listvar 66 60 widget_control, vlstid, set_combobox_select = 0 > index[0] … … 117 111 xxx, CALLERWIDID = event.top, _extra = extra 118 112 end 119 'Quit':begin 113 'Quit':begin 120 114 widget_control, event.top, get_uvalue = top_uvalue 121 115 ptr_free, extractatt(top_uvalue, 'exextra') … … 142 136 , /POSTSCRIPT 143 137 END 144 'Animated gif' :begin 138 'Animated gif' :begin 145 139 IF float(strmid(!version.release,0,3)) GE 6.2 THEN xcreateanim, event.top 146 140 end … … 174 168 widget_control, event.top, get_uvalue = top_uvalue 175 169 ; portrait or landscape ??? 176 options = extractatt(top_uvalue, 'options') 170 options = extractatt(top_uvalue, 'options') 177 171 optionsflag = extractatt(top_uvalue, 'optionsflag') 178 172 portrait = (optionsflag[where(options EQ 'Portrait/Landscape'), 0])[0] … … 203 197 ENDIF 204 198 ; We recuperate the name of the file 205 filename = xquestion(' dans quel fichier bianire voulez vous sauver le widget ?', 'xxx_widget.dat')199 filename = xquestion('In which binary file do you want to save the widget ?', 'xxx_widget.dat') 206 200 ; We complete it by a .dat 207 201 if rstrpos(filename, '.dat') NE strlen(filename)-4 then filename = filename+'.dat' … … 219 213 for i = 0, n_elements(commande)-1 do print, commande[i] 220 214 end 221 'Portrait/Landscape' :begin 215 'Portrait/Landscape' :begin 222 216 widget_control, event.top, get_uvalue = top_uvalue 223 217 options = extractatt(top_uvalue, 'options') … … 255 249 ENDELSE 256 250 end 257 'Overlay' :begin 251 'Overlay' :begin 258 252 widget_control, event.top, get_uvalue = top_uvalue 259 253 numdessinin = (extractatt(top_uvalue, 'smallin'))[2]-1 260 options = extractatt(top_uvalue, 'options') 254 options = extractatt(top_uvalue, 'options') 261 255 flags = extractatt(top_uvalue, 'optionsflag') 262 256 index = where(options EQ 'Overlay') … … 269 263 widget_control, event.top, get_uvalue = top_uvalue 270 264 numdessinin = (extractatt(top_uvalue, 'smallin'))[2]-1 271 options = extractatt(top_uvalue, 'options') 265 options = extractatt(top_uvalue, 'options') 272 266 flags = extractatt(top_uvalue, 'optionsflag') 273 267 index = where(options EQ 'Vecteur') … … 280 274 widget_control, event.top, get_uvalue = top_uvalue 281 275 numdessinin = (extractatt(top_uvalue, 'smallin'))[2]-1 282 options = extractatt(top_uvalue, 'options') 276 options = extractatt(top_uvalue, 'options') 283 277 flags = extractatt(top_uvalue, 'optionsflag') 284 278 index = where(options EQ 'Longitude / x index') … … 314 308 (*top_uvalue[1, findline(top_uvalue, 'domaines')])[*, numdessinin] = boxzoom 315 309 end 316 'Latitude / y index':begin 310 'Latitude / y index':begin 317 311 widget_control, event.top, get_uvalue = top_uvalue 318 312 numdessinin = (extractatt(top_uvalue, 'smallin'))[2]-1 319 options = extractatt(top_uvalue, 'options') 313 options = extractatt(top_uvalue, 'options') 320 314 flags = extractatt(top_uvalue, 'optionsflag') 321 315 index = where(options EQ 'Latitude / y index') -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_calendar.pro
r157 r226 7 7 ; case uval of 8 8 ; 'done':widget_control, event.top, /destroy 9 ; 'set':BEGIN 9 ; 'set':BEGIN 10 10 ; widget_control, event.id, get_value = value 11 11 ; widget_control, ComboboxId, set_value = value 12 12 ; END 13 ; 'get':BEGIN 13 ; 'get':BEGIN 14 14 ; widget_control, ComboboxId, get_value = value 15 15 ; help, value, /struct … … 40 40 ; @file_comments 41 41 ; 42 ; 43 ; @categories 44 ; Compound widget 45 ; 42 ; @categories 43 ; Compound widget 44 ; 46 45 ; @param ID 47 46 ; … … 51 50 ; 52 51 ; @returns 53 ; 54 ; 55 ; @uses 56 ; 57 ; 58 ; @restrictions 59 ; 60 ; 61 ; @examples 62 ; 63 ; 64 ; @history 65 ; 66 ; 67 ; @version 52 ; 53 ; @uses 54 ; 55 ; @restrictions 56 ; 57 ; @examples 58 ; 59 ; @history 60 ; 61 ; @version 68 62 ; $Id$ 69 63 ;- … … 71 65 PRO cw_calendar_set_value, id, value 72 66 ; 73 compile_opt strictarr, strictarrsubs 67 compile_opt strictarr, strictarrsubs 74 68 ; 75 69 ; … … 79 73 widget_control, winfo_id, get_uvalue = infowid 80 74 key_caltype = infowid.caltype 81 75 82 76 ; high freqeuncy calendar 83 77 IF keyword_set(infowid.fakecal) THEN BEGIN 84 78 value2 = date2jul(long(value)) - infowid.fakecal 85 IF value2 LT n_elements(infowid.calendar) AND value2 GE 0 THEN BEGIN 79 IF value2 LT n_elements(infowid.calendar) AND value2 GE 0 THEN BEGIN 86 80 stepid = widget_info(id, find_by_uname = 'step') 87 81 widget_control, stepid, set_value = {combobox_select:value2} … … 89 83 widget_control, winfo_id, set_uvalue = infowid 90 84 ENDIF 91 ENDIF ELSE BEGIN 85 ENDIF ELSE BEGIN 92 86 ; 93 87 value = long(value[0]) … … 122 116 ; @categories 123 117 ; Compound widget 124 ; 118 ; 125 119 ; @param ID 126 120 ; 127 121 ; 128 122 ; @returns 129 ; 130 ; 131 ; @uses 132 ; 133 ; 134 ; @restrictions 135 ; 136 ; 137 ; @examples 138 ; 139 ; 140 ; @history 141 ; 142 ; 143 ; @version 123 ; 124 ; @uses 125 ; 126 ; @restrictions 127 ; 128 ; @examples 129 ; 130 ; @history 131 ; 132 ; @version 144 133 ; $Id$ 145 134 ;- 146 135 FUNCTION cw_calendar_get_value, id 147 136 ; 148 compile_opt strictarr, strictarrsubs 137 compile_opt strictarr, strictarrsubs 149 138 ; 150 139 winfo_id = widget_info(id, find_by_uname = 'infocal') … … 159 148 ; @categories 160 149 ; Compound widget 161 ; 150 ; 162 151 ; @param ID 163 152 ; … … 167 156 ; 168 157 ; @returns 169 ; 170 ; 171 ; @uses 172 ; 173 ; 174 ; @restrictions 175 ; 176 ; 177 ; @examples 178 ; 179 ; 180 ; @history 181 ; 182 ; 183 ; @version 184 ; $Id$ 185 ;- 186 FUNCTION get_cal_value, id, winfoid 187 ; 188 compile_opt strictarr, strictarrsubs 158 ; 159 ; @uses 160 ; 161 ; @restrictions 162 ; 163 ; @examples 164 ; 165 ; @history 166 ; 167 ; @version 168 ; $Id$ 169 ;- 170 FUNCTION get_cal_value, id, winfoid 171 ; 172 compile_opt strictarr, strictarrsubs 189 173 ; 190 174 winfo_id = widget_info(id, find_by_uname = 'infocal') … … 202 186 widget_control, wid_id, get_value = wid_value 203 187 allmonths = string(format = '(C(CMoA))', 31*(indgen(12))) 204 month = (where(allmonths EQ wid_value.combobox_gettext))[0] + 1 188 month = (where(allmonths EQ wid_value.combobox_gettext))[0] + 1 205 189 date = date + 100L * long(month) 206 190 ENDIF ELSE date = date + (oldate MOD 10000L)/100L*100L … … 224 208 ; @categories 225 209 ; Compound widget 226 ; 210 ; 227 211 ; @param EVENT 228 212 ; … … 235 219 ; 236 220 ; @returns 237 ; 238 ; 239 ; @uses 240 ; 241 ; 242 ; @restrictions 243 ; 244 ; 245 ; @examples 246 ; 247 ; 248 ; @history 249 ; 250 ; 251 ; @version 221 ; 222 ; @uses 223 ; 224 ; @restrictions 225 ; 226 ; @examples 227 ; 228 ; @history 229 ; 230 ; @version 252 231 ; $Id$ 253 232 ;- 254 233 PRO set_cal_combobox, event, casename, date0 255 234 ; 256 compile_opt strictarr, strictarrsubs 235 compile_opt strictarr, strictarrsubs 257 236 ; 258 237 ; casename: Which widget shall we move: 'day', 'month' or 'year' ? … … 269 248 ; index of days/months/years according to date0 270 249 case casename of 271 'day':BEGIN 250 'day':BEGIN 272 251 ; list of days corresponding to month0 and year0 273 252 index = where(monthcal EQ month0 AND yearcal EQ year0) 274 253 current = daycal[index] 275 254 END 276 'month':BEGIN 255 'month':BEGIN 277 256 ; list of months corresponding to year0 278 257 index = where(yearcal EQ year0) … … 283 262 current = current[indexbis] 284 263 END 285 'year':BEGIN 264 'year':BEGIN 286 265 ; keep only the uniq years 287 266 index = uniq(yearcal) … … 297 276 if casename EQ 'month' then begin 298 277 widget_control, wid_id, set_value = string(format = '(C(CMoA))', 31*(current-1)) 299 ENDIF ELSE BEGIN 278 ENDIF ELSE BEGIN 300 279 widget_control, wid_id, set_value = strtrim(current, 1) 301 280 ENDELSE … … 310 289 1:selected = 0 311 290 ; 2: a new date has been specified... 312 2:BEGIN 291 2:BEGIN 313 292 case casename of 314 293 'day':selected = (where(current EQ day0))[0] … … 325 304 end 326 305 ;---------------------------------------------------------------------- 327 ; move cyclic ly the calendar to the306 ; move cyclically the calendar to the 328 307 ; value 0 if event.out=1 or combobox_number-1 if event.out=-1 329 308 ;+ … … 333 312 ; @categories 334 313 ; Compound widget 335 ; 314 ; 336 315 ; @param EVENT 337 316 ; … … 341 320 ; 342 321 ; @returns 343 ; 344 ; 345 ; @uses 346 ; 347 ; 348 ; @restrictions 349 ; 350 ; 351 ; @examples 352 ; 353 ; 354 ; @history 355 ; 356 ; 357 ; @version 322 ; 323 ; @uses 324 ; 325 ; @restrictions 326 ; 327 ; @examples 328 ; 329 ; @history 330 ; 331 ; @version 358 332 ; $Id$ 359 333 ;- 360 334 PRO move, event, casename 361 335 ; 362 compile_opt strictarr, strictarrsubs 336 compile_opt strictarr, strictarrsubs 363 337 ; 364 338 possiblecase = ['day', 'month', 'year', 'impossiblecase'] … … 391 365 ; @categories 392 366 ; Compound widget 393 ; 367 ; 394 368 ; @param EVENT 395 369 ; 396 370 ; 397 371 ; @returns 398 ; 399 ; 400 ; @uses 401 ; 402 ; 403 ; @restrictions 404 ; 405 ; 406 ; @examples 407 ; 408 ; 409 ; @history 410 ; 411 ; 412 ; @version 372 ; 373 ; @uses 374 ; 375 ; @restrictions 376 ; 377 ; @examples 378 ; 379 ; @history 380 ; 381 ; @version 413 382 ; $Id$ 414 383 ;- … … 416 385 ; 417 386 @cm_4cal 418 compile_opt strictarr, strictarrsubs 387 compile_opt strictarr, strictarrsubs 419 388 ; 420 389 winfo_id = widget_info(event.handler, find_by_uname = 'infocal') … … 424 393 widget_control, event.id, get_uvalue = uval 425 394 ; high frequency calendar 426 IF uval.name EQ 'step' THEN BEGIN 395 IF uval.name EQ 'step' THEN BEGIN 427 396 infowid.date = jul2date(event.index + infowid.fakecal) 428 397 ENDIF ELSE BEGIN … … 434 403 ; we try to move the combobox just right, with name: possiblecase[whichcase+1] 435 404 if widget_info(event.handler, find_by_uname = possiblecase[whichcase+1]) EQ 0 then BEGIN 436 ; this widget do not exist we set cyclic ly the current widget to the405 ; this widget do not exist we set cyclically the current widget to the 437 406 ; value 0 if event.out=1 or combobox_number-1 if event.out=-1 438 407 widget_control, event.id, get_value = widvalue … … 451 420 ; we update the date 452 421 infowid = get_cal_value(event.handler, winfo_id) 453 ENDELSE 422 ENDELSE 454 423 ; 455 424 widget_control, winfo_id, set_uvalue = infowid … … 465 434 ; @categories 466 435 ; Compound widget 467 ; 436 ; 468 437 ; @param PARENT {in}{required} 469 438 ; The widget ID of the parent widget. … … 474 443 ; @param JDATE0 475 444 ; 476 ;477 445 ; @keyword CALTYPE 478 ; 479 ; 446 ; 480 447 ; @keyword FAKECAL 481 448 ; 482 ; 449 ; 483 450 ; @keyword UVALUE 484 451 ; 485 ;486 452 ; @keyword UNAME 487 453 ; 488 ; 454 ; 489 455 ; @keyword _EXTRA 490 456 ; Used to pass your keywords 491 ; 492 ; @returns 493 ; 494 ; 495 ; @uses 496 ; 497 ; 498 ; @restrictions 499 ; 500 ; 501 ; @examples 502 ; 503 ; 504 ; @history 505 ; 506 ; 507 ; @version 457 ; 458 ; @returns 459 ; 460 ; @uses 461 ; 462 ; @restrictions 463 ; 464 ; @examples 465 ; 466 ; @history 467 ; 468 ; @version 508 469 ; $Id$ 509 470 ; 510 471 ; @todo 511 472 ; seb 512 ; 473 ; 513 474 ;- 514 475 FUNCTION cw_calendar, parent, calendar, jdate0, CALTYPE = CALTYPE, FAKECAL = fakecal, UVALUE = uvalue, UNAME = uname, _extra = ex … … 516 477 @cm_4cal 517 478 ; 518 compile_opt strictarr, strictarrsubs 479 compile_opt strictarr, strictarrsubs 519 480 ; 520 481 if keyword_set(caltype) then key_caltype = caltype … … 547 508 , uvalue = {calendar:calendar, date:jul2date(jdate0), fakecal:fakecal, caltype: key_caltype}) 548 509 ; 549 IF keyword_set(fakecal) THEN BEGIN 510 IF keyword_set(fakecal) THEN BEGIN 550 511 cmbbid = cw_combobox_pm(base, UVALUE = {name:'step'}, UNAME = 'step' $ 551 512 , value = strtrim(indgen(n_elements(calendar)), 1)) 552 513 widget_control, cmbbid, set_value = {combobox_select:(where(calendar EQ jdate0))[0]} 553 ENDIF ELSE BEGIN 514 ENDIF ELSE BEGIN 554 515 ; 555 516 vallen = widget_info(base, string_size = 'm') -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_combobox_pm.pro
r157 r226 7 7 ; case uval of 8 8 ; 'done':widget_control, event.top, /destroy 9 ; 'dynamic_resize':BEGIN 9 ; 'dynamic_resize':BEGIN 10 10 ; widget_control, event.id, get_value = value 11 11 ; widget_control, ComboboxId, set_value = {dynamic_resize:value} 12 12 ; END 13 ; 'combobox_select':BEGIN 13 ; 'combobox_select':BEGIN 14 14 ; widget_control, event.id, get_value = value 15 15 ; widget_control, ComboboxId, set_value = {combobox_select:value} 16 16 ; END 17 ; 'value':BEGIN 17 ; 'value':BEGIN 18 18 ; widget_control, event.id, get_value = value 19 19 ; widget_control, ComboboxId, set_value = value 20 20 ; END 21 ; 'get':BEGIN 21 ; 'get':BEGIN 22 22 ; widget_control, ComboboxId, get_value = value 23 23 ; help, value, /struct … … 52 52 ; @categories 53 53 ; Compound widget 54 ; 54 ; 55 55 ; @param ID 56 56 ; … … 60 60 ; 61 61 ; @returns 62 ; 63 ; 62 ; 64 63 ; @uses 65 ; 66 ; 64 ; 67 65 ; @restrictions 68 ; 69 ; 66 ; 70 67 ; @examples 71 ; 72 ; 68 ; 73 69 ; @history 74 ; 75 ; 76 ; @version 70 ; 71 ; @version 77 72 ; $Id$ 78 73 ;- … … 104 99 ; @categories 105 100 ; Compound widget 106 ; 101 ; 107 102 ; @param ID 108 103 ; 109 ;110 104 ; @returns 111 ; 112 ; 105 ; 113 106 ; @uses 114 ; 115 ; 107 ; 116 108 ; @restrictions 117 ; 118 ; 109 ; 119 110 ; @examples 120 ; 121 ; 111 ; 122 112 ; @history 123 ; 124 ; 125 ; @version 113 ; 114 ; @version 126 115 ; $Id$ 127 116 ;- … … 147 136 ; @categories 148 137 ; Compound widget 149 ; 138 ; 150 139 ; @param EVENT 151 140 ; 152 ;153 141 ; @returns 154 ; 155 ; 142 ; 156 143 ; @uses 157 ; 158 ; 144 ; 159 145 ; @restrictions 160 ; 161 ; 146 ; 162 147 ; @examples 163 ; 164 ; 148 ; 165 149 ; @history 166 ; 167 ; 168 ; @version 150 ; 151 ; @version 169 152 ; $Id$ 170 153 ;- … … 187 170 case uval OF 188 171 'plus':BEGIN 189 if index LT (cmbbnumb - 1) then BEGIN 172 if index LT (cmbbnumb - 1) then BEGIN 190 173 index = index + 1 191 174 widget_control, ComboboxId, set_combobox_select = index … … 193 176 END 194 177 'minus':BEGIN 195 if index GT 0 then BEGIN 178 if index GT 0 then BEGIN 196 179 index = index - 1 197 180 widget_control, ComboboxId, set_combobox_select = index … … 212 195 ; @categories 213 196 ; Compound widget 214 ; 197 ; 215 198 ; @param PARENT {in}{required} 216 199 ; The widget ID of the parent widget. … … 219 202 ; Buttons will be arranged in the number of columns 220 203 ; specified by this keyword. 221 ; 204 ; 222 205 ; @keyword ROW 223 206 ; Buttons will be arranged in the number of rows 224 207 ; specified by this keyword. 225 ; 208 ; 226 209 ; @keyword UVALUE 227 210 ; The user value to be associated with the widget. 228 ; 211 ; 229 212 ; @keyword UNAME 230 213 ; The user name to be associated with the widget. 231 ; 214 ; 232 215 ; @keyword VALUE 233 216 ; … … 258 241 ; index the array of names originally used to set the widget''s 259 242 ; value 260 ; OUT:It is an integer which can take 3 values: 243 ; OUT:It is an integer which can take 3 values: 261 244 ; 1 : If we press + when the index is already at the max 262 245 ; Comment: In this case, the index stay at the max … … 271 254 ; 1) GET_VALUE 272 255 ; widget_control,wid_id,get_value=resultat 273 ; Send back, in the result variable, a structure of 3 elements whose 256 ; Send back, in the result variable, a structure of 3 elements whose 274 257 ; names are inspired by keywords we can pass at widget_control when 275 258 ; we use WIDGET_COMBOBOX: … … 285 268 ; 2) SET_VALUE 286 269 ; widget_control,wid_id,set_value=impose 287 ; Allows to modify the state of the combobox like we can do it for 288 ; WIDGET_COMBOBOX. May impose: 270 ; Allows to modify the state of the combobox like we can do it for 271 ; WIDGET_COMBOBOX. May impose: 289 272 ; a) The contents of the list widget (string or string array) 290 ; b) A structure which can have for elements (from 1 to 3): 273 ; b) A structure which can have for elements (from 1 to 3): 291 274 ; DYNAMIC_RESIZE:Set this keyword to activate (if set to 1) 292 275 ; or deactivate (if set to 0) dynamic resizing of the … … 323 306 IF (N_PARAMS() NE 1) THEN MESSAGE, 'Incorrect number of arguments' 324 307 ON_ERROR, 2 ;return to caller 325 ; che king for row and column keywords326 row = keyword_set(row)*(1-keyword_set(column)) 327 column = keyword_set(column)*(1-keyword_set(row))+(keyword_set(column) EQ row) 308 ; checking for row and column keywords 309 row = keyword_set(row)*(1-keyword_set(column)) 310 column = keyword_set(column)*(1-keyword_set(row))+(keyword_set(column) EQ row) 328 311 if NOT keyword_set(uvalue) then uvalue = '' 329 312 if NOT keyword_set(uname) then uname = '' … … 333 316 , FUNC_GET_VALUE='cw_combobox_pm_get_value' $ 334 317 , PRO_SET_VALUE='cw_combobox_pm_set_value' $ 335 , UVALUE = uvalue, UNAME = uname, _extra = ex) 318 , UVALUE = uvalue, UNAME = uname, _extra = ex) 336 319 ; 337 320 vallen = widget_info(base, string_size = 'm') 338 321 vallen = 35 + (vallen[0]-1)*max(strlen(value)) 339 if keyword_set(row) THEN BEGIN 322 if keyword_set(row) THEN BEGIN 340 323 nothing = widget_button(base, value = '-', uvalue = 'minus', xoffset = 0 $ 341 324 , yoffset = 5, xsize = 15, ysize = 15) … … 345 328 , xoffset = vallen+11, yoffset = 5 $ 346 329 , xsize = 15, ysize = 15) 347 ENDIF ELSE BEGIN 330 ENDIF ELSE BEGIN 348 331 nothing = widget_combobox(base, VALUE = value, UVALUE = 'Combobox', UNAME = 'Combobox' $ 349 332 , xoffset = 0, yoffset = 0, xsize = vallen) … … 354 337 , xoffset = vallen/2 $ 355 338 , yoffset = 24, xsize = 15, ysize = 15) 356 ENDELSE 339 ENDELSE 357 340 ; 358 341 ; widget_control,base,/realize -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_domain.pro
r172 r226 12 12 ; widget_control, Id, set_value = boxzoom 13 13 ; END 14 ; 'get':BEGIN 14 ; 'get':BEGIN 15 15 ; widget_control, Id, get_value = value 16 16 ; print, value … … 45 45 ; @categories 46 46 ; Compound widget 47 ; 47 ; 48 48 ; @param ID 49 49 ; … … 53 53 ; 54 54 ; @returns 55 ; 56 ; 55 ; 57 56 ; @uses 58 ; 59 ; 57 ; 60 58 ; @restrictions 61 ; 62 ; 59 ; 63 60 ; @examples 64 ; 65 ; 61 ; 66 62 ; @history 67 ; 68 ; 69 ; @version 63 ; 64 ; @version 70 65 ; $Id$ 71 66 ;- … … 86 81 ; What is the type of boxzoom ? 87 82 currentplot = (extractatt(top_uvalue, 'smallin'))[2]-1 88 options = extractatt(top_uvalue, 'options') 83 options = extractatt(top_uvalue, 'options') 89 84 flags = extractatt(top_uvalue, 'optionsflag') 90 85 flags = flags[*, currentplot] … … 119 114 Case N_Elements(Value) OF 120 115 0:boxzoom = [lonn1, lonn2, latt1, latt2, vertf1, vertf2] 121 1:BEGIN 116 1:BEGIN 122 117 if value EQ -1 then boxzoom = [lonn1, lonn2, latt1, latt2, vertf1, vertf2] $ 123 118 ELSE boxzoom=[lonn1, lonn2, latt1, latt2, 0.,value[0]] … … 127 122 5:boxzoom=[Value[0:3], 0, Value[4]] 128 123 6:boxzoom = Value 129 Else:BEGIN 124 Else:BEGIN 130 125 rien = report('Wrong Definition of Boxzoom') 131 126 END … … 151 146 min = floor(min([glamt,glamf], max = max)) 152 147 max = ceil(max) 153 ENDIF ELSE BEGIN 148 ENDIF ELSE BEGIN 154 149 min = 0 155 150 max = jpi-1 … … 195 190 min = floor(min([gphit,gphif], max = max)) 196 191 max = ceil(max) 197 ENDIF ELSE BEGIN 192 ENDIF ELSE BEGIN 198 193 min = 0 199 194 max = jpj-1 … … 250 245 widget_control, dthlv2id, set_value = {value:strtrim(gdep2, 1)} 251 246 ENDIF ELSE gdep2 = gdep1+1 252 ; We make sure that given depth es containat least one level.247 ; We make sure that given depths contains at least one level. 253 248 if boxzoom[4] GT boxzoom[5] then begin 254 249 rien = boxzoom[4] … … 256 251 boxzoom[5] = rien 257 252 endif 258 ; 253 ; 259 254 rien = where(gdep1 LT boxzoom[4], indice1) 260 255 indice1 = indice1 < (jpk-1) … … 279 274 widget_control, depth1id, set_value = {slider_min:min1, slider_max:max1, value:boxzoom[4]} 280 275 min2 = gdep2[indice1] 281 if indice2 EQ jpk-1 then BEGIN 276 if indice2 EQ jpk-1 then BEGIN 282 277 max2 = max([gdept, gdepw]) 283 278 max2 = strtrim(string(max2,format='(e8.0)'), 1) … … 295 290 ; @categories 296 291 ; Compound widget 297 ; 292 ; 298 293 ; @param ID 299 294 ; 300 295 ; 301 296 ; @returns 302 ; 303 ; 297 ; 304 298 ; @uses 305 ; 306 ; 299 ; 307 300 ; @restrictions 308 ; 309 ; 301 ; 310 302 ; @examples 311 ; 312 ; 303 ; 313 304 ; @history 314 ; 315 ; 316 ; @version 305 ; 306 ; @version 317 307 ; $Id$ 318 308 ;- … … 337 327 ; @categories 338 328 ; Compound widget 339 ; 329 ; 340 330 ; @param EVENT 341 331 ; 342 332 ; 343 333 ; @returns 344 ; 345 ; 334 ; 346 335 ; @uses 347 ; 348 ; 336 ; 349 337 ; @restrictions 350 ; 351 ; 338 ; 352 339 ; @examples 353 ; 354 ; 340 ; 355 341 ; @history 356 ; 357 ; 358 ; @version 342 ; 343 ; @version 359 344 ; $Id$ 360 345 ;- … … 408 393 widget_control, dthlv2id, set_value = {combobox_select:event.index} 409 394 ; So we redefine the value and the max of the slider 2 410 if event.index EQ jpk-1 then BEGIN 395 if event.index EQ jpk-1 then BEGIN 411 396 max = max([gdept, gdepw]) 412 397 max = strtrim(string(max,format='(e8.0)'), 1) … … 417 402 ; So we redefine the max of the slider 1 418 403 widget_control, depth1id, set_value = {slider_max:gdep1[event.index]} 419 END 420 ; We redefine the value and the min of the slider depth1 404 END 405 ; We redefine the value and the min of the slider depth1 421 406 if event.index EQ 0 then min = 0 ELSE min = gdep1[event.index-1]+1 422 407 widget_control, depth1id, set_value = {slider_min:min, value:gdep1[event.index]} … … 443 428 ; Se we redefine the min of the slider 2 444 429 widget_control, depth2id, set_value = {slider_min:gdep2[event.index]} 445 END 430 END 446 431 ; We redefine the value and the max of the slider depth 2 447 if event.index EQ jpk-1 then BEGIN 432 if event.index EQ jpk-1 then BEGIN 448 433 max = max([gdept, gdepw]) 449 434 max = strtrim(string(max,format='(e8.0)'), 1) … … 488 473 widget_control, dthlv2id, set_value = {combobox_select:indice} 489 474 ; So we redefine the min of the slider 2 490 if indice EQ jpk-1 then BEGIN 475 if indice EQ jpk-1 then BEGIN 491 476 max = max([gdept, gdepw]) 492 477 max = strtrim(string(max,format='(e8.0)'), 1) … … 510 495 ; @categories 511 496 ; Compound widget 512 ; 497 ; 513 498 ; @param PARENT {in}{required} 514 499 ; The widget ID of the parent widget. 515 ; 500 ; 516 501 ; @keyword UVALUE 517 502 ; The user value to be associated with the widget. 518 ; 503 ; 519 504 ; @keyword UNAME 520 505 ; The user name to be associated with the widget. 521 ; 506 ; 522 507 ; @keyword STRICT 523 508 ; … … 527 512 ; 528 513 ; @keyword BOXZOOM 529 ; Vector indicating the geographic zone on which we want to cut the map. 530 ; If BOXZOOM has : 514 ; Vector indicating the geographic zone on which we want to cut the map. 515 ; If BOXZOOM has : 531 516 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 532 517 ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 533 518 ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 534 519 ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 535 ; 6 elements: The extraction is made on Boxzoom 520 ; 6 elements: The extraction is made on Boxzoom 536 521 ; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 537 522 ; 538 523 ; @keyword _EXTRA 539 524 ; Used to pass your keywords 540 ; 525 ; 541 526 ; @returns 542 ; 543 ; 527 ; 544 528 ; @uses 545 ; 546 ; 529 ; 547 530 ; @restrictions 548 ; 549 ; 531 ; 550 532 ; @examples 551 ; 552 ; 533 ; 553 534 ; @history 554 ; 555 ; 556 ; @version 535 ; 536 ; @version 557 537 ; $Id$ 558 538 ; 559 539 ; @todo 560 540 ; seb: Documenter 561 ; 541 ; 562 542 ;- 563 543 FUNCTION cw_domain, parent, BOXZOOM = boxzoom, STRICT = strict, UVALUE = uvalue, UNAME = uname, UNZOOM = unzoom, _extra = ex … … 596 576 , FUNC_GET_VALUE = 'cw_domain_get_value' $ 597 577 , PRO_SET_VALUE = 'cw_domain_set_value' $ 598 , UVALUE = uvalue, UNAME = uname, _extra = ex) 578 , UVALUE = uvalue, UNAME = uname, _extra = ex) 599 579 ;------------------------------------------------ 600 580 baseh = widget_base(base, column = 1+keyword_set(unzoom), space = 0) -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_droplist_pm.pro
r157 r226 6 6 ; case uval of 7 7 ; 'done':widget_control, event.top, /destroy 8 ; 'dynamic_resize':BEGIN 8 ; 'dynamic_resize':BEGIN 9 9 ; widget_control, event.id, get_value = value 10 10 ; widget_control, DroplistId, set_value = {dynamic_resize:value} 11 11 ; END 12 ; 'droplist_select':BEGIN 12 ; 'droplist_select':BEGIN 13 13 ; widget_control, event.id, get_value = value 14 14 ; widget_control, DroplistId, set_value = {droplist_select:value} 15 15 ; END 16 ; 'value':BEGIN 16 ; 'value':BEGIN 17 17 ; widget_control, event.id, get_value = value 18 18 ; widget_control, DroplistId, set_value = value 19 19 ; END 20 ; 'get':BEGIN 20 ; 'get':BEGIN 21 21 ; widget_control, DroplistId, get_value = value 22 22 ; help, value, /struct … … 54 54 ; @categories 55 55 ; Compound widget 56 ; 56 ; 57 57 ; @param ID 58 ;59 58 ; 60 59 ; @param VALUE … … 62 61 ; 63 62 ; @returns 64 ; 65 ; 63 ; 66 64 ; @uses 67 ; 68 ; 65 ; 69 66 ; @restrictions 70 ; 71 ; 67 ; 72 68 ; @examples 73 ; 74 ; 69 ; 75 70 ; @history 76 ; 77 ; 78 ; @version 71 ; 72 ; @version 79 73 ; $Id$ 80 74 ;- … … 104 98 ; @categories 105 99 ; Compound widget 106 ; 100 ; 107 101 ; @param ID 108 102 ; 109 103 ; @returns 110 ; 111 ; 104 ; 112 105 ; @uses 113 ; 114 ; 106 ; 115 107 ; @restrictions 116 ; 117 ; 108 ; 118 109 ; @examples 119 ; 120 ; 110 ; 121 111 ; @history 122 ; 123 ; 124 ; @version 112 ; 113 ; @version 125 114 ; $Id$ 126 115 ;- … … 141 130 ; @categories 142 131 ; Compound widget 143 ; 132 ; 144 133 ; @param EVENT 145 134 ; 146 ;147 135 ; @returns 148 ; 149 ; 136 ; 150 137 ; @uses 151 ; 152 ; 138 ; 153 139 ; @restrictions 154 ; 155 ; 140 ; 156 141 ; @examples 157 ; 158 ; 142 ; 159 143 ; @history 160 ; 161 ; 162 ; @version 144 ; 145 ; @version 163 146 ; $Id$ 164 147 ;- … … 200 183 ; @categories 201 184 ; Compound widget 202 ; 185 ; 203 186 ; @param PARENT {in}{required} 204 187 ; The widget ID of the parent widget. … … 207 190 ; Buttons will be arranged in the number of columns 208 191 ; specified by this keyword. 209 ; 192 ; 210 193 ; @keyword ROW 211 194 ; Buttons will be arranged in the number of rows 212 195 ; specified by this keyword. 213 ; 196 ; 214 197 ; @keyword UVALUE 215 198 ; The user value to be associated with the widget. 216 ; 199 ; 217 200 ; @keyword UNAME 218 201 ; The user name to be associated with the widget. 219 ; 202 ; 220 203 ; @keyword _EXTRA 221 204 ; Used to pass your keywords … … 243 226 ; index the array of names originally used to set the widget''s 244 227 ; value 245 ; OUT:It is an integer which can take 3 values: 228 ; OUT:It is an integer which can take 3 values: 246 229 ; 1 : If we press + when the index is already at the max 247 230 ; Comment: In this case, the index stay at the max … … 256 239 ; 1) GET_VALUE 257 240 ; widget_control,wid_id,get_value=resultat 258 ; Send back, in the result variable, a structure of 3 elements whose 241 ; Send back, in the result variable, a structure of 3 elements whose 259 242 ; names are inspired by keywords we can pass at widget_control when 260 243 ; we use WIDGET_COMBOBOX: … … 273 256 ; pour WIDGET_DROPLIST Impose peut etre: 274 257 ; a) The contents of the list widget (string or string array) 275 ; b) A structure which can have for elements (from 1 to 3): 258 ; b) A structure which can have for elements (from 1 to 3): 276 259 ; DYNAMIC_RESIZE:Set this keyword to activate (if set to 1) 277 260 ; or deactivate (if set to 0) dynamic resizing of the … … 308 291 IF (N_PARAMS() NE 1) THEN MESSAGE, 'Incorrect number of arguments' 309 292 ON_ERROR, 2 ;return to caller 310 ; che king for row and column keywords311 row = keyword_set(row)*(1-keyword_set(column)) 312 column = keyword_set(column)*(1-keyword_set(row))+(keyword_set(column) EQ row) 293 ; checking for row and column keywords 294 row = keyword_set(row)*(1-keyword_set(column)) 295 column = keyword_set(column)*(1-keyword_set(row))+(keyword_set(column) EQ row) 313 296 if NOT keyword_set(uvalue) then uvalue = '' 314 297 if NOT keyword_set(uname) then uname = '' … … 318 301 , FUNC_GET_VALUE='cw_droplist_pm_get_value' $ 319 302 , PRO_SET_VALUE='cw_droplist_pm_set_value' $ 320 , UVALUE = uvalue, UNAME = uname, _extra = ex) 303 , UVALUE = uvalue, UNAME = uname, _extra = ex) 321 304 ; 322 305 if keyword_set(row) THEN nothing = widget_button(base,value= '-', uvalue= 'minus') -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slide_slice.pro
r157 r226 5 5 ; @categories 6 6 ; Compound widget 7 ; 7 ; 8 8 ; @param ID 9 ;10 9 ; 11 10 ; @param VALUE … … 13 12 ; 14 13 ; @returns 15 ; 16 ; 14 ; 17 15 ; @uses 18 ; 19 ; 16 ; 20 17 ; @restrictions 21 ; 22 ; 18 ; 23 19 ; @examples 24 ; 25 ; 20 ; 26 21 ; @history 27 ; 28 ; 29 ; @version 22 ; 23 ; @version 30 24 ; $Id$ 31 25 ;- … … 49 43 widget_control, sliderid, set_value = {slider_min:mini, slider_max:maxi, value:boxzoom[0]<maxi} 50 44 thickness = boxzoom[1]-boxzoom[0] 51 ENDIF ELSE BEGIN 45 ENDIF ELSE BEGIN 52 46 mini = floor(min([gphit, gphif], max = maxi)) 53 47 maxi = ceil(maxi)-thickness … … 57 51 thicknessval = thicknessuval.choix 58 52 index = where(thicknessval EQ thickness) & index = index[0] 59 if index EQ -1 then BEGIN 53 if index EQ -1 then BEGIN 60 54 index = 20 61 55 thicknessval[20] = strtrim(thickness, 1) … … 73 67 ; @categories 74 68 ; Compound widget 75 ; 69 ; 76 70 ; @param EVENT 77 71 ; 78 ;79 72 ; @returns 80 ; 81 ; 73 ; 82 74 ; @uses 83 ; 84 ; 75 ; 85 76 ; @restrictions 86 ; 87 ; 77 ; 88 78 ; @examples 89 ; 90 ; 79 ; 91 80 ; @history 92 ; 93 ; 94 ; @version 81 ; 82 ; @version 95 83 ; $Id$ 96 84 ;- … … 117 105 mini = floor(min([glamt, glamf], max = maxi)) 118 106 maxi = ceil(maxi)-thickness 119 ENDIF ELSE BEGIN 107 ENDIF ELSE BEGIN 120 108 mini = floor(min([gphit, gphif], max = maxi)) 121 109 maxi = ceil(maxi)-thickness … … 136 124 ; print, lon1, mini, maxi 137 125 ; widget_control, sliderid, set_value = {value:lon1, slider_min_max:[mini, maxi]} 138 ; ENDIF ELSE BEGIN 126 ; ENDIF ELSE BEGIN 139 127 ; mini = floor(min([gphit, glamf], max = maxi)) 140 128 ; maxi = ceil(maxi) … … 145 133 ; print, 'ds if',firstxt, 0, jpi-1 146 134 ; widget_control, sliderid, set_value = {value:firstxt, slider_min_max:[0, jpi-1]} 147 ; ENDIF ELSE BEGIN 135 ; ENDIF ELSE BEGIN 148 136 ; widget_control, sliderid, set_value = {value:firstyt, slider_min_max:[0, jpj-1]} 149 137 ; ENDELSE … … 154 142 if type EQ 'y' then begin 155 143 boxzoom[0] = slider & boxzoom[1] = slider+thickness 156 ENDIF ELSE BEGIN 144 ENDIF ELSE BEGIN 157 145 boxzoom[2] = slider & boxzoom[3] = slider+thickness 158 ENDELSE 146 ENDELSE 159 147 ; ENDIF ELSE BEGIN 160 148 ; if strpos(type,'y') NE -1 then begin 161 149 ; boxzoom[0] = glamt[slider, 0] & boxzoom[1] = glamf[slider+thickness, 0] 162 ; ENDIF ELSE BEGIN 150 ; ENDIF ELSE BEGIN 163 151 ; boxzoom[2] = gphit[0, slider] & boxzoom[3] = gphif[0, slider+thickness] 164 ; ENDELSE 152 ; ENDELSE 165 153 ; ENDELSE 166 154 widget_control, domainid, set_value = boxzoom … … 179 167 ; 180 168 ; @keyword BOXZOOM 181 ; Vector indicating the geographic zone on which we want to cut the map. 182 ; If BOXZOOM has : 169 ; Vector indicating the geographic zone on which we want to cut the map. 170 ; If BOXZOOM has : 183 171 ; 1 element : The extraction is made on [lon1, lon2, lat1, lat2, 0.,boxzoom[0]] 184 172 ; 2 elements: The extraction is made on [lon1, lon2, lat1, lat2, boxzoom[0],boxzoom[1]] 185 173 ; 4 elements: The extraction is made on [Boxzoom, 0, max([gdept, gdepw])] 186 174 ; 5 elements: The extraction is made on [Boxzoom[0:3], 0, Boxzoom[4]] 187 ; 6 elements: The extraction is made on Boxzoom 175 ; 6 elements: The extraction is made on Boxzoom 188 176 ; Where lon1, lon2,lat1,lat2 are global variables defined at the last domdef! 189 177 ; … … 191 179 ; Buttons will be arranged in the number of columns 192 180 ; specified by this keyword. 193 ; 181 ; 194 182 ; @keyword FRAME 195 183 ; Specifies the width of the frame to be drawn around the base. 196 ; 184 ; 197 185 ; @keyword ROW 198 186 ; Buttons will be arranged in the number of rows 199 187 ; specified by this keyword. 200 ; 188 ; 201 189 ; @keyword UVALUE 202 190 ; The user value to be associated with the widget. 203 ; 191 ; 204 192 ; @keyword UNAME 205 193 ; The user name to be associated with the widget. 206 ; 194 ; 207 195 ; @keyword _EXTRA 208 196 ; Used to pass your keywords 209 ; 197 ; 210 198 ; @returns 211 ; 212 ; 199 ; 213 200 ; @uses 214 ; 215 ; 201 ; 216 202 ; @restrictions 217 ; 218 ; 203 ; 219 204 ; @examples 220 ; 221 ; 205 ; 222 206 ; @history 223 ; 224 ; 225 ; @version 207 ; 208 ; @version 226 209 ; $Id$ 227 ; 210 ; 228 211 ; @todo 229 212 ; seb: documenter … … 236 219 @common 237 220 ;------------------------------------------------ 238 ; che king exclusive keywords221 ; checking exclusive keywords 239 222 column = keyword_set(column)*(1-keyword_set(row)) 240 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 223 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 241 224 if NOT keyword_set(uvalue) then uvalue = '' 242 225 if NOT keyword_set(uname) then uname = '' … … 247 230 , PRO_SET_VALUE='cw_slide_slice_set_value' $ 248 231 , ROW = row, COLUMN = column, UVALUE = uvalue, UNAME = uname $ 249 , FRAME = frame, _extra = ex) 232 , FRAME = frame, _extra = ex) 250 233 ;------------------------------------------------ 251 234 if NOT keyword_set(boxzoom) then boxzoom = [lon1, lon2, lat1, lat2] … … 264 247 , value = mini > boxzoom[0] < maxi, /column, uname = 'slider' $ 265 248 , uvalue = {name:'slider'}) 266 ENDIF ELSE BEGIN 249 ENDIF ELSE BEGIN 267 250 mini = floor(min([gphit, gphif], max = maxi)) 268 251 thickness = boxzoom[3]-boxzoom[2] … … 273 256 ENDELSE 274 257 index = where(thicknessval EQ thickness) & index = index[0] 275 if index EQ -1 then BEGIN 258 if index EQ -1 then BEGIN 276 259 index = 20 277 260 thicknessval[20] = strtrim(thickness, 1) … … 280 263 endif 281 264 widget_control, droplistid, set_value = {droplist_select:index} 282 265 283 266 ; if type EQ 'xt' then begin 284 267 ; mini = floor(min([glamt,glamf], max = maxi)) 285 268 ; maxi = ceil(maxi) 286 ; ENDIF ELSE BEGIN 269 ; ENDIF ELSE BEGIN 287 270 ; mini = floor(min([gphit,gphif], max = maxi)) 288 271 ; maxi = ceil(maxi) 289 272 ; ENDELSE 290 273 291 274 ;------------------------------------------------ 292 275 return, base -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_slider_pm.pro
r163 r226 6 6 ; case uval of 7 7 ; 'done':widget_control, event.top, /destroy 8 ; 'slider_min':BEGIN 8 ; 'slider_min':BEGIN 9 9 ; widget_control, event.id, get_value = value 10 10 ; widget_control, SliderBarId, set_value = {slider_min:value} 11 11 ; END 12 ; 'slider_max':BEGIN 12 ; 'slider_max':BEGIN 13 13 ; widget_control, event.id, get_value = value 14 14 ; widget_control, SliderBarId, set_value = {slider_max:value} 15 15 ; END 16 ; 'slider_value':BEGIN 16 ; 'slider_value':BEGIN 17 17 ; widget_control, event.id, get_value = value 18 18 ; widget_control, SliderBarId, set_value = value 19 19 ; END 20 ; 'get':BEGIN 20 ; 'get':BEGIN 21 21 ; widget_control, SliderBarId, get_value = value 22 22 ; help, value, /struct … … 57 57 ; 58 58 ; @returns 59 ; 60 ; 59 ; 61 60 ; @uses 62 ; 63 ; 64 ; @restrictions 65 ; 66 ; 67 ; @examples 68 ; 69 ; 70 ; @history 71 ; 72 ; 73 ; @version 61 ; 62 ; @restrictions 63 ; 64 ; @examples 65 ; 66 ; @history 67 ; 68 ; @version 74 69 ; $Id$ 75 70 ;- … … 93 88 ; 94 89 ; @returns 95 ; 96 ; 90 ; 97 91 ; @uses 98 ; 99 ; 100 ; @restrictions 101 ; 102 ; 103 ; @examples 104 ; 105 ; 106 ; @history 107 ; 108 ; 109 ; @version 92 ; 93 ; @restrictions 94 ; 95 ; @examples 96 ; 97 ; @history 98 ; 99 ; @version 110 100 ; $Id$ 111 101 ;- … … 124 114 ; @categories 125 115 ; Compound widget 126 ; 116 ; 127 117 ; @param ID 128 ;129 118 ; 130 119 ; @param VALUE … … 132 121 ; 133 122 ; @returns 134 ; 135 ; 123 ; 136 124 ; @uses 137 ; 138 ; 139 ; @restrictions 140 ; 141 ; 142 ; @examples 143 ; 144 ; 145 ; @history 146 ; 147 ; 148 ; @version 125 ; 126 ; @restrictions 127 ; 128 ; @examples 129 ; 130 ; @history 131 ; 132 ; @version 149 133 ; $Id$ 150 134 ;- … … 161 145 case strtrim(strlowcase(tagnames[tag]), 2) of 162 146 'slider_min':BEGIN 163 ; IF float(value.slider_min[0]) LT minmax[1] THEN BEGIN 147 ; IF float(value.slider_min[0]) LT minmax[1] THEN BEGIN 164 148 minmax[0] = value.slider_min[0] 165 149 widget_control, sbid, set_slider_min = floor(float(value.slider_min[0])) … … 169 153 widget_control, dcid, set_value = decvalue(value.slider_min) 170 154 widget_control, dcid, set_combobox_select = decind(value.slider_min) 171 ENDIF 172 ; ENDIF 155 ENDIF 156 ; ENDIF 173 157 end 174 158 'slider_max':BEGIN 175 ; IF float(value.slider_max[0]) GT minmax[0] THEN BEGIN 159 ; IF float(value.slider_max[0]) GT minmax[0] THEN BEGIN 176 160 minmax[1] = value.slider_max[0] 177 161 widget_control, sbid, set_slider_max = ceil(float(value.slider_max[0])) … … 181 165 widget_control, dcid, set_value = decvalue(value.slider_max) 182 166 widget_control, dcid, set_combobox_select = decind(value.slider_max) 183 ENDIF 184 ; ENDIF 167 ENDIF 168 ; ENDIF 185 169 end 186 170 'value':IF float(value.value[0]) GE minmax[0] $ … … 189 173 endcase 190 174 endfor 191 ENDIF ELSE BEGIN 175 ENDIF ELSE BEGIN 192 176 IF float(value[0]) GE minmax[0] $ 193 177 AND float(value[0]) LE minmax[1] THEN value2 = float(value[0]) 194 178 ENDELSE 195 IF n_elements(value2) NE 0 THEN BEGIN 179 IF n_elements(value2) NE 0 THEN BEGIN 196 180 widget_control, sbid, set_value = fix(value2) 197 181 widget_control, dcid, set_value = decvalue(value2) 198 182 widget_control, dcid, set_combobox_select = decind(value2) 199 ENDIF 183 ENDIF 200 184 return 201 185 end … … 206 190 ; 207 191 ; @categories 208 ; Compound widget 209 ; 192 ; Compound widget 193 ; 210 194 ; @param ID 211 195 ; 212 ; 213 ; @returns 214 ; 215 ; 196 ; @returns 197 ; 216 198 ; @uses 217 ; 218 ; 219 ; @restrictions 220 ; 221 ; 222 ; @examples 223 ; 224 ; 225 ; @history 226 ; 227 ; 228 ; @version 199 ; 200 ; @restrictions 201 ; 202 ; @examples 203 ; 204 ; @history 205 ; 206 ; @version 229 207 ; $Id$ 230 208 ;- … … 246 224 ; @categories 247 225 ; Compound widget 248 ; 226 ; 249 227 ; @param EVENT 250 ; 251 ; 252 ; @returns 253 ; 254 ; 228 ; 229 ; @returns 230 ; 255 231 ; @uses 256 ; 257 ; 258 ; @restrictions 259 ; 260 ; 261 ; @examples 262 ; 263 ; 264 ; @history 265 ; 266 ; 267 ; @version 232 ; 233 ; @restrictions 234 ; 235 ; @examples 236 ; 237 ; @history 238 ; 239 ; @version 268 240 ; $Id$ 269 241 ;- … … 284 256 'minus':if (value - 1) GE minmax[0] then value2 = value - 1 ELSE out = -1 285 257 'SliderBar':if (event.value + value - floor(value)) LE minmax[1] THEN value2 = event.value + value - floor(value) 286 'decimal':BEGIN 258 'decimal':BEGIN 287 259 CASE 1 OF 288 260 value GT minmax[1]: value2 = minmax[1] … … 313 285 ; @categories 314 286 ; Compound widget 315 ; 287 ; 316 288 ; @param PARENT {in}{required} 317 289 ; The widget ID of the parent widget. … … 319 291 ; @keyword UVALUE 320 292 ; The user value to be associated with the widget. 321 ; 293 ; 322 294 ; @keyword UNAME 323 295 ; The user name to be associated with the widget. 324 ; 296 ; 325 297 ; @keyword VALUE 326 298 ; 327 ;328 299 ; @keyword MAXIMUM 329 ; 330 ; 300 ; 331 301 ; @keyword MINIMUM 332 302 ; 333 ; 303 ; 334 304 ; @keyword STRMINLEN 335 305 ; … … 365 335 ; computationally expensive operations until the user releases the 366 336 ; slider. 367 ; OUT:It is an integer which can take 3 values: 337 ; OUT:It is an integer which can take 3 values: 368 338 ; 1 : If we press + when the index is already at the max 369 339 ; Comment: In this case, the index stay at the max … … 378 348 ; 1) GET_VALUE 379 349 ; widget_control,wid_id,get_value=resultat 380 ; Send back in the result variable a structure of 2 elements whose name 381 ; are inspired from keywords we can pass at 350 ; Send back in the result variable a structure of 2 elements whose name 351 ; are inspired from keywords we can pass at 382 352 ; widget_control when we use WIDGET_SLIDER: 383 353 ; VALUE:the value setting of the widget … … 386 356 ; 2) SET_VALUE 387 357 ; widget_control,wid_id,set_value=impose 388 ; Allows to modify the state of the combobox like we can do it for 389 ; WIDGET_COMBOBOX. May impose: 358 ; Allows to modify the state of the combobox like we can do it for 359 ; WIDGET_COMBOBOX. May impose: 390 360 ; a) a integer: give the new position of the slider. 391 ; b) A structure which can have for elements (from 1 to 3): 361 ; b) A structure which can have for elements (from 1 to 3): 392 362 ; VALUE: an integer which give the new position of the slider 393 363 ; SLIDER_MIN:Set to a new minimum value for the specified … … 428 398 if NOT keyword_set(title) then title = ' ' 429 399 ; 430 ; che king exclusive keywords400 ; checking exclusive keywords 431 401 column = (keyword_set(column)*(1-keyword_set(row))+keyword_set(vertical)) < 1 432 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 402 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 433 403 if NOT keyword_set(uvalue) then uvalue = '' 434 404 if NOT keyword_set(uname) then uname = '' … … 437 407 , FUNC_GET_VALUE = 'cw_slider_pm_get_value' $ 438 408 , PRO_SET_VALUE = 'cw_slider_pm_set_value' $ 439 , space = 0, UVALUE = uvalue, UNAME = uname, _extra = ex) 409 , space = 0, UVALUE = uvalue, UNAME = uname, _extra = ex) 440 410 ; 441 411 mlen = (widget_info(base, string_size = 'm'))[0] -
trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_specifie.pro
r157 r226 6 6 ; @categories 7 7 ; Compound widget 8 ; 8 ; 9 9 ; @param ID 10 ;11 10 ; 12 11 ; @param VALUE … … 14 13 ; 15 14 ; @returns 16 ; 17 ; 18 ; @uses 19 ; 20 ; 21 ; @restrictions 22 ; 23 ; 24 ; @examples 25 ; 26 ; 27 ; @history 28 ; 29 ; 30 ; @version 31 ; $Id$ 32 ;- 33 ;***************************************************** 15 ; 16 ; @uses 17 ; 18 ; @restrictions 19 ; 20 ; @examples 21 ; 22 ; @history 23 ; 24 ; @version 25 ; $Id$ 26 ;- 34 27 PRO cw_specifie_set_value, id, value 35 28 ; … … 43 36 widget_control, widget_info(id,find_by_uname='palnum'), set_value = strtrim(value.lct, 2) 44 37 autres = extractstru(value, ['min', 'max', 'inter', 'lct', 'nothing', 'xindex', 'yindex']) 45 if size(autres, /type) EQ 8 then BEGIN 38 if size(autres, /type) EQ 8 then BEGIN 46 39 autresid = widget_info(id,find_by_uname='autres') 47 40 widget_control, widget_info(id, find_by_uname = 'autres'), get_value = autresautres … … 64 57 ; @categories 65 58 ; Compound widget 66 ; 59 ; 67 60 ; @param ID 68 61 ; 69 ; 70 ; @returns 71 ; 72 ; 73 ; @uses 74 ; 75 ; 76 ; @restrictions 77 ; 78 ; 79 ; @examples 80 ; 81 ; 82 ; @history 83 ; 84 ; 85 ; @version 86 ; $Id$ 87 ;- 88 ;***************************************************** 62 ; @returns 63 ; 64 ; @uses 65 ; 66 ; @restrictions 67 ; 68 ; @examples 69 ; 70 ; @history 71 ; 72 ; @version 73 ; $Id$ 74 ;- 89 75 FUNCTION cw_specifie_get_value, id 90 76 ; … … 118 104 ; @categories 119 105 ; Compound widget 120 ; 106 ; 121 107 ; @param EVENT 122 108 ; 123 ; 124 ; @returns 125 ; 126 ; 127 ; @uses 128 ; 129 ; 130 ; @restrictions 131 ; 132 ; 133 ; @examples 134 ; 135 ; 136 ; @history 137 ; 138 ; 139 ; @version 140 ; $Id$ 141 ;- 142 ;***************************************************** 109 ; @returns 110 ; 111 ; @uses 112 ; 113 ; @restrictions 114 ; 115 ; @examples 116 ; 117 ; @history 118 ; 119 ; @version 120 ; $Id$ 121 ;- 143 122 FUNCTION cw_specifie_event, event 144 123 ;------------------------------------------------------------ 145 ; on recuper les ID des differents widgets124 ; on recupere les ID des differents widgets 146 125 ;------------------------------------------------------------ 147 126 ;------------------------------------------------------------ … … 157 136 ;------------------------------------------------------------ 158 137 case uval of 159 'default':BEGIN 138 'default':BEGIN 160 139 ;--------------- 161 ; We find the name of the variable: 140 ; We find the name of the variable: 162 141 vlstid = widget_info(event.top, find_by_uname = 'varlist') 163 142 fieldname = widget_info(vlstid, /combobox_gettext) … … 170 149 widget_control, widget_info(event.handler, find_by_uname = 'autres'), set_value = '' 171 150 END 172 'palcol':BEGIN 151 'palcol':BEGIN 173 152 ind = fix(strmid(event.value, 0, strpos(event.value, '-'))) 174 153 widget_control, widget_info(event.handler, find_by_uname = 'palnum'), set_value = strtrim(ind, 1) … … 186 165 ; @categories 187 166 ; Compound widget 188 ; 167 ; 189 168 ; @param PARENT {in}{required} 190 169 ; The widget ID of the parent widget. … … 193 172 ; Buttons will be arranged in the number of columns 194 173 ; specified by this keyword. 195 ; 174 ; 196 175 ; @keyword ROW 197 176 ; Buttons will be arranged in the number of rows 198 177 ; specified by this keyword. 199 ; 178 ; 200 179 ; @keyword UVALUE 201 180 ; The user value to be associated with the widget. 202 ; 181 ; 203 182 ; @keyword UNAME 204 183 ; The user name to be associated with the widget. … … 206 185 ; @keyword FRAME 207 186 ; 208 ;209 187 ; @keyword FORXXX 210 188 ; 211 ;212 189 ; @keyword _EXTRA 213 190 ; Used to pass your keywords 214 191 ; 215 ; 216 ; @returns 217 ; 218 ; 219 ; @uses 220 ; 221 ; 222 ; @restrictions 223 ; 224 ; 225 ; @examples 226 ; 227 ; 228 ; @history 229 ; 230 ; 231 ; @version 232 ; $ID$ 192 ; @returns 193 ; 194 ; @uses 195 ; 196 ; @restrictions 197 ; 198 ; @examples 199 ; 200 ; @history 201 ; 202 ; @version 203 ; $Id$ 233 204 ; 234 205 ; @todo 235 206 ; seb: documenter 236 ; 207 ; 237 208 ;- 238 209 FUNCTION cw_specifie, parent, ROW = row, COLUMN = column, UVALUE = uvalue, UNAME = uname, FRAME = frame, FORXXX = forxxx, _extra = ex 239 ; che king exclusive keywords210 ; checking exclusive keywords 240 211 ; 241 212 compile_opt idl2, strictarrsubs 242 213 ; 243 214 column = keyword_set(column)*(1-keyword_set(row)) 244 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 215 row = keyword_set(row)*(1-keyword_set(column)) +(keyword_set(row) EQ column) 245 216 ;------------------------------------------------ 246 217 if NOT keyword_set(uvalue) then uvalue = '' … … 250 221 , FUNC_GET_VALUE='cw_specifie_get_value' $ 251 222 , PRO_SET_VALUE='cw_specifie_set_value' $ 252 , UVALUE = uvalue, UNAME = uname, _extra = ex) 253 ; base1 223 , UVALUE = uvalue, UNAME = uname, _extra = ex) 224 ; base1 254 225 base1 = widget_base(base) 255 226 rien = widget_label(base1, value = 'Min', xoffset = 85, yoffset = 15) … … 277 248 278 249 279 ; widget text containi g other keywords pass into top_uvalue.exextra250 ; widget text containing other keywords pass into top_uvalue.exextra 280 251 ; Does it remain some? If yes, we have to put them as string 281 252 282 253 rien = widget_text(base, value = ' ', /editable, uname = 'autres', uvalue = 'autres', xsize = 54, ysize = 3, yoffset = 65, /wrap, /no_newline) 283 254 -
trunk/SRC/ToBeReviewed/WIDGET/xnotice.pro
r163 r226 9 9 ; @categories 10 10 ; Information 11 ; 11 ; 12 12 ; @param TEXT {in}{required}{type=string vector or scalar} 13 ; it is a string or a vector of string. If it is a scalar, we 13 ; it is a string or a vector of string. If it is a scalar, we 14 14 ; look for the line separator !C to create a text with several lines. 15 15 ; 16 16 ; @keyword CHKWIDGET 17 ; Force to verify that they are some active widget to create a widget, 17 ; Force to verify that they are some active widget to create a widget, 18 18 ; otherwise print at the prompt 19 19 ; … … 21 21 ; The identity of the created widget 22 22 ; 23 ; @restrictions 24 ; It do not call xmanager -> It do not create any event! 25 ; We have to delete this widget manu elly:23 ; @restrictions 24 ; It do not call xmanager -> It do not create any event! 25 ; We have to delete this widget manually: 26 26 ; widget_control, widgetid, /destroy 27 27 ; -
trunk/SRC/ToBeReviewed/WIDGET/xxx.pro
r192 r226 5 5 ; @categories 6 6 ; 7 ;8 7 ; @param EVENT 9 8 ; 10 9 ; 11 10 ; @returns 12 ; 13 ; 11 ; 14 12 ; @uses 15 ; 16 ; 13 ; 17 14 ; @restrictions 18 ; 19 ; 15 ; 20 16 ; @examples 21 ; 22 ; 17 ; 23 18 ; @history 24 ; 25 ; 26 ; @version 19 ; 20 ; @version 27 21 ; $Id$ 28 22 ;- … … 35 29 ;------------------------------------------------------------ 36 30 ; = widget_info(event.top,find_by_uname = '') 37 ; What is the type of even ment ?31 ; What is the type of event ? 38 32 ; if event.id EQ 622 then help, event, /struct 39 33 widget_control, event.id, get_uvalue=uval … … 42 36 ;help, event, /struct 43 37 ;help, uval , /struct 44 ; case on the type of even ment38 ; case on the type of event 45 39 widget_control, event.top, get_uvalue = top_uvalue 46 40 ; If we activate the keyword separate at the call of xxx … … 122 116 ; @categories 123 117 ; Widget 124 ; 118 ; 125 119 ; @param DATAFILENAME 126 120 ; … … 134 128 ; @keyword SEPARATE 135 129 ; To separate the button part and the drawing part in 2 windows. 136 ; Useful for small screens, but be careful to do not saturate the 130 ; Useful for small screens, but be careful to do not saturate the 137 131 ; video memory of some antiquated Tx. 138 132 ; 139 133 ; @keyword RESTORE 140 ; 'toto.dat' or toto.dat is a file created at the time of a precedent 134 ; 'toto.dat' or toto.dat is a file created at the time of a precedent 141 135 ; use of xxx thanks to the command "Widget" of the menu "save as". 142 ; 136 ; 143 137 ; @keyword _EXTRA 144 138 ; Used to pass your keywords … … 148 142 ; 149 143 ; @keyword REDRAW 150 ; 144 ; 151 145 ; 152 146 ; @keyword SEPARATE 153 147 ; 154 148 ; 155 ; @keyword UVALUE 149 ; @keyword UVALUE 156 150 ; The user value to be associated with the widget. 157 151 ; … … 191 185 if keyword_set(restore) then BEGIN 192 186 restore = isafile(filename = restore, iodir = homedir, _extra = ex) 193 if size(restore, /type) NE 7 then restore = 0 ELSE BEGIN 187 if size(restore, /type) NE 7 then restore = 0 ELSE BEGIN 194 188 restore, isafile(file = restore, iodir = homedir, _extra = ex) 195 189 newgrid = *(extractatt(uvalue, 'meshparameters'))[0] 196 190 change = changegrid(newgrid) 197 ENDELSE 191 ENDELSE 198 192 endif 199 193 if n_elements(CallerWidId) NE 0 THEN $ … … 203 197 ; list of files we want to look at 204 198 ; 205 if keyword_set(uvalue) then BEGIN 199 if keyword_set(uvalue) then BEGIN 206 200 currentfile = extractatt(uvalue, 'currentfile') 207 201 filelist = extractatt(uvalue, 'filelist') … … 222 216 ENDELSE 223 217 ; 224 if keyword_set(uvalue) THEN BEGIN 218 if keyword_set(uvalue) THEN BEGIN 225 219 smallin = extractatt(uvalue, 'smallin') 226 220 smallout = extractatt(uvalue, 'smallout') 227 ENDIF ELSE BEGIN 221 ENDIF ELSE BEGIN 228 222 smallin = [1, 1, 1] 229 223 smallout = [1, 1, 1] 230 ENDELSE 224 ENDELSE 231 225 nbredessin = smallin[0]*smallin[1] 232 226 numdessinin = smallin[2]-1 233 227 ; warning flg definition must be consistent with cw_pdmenu argument 234 228 ; see also flag definition in cw_pagelayout 235 if keyword_set(uvalue) then BEGIN 229 if keyword_set(uvalue) then BEGIN 236 230 flag = extractatt(uvalue, 'optionsflag') 237 231 key_portrait = flag[0, numdessinin] … … 252 246 ; The top base 253 247 ;------------------------------------------------------------ 254 IF xxxsize[0] LE scrsize[0] AND xxxsize[1] LE scrsize[1] THEN BEGIN 248 IF xxxsize[0] LE scrsize[0] AND xxxsize[1] LE scrsize[1] THEN BEGIN 255 249 base = widget_base(title = 'xxx', GROUP_LEADER = group, /tracking_events $ 256 250 , uname = 'base', space = 0) 257 ENDIF ELSE BEGIN 251 ENDIF ELSE BEGIN 258 252 base = widget_base(title = 'xxx', GROUP_LEADER = group, /tracking_events $ 259 253 , uname = 'base', space = 0 $ … … 278 272 selectact = (extractatt(uvalue, 'types'))[numdessinin] 279 273 selectact = (where(pltlst EQ selectact))[0] 280 widget_control, actid, set_combobox_select = 0 > selectact 274 widget_control, actid, set_combobox_select = 0 > selectact 281 275 ENDIF ELSE selectfile = 0 282 276 … … 316 310 yoff = yoff + 37 317 311 xoff = 5 318 ; b outton 'OK'312 ; button 'OK' 319 313 baseok = widget_button(base, value = ' OK ', uvalue = {name:'ok'}, uname = 'ok button' $ 320 314 , /frame, xoffset = xoff, yoffset = yoff) … … 337 331 selectvar = (extractatt(uvalue, 'varinfo'))[1, numdessinin] 338 332 selectvar = (where(currentlistvar EQ selectvar))[0] 339 widget_control, vlstid, set_combobox_select = 0 > selectvar 333 widget_control, vlstid, set_combobox_select = 0 > selectvar 340 334 ENDIF ELSE selectvar = 0 341 335 ;------------------------------------------------------------ … … 348 342 selectfile = (extractatt(uvalue, 'varinfo'))[0, numdessinin] 349 343 selectfile = (where(file_basename(filelist) EQ selectfile))[0] 350 widget_control, flstid, set_combobox_select = 0 > selectfile 344 widget_control, flstid, set_combobox_select = 0 > selectfile 351 345 ENDIF ELSE selectfile = 0 352 346 ;------------------------------------------------------------ … … 375 369 dummyid = cw_calendar(basecalid, currentcalendar, date2, FAKECAL = fakecal, uname = 'calendar2', uvalue = {name:'calendar2'}, /frame) 376 370 ;------------------------------------------------------------ 377 ; Domain 371 ; Domain 378 372 ;------------------------------------------------------------ 379 373 yoff = yoff + 60 … … 399 393 basegraph = widget_base(title = 'xxx window', group_leader = base, uvalue = base) $ 400 394 ELSE basegraph = base 401 395 402 396 graphid = widget_draw(basegraph, uname = 'graph', /button_events, retain = 2 $ 403 397 , uvalue = {name:'graph', press:0, click:0, x:[0., 0.], y:[0., 0.]} $ … … 416 410 if keyword_set(uvalue) then BEGIN ; 417 411 ; We recopy the pointer uvalue in top_uvalue. 418 ; Beware, we have to redefine completely top_value from variables 419 ; pointed by uvalue. Otherwise, if we simply do top_value = uvalue, 420 ; when we delete by uvalue and variables on which it point, we 412 ; Beware, we have to redefine completely top_value from variables 413 ; pointed by uvalue. Otherwise, if we simply do top_value = uvalue, 414 ; when we delete by uvalue and variables on which it point, we 421 415 ; also delete variables on which point top_value. 422 416 case 1 of … … 443 437 ; widgets's state 444 438 updatewidget, base 445 ; 439 ; 446 440 END 447 441 ELSE:BEGIN … … 450 444 FOR i = 0, 14 do *top_uvalue[1, i] = *uvalue[1, i] 451 445 FOR i = 18, 27 do *top_uvalue[1, i] = *uvalue[1, i] 452 numfile = n_elements(extractatt(uvalue, 'filelist')) 446 numfile = n_elements(extractatt(uvalue, 'filelist')) 453 447 *top_uvalue[1, 15] = ptrarr(numfile, /allocate_heap) 454 448 *top_uvalue[1, 16] = ptrarr(numfile, /allocate_heap) 455 449 *top_uvalue[1, 17] = ptrarr(numfile, /allocate_heap) 456 450 for i = 0, numfile-1 do begin 457 *(*top_uvalue[1, 15])[i] = *(*uvalue[1, 15])[i] 458 *(*top_uvalue[1, 16])[i] = *(*uvalue[1, 16])[i] 459 *(*top_uvalue[1, 17])[i] = *(*uvalue[1, 17])[i] 451 *(*top_uvalue[1, 15])[i] = *(*uvalue[1, 15])[i] 452 *(*top_uvalue[1, 16])[i] = *(*uvalue[1, 16])[i] 453 *(*top_uvalue[1, 17])[i] = *(*uvalue[1, 17])[i] 460 454 endfor 461 455 *top_uvalue[1, 28] = ptrarr(nbredessin, /allocate_heap) 462 for i = 0, nbredessin-1 do *(*top_uvalue[1, 28])[i] = *(*uvalue[1, 28])[i] 456 for i = 0, nbredessin-1 do *(*top_uvalue[1, 28])[i] = *(*uvalue[1, 28])[i] 463 457 widget_control, base, set_uvalue = top_uvalue 464 458 ; Copy the screen of the widget of uvalue in top_value's one … … 478 472 ; 479 473 ENDIF ELSE BEGIN 480 ; Otherwise we will define all elements we will hook at the widget 481 ; thanks to the top_value which is a pointer array with 2 482 ; columns: names and variables. 474 ; Otherwise we will define all elements we will hook at the widget 475 ; thanks to the top_value which is a pointer array with 2 476 ; columns: names and variables. 483 477 ; We initialize all these elements. 484 478 ; Variables concerning the widget in its generality. … … 486 480 ; variables se rapportant aux differents fichiers que l''on peut lire 487 481 ; variables specifiques a chaque dessin 488 ; 489 482 ; 483 490 484 ; creation of the pointer we will hook at the widget. 491 485 top_uvalue = ptrarr(2, 29, /allocate_heap) … … 516 510 *top_uvalue[0, 21] = 'nameprocedures' & *top_uvalue[1, 21] = strarr(nbredessin) 517 511 *top_uvalue[0, 22] = 'types' & *top_uvalue[1, 22] = strarr(nbredessin) 518 *top_uvalue[0, 23] = 'varinfo' & *top_uvalue[1, 23] = strarr(2, nbredessin) 512 *top_uvalue[0, 23] = 'varinfo' & *top_uvalue[1, 23] = strarr(2, nbredessin) 519 513 *top_uvalue[0, 24] = 'domaines' & *top_uvalue[1, 24] = fltarr(6, nbredessin) 520 514 *top_uvalue[0, 25] = 'dates' & *top_uvalue[1, 25] = lonarr(2, nbredessin) … … 526 520 createhistory, base, smallin 527 521 ; 528 ENDELSE 529 ;------------------------------------------------------------ 530 xmanager, 'xxx', base, /no_block 522 ENDELSE 523 ;------------------------------------------------------------ 524 xmanager, 'xxx', base, /no_block 531 525 ;------------------------------------------------------------ 532 526 ;------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.