Changeset 150 for trunk/SRC/ToBeReviewed/WIDGET/xxx.pro
- Timestamp:
- 08/09/06 12:12:54 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/WIDGET/xxx.pro
r134 r150 1 ;------------------------------------------------------------2 ;------------------------------------------------------------3 ;------------------------------------------------------------4 ;+5 ; NAME:xxx6 ;7 ; PURPOSE:un maximum de possibilites avec un minimum de clics8 ;9 ; CATEGORY:super widget10 ;11 ; CALLING SEQUENCE:xxx12 ;13 ; INPUTS:none14 ;15 ; KEYWORD PARAMETERS:16 ;17 ; /SEPARATE: pour separer la partie boutons de la partie dessin18 ; en 2 fenetres. Utile pour les petits ecrans, mais attention19 ; peut saturer la memoire video de certains Tx un peu vetustes.20 ;21 ; RESTORE='toto.dat' ou toto.dat est un fichier cree lors d''une22 ; precedente utilisation de xxx grace a la commande "Widget" du23 ; menu "save as".24 ;25 ; OUTPUTS:26 ;27 ; COMMON BLOCKS:common.pro28 ;29 ; SIDE EFFECTS:30 ;31 ; RESTRICTIONS:32 ;33 ; EXAMPLE:34 ;35 ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr)36 ;37 ;-38 ;------------------------------------------------------------39 ;------------------------------------------------------------40 ;------------------------------------------------------------41 1 42 2 PRO xxx_event, event … … 48 8 ;------------------------------------------------------------ 49 9 ; = widget_info(event.top,find_by_uname = '') 50 ; quel est le type d''evenement?10 ; What is the type of evenment ? 51 11 ; if event.id EQ 622 then help, event, /struct 52 12 widget_control, event.id, get_uvalue=uval … … 55 15 ;help, event, /struct 56 16 ;help, uval , /struct 57 ; case sur le type d''evenement17 ; case on the type of evenment 58 18 widget_control, event.top, get_uvalue = top_uvalue 59 ; si on a active le mot cles separate a l''appelle dexxx19 ; If we activate the keyword separate at the call of xxx 60 20 if size(top_uvalue, /type) EQ 3 then begin 61 21 event.top = top_uvalue 62 22 widget_control, event.top, get_uvalue = top_uvalue 63 23 endif 64 ; on tue le petit widget cree par notice.pro si il existe24 ; we delete the small widget created by notice.pro if it exists 65 25 noticebase = extractatt(top_uvalue, 'noticebase') 66 26 if noticebase NE 0 then BEGIN … … 128 88 ;------------------------------------------------------------ 129 89 ;------------------------------------------------------------ 90 ;+ 91 ; 92 ; @file_comments 93 ; A maximum of possibilities with a minimum of clics 94 ; 95 ; @categories 96 ; widget 97 ; 98 ; @param DATAFILENAME 99 ; 100 ; 101 ; @param IDLFILE 102 ; 103 ; 104 ; @param ARGSPRO 105 ; 106 ; 107 ; @keyword SEPARATE 108 ; To separate the button part and the drawing part in 2 windows. 109 ; Useful for small screens, but be careful to do not saturate the 110 ; video memory of some antiquated Tx. 111 ; 112 ; @keyword RESTORE 113 ; 'toto.dat' or toto.dat is a file created at the time of a precedent 114 ; use of xxx thanks to the command "Widget" of the menu "save as". 115 ; 116 ; @keyword _EXTRA 117 ; Used to pass your keywords 118 ; 119 ; @uses 120 ; common.pro 121 ; 122 ; @history 123 ; Sebastien Masson (smasson@lodyc.jussieu.fr) 124 ; 125 ; @version 126 ; $Id$ 127 ; 128 ; @todo 129 ; seb: documenter le reste des keywords 130 ; 131 ;- 132 ;------------------------------------------------------------ 133 ;------------------------------------------------------------ 134 ;------------------------------------------------------------ 135 ;------------------------------------------------------------ 136 ;------------------------------------------------------------ 137 ;------------------------------------------------------------ 130 138 PRO xxx, datafilename, idlfile, argspro, CALLERWIDID = CallerWidId $ 131 139 , REDRAW = redraw, SEPARATE = separate, UVALUE = uvalue $ … … 154 162 ;------------------------------------------------------------ 155 163 ;------------------------------------------------------------ 156 ; list e des fichiers que l''on veut regarder164 ; list of files we want to look at 157 165 ; 158 166 if keyword_set(uvalue) then BEGIN … … 368 376 ;------------------------------------------------------------ 369 377 if keyword_set(uvalue) then BEGIN ; 370 ; on recopie le pointeur uvalue dans top_uvalue. 371 ; Attention, il faut completement redefinir top_uvalue a partir des 372 ; variables pointees par uvalue. Sinon si on fait simplement 373 ; top_uvalue = uvalue, qd on detruit par uvalue et les variables 374 ; surlesquelles il pointe on detruit aussi les variables sur 375 ; lesquelles pointent top_uvalue. 378 ; We recopy the pointer uvalue in top_uvalue. 379 ; Beware, we have to redefine completely top_value from variables 380 ; pointed by uvalue. Otherwise, if we simply do top_value = uvalue, 381 ; when we delete by uvalue and variables on which it point, we 382 ; also delete variables on which point top_value. 376 383 case 1 of 377 384 keyword_set(redraw):BEGIN … … 380 387 ; we find homedir 381 388 homedir = isadirectory(io = homedir, title = 'Bad definition of homedir') 382 ; on recupere la liste desinstructions389 ; We recuperae the list of instructions 383 390 globalcommand = extractatt(top_uvalue, 'globalcommand') 384 ; on complete par le premiere et les dernieres lignes du programme391 ; We complete by first and last lines of the program 385 392 createpro, globalcommand, filename = myuniquetmpdir + 'xxx2ps.pro' $ 386 393 , KWDLIST = ', NOERASE = noerase, POSTSCRIPT = postscript' $ … … 395 402 wset, win 396 403 tv, image, /true 397 ; etat des widgets404 ; widgets's state 398 405 updatewidget, base 399 ; menage406 ; 400 407 END 401 408 ELSE:BEGIN … … 416 423 for i = 0, nbredessin-1 do *(*top_uvalue[1, 28])[i] = *(*uvalue[1, 28])[i] 417 424 widget_control, base, set_uvalue = top_uvalue 418 ; copie l''ecran du widget de uvalue dans celui de top_uvalue425 ; Copy the screen of the widget of uvalue in top_value's one 419 426 if keyword_set(CallerWidId) then begin 420 427 widget_control, extractatt(uvalue, 'graphid'), get_value = win … … 431 438 *top_uvalue[1, findline(top_uvalue, 'graphid')] = graphid 432 439 ; 433 434 ; sinon on va definit tous les elements que l''on acroche au widget435 ; grace a la top_uvalue qui est un tableau de pointeurs a 2 colonnes:436 ; les noms et des variables437 ; on initialie tous ceselements.438 ; variables concernant le widget ds sa generalite440 ENDIF ELSE BEGIN 441 ; Otherwise we will define all elements we will hook at the widget 442 ; thanks to the top_value which is a pointer array with 2 443 ; columns: names and variables. 444 ; We initialize all these elements. 445 ; Variables concerning the widget in its generality. 439 446 if NOT keyword_set(ex) then ex = {nothing:0} 440 447 ; variables se rapportant aux differents fichiers que l''on peut lire … … 442 449 ; 443 450 444 ; creation du pointeur que l''on va attache auwidget.451 ; creation of the pointer we will hook at the widget. 445 452 top_uvalue = ptrarr(2, 29, /allocate_heap) 446 ; variables se rapportant au widget en general453 ; variables refering to the widget 447 454 *top_uvalue[0, 0] = 'options' & *top_uvalue[1, 0] = options 448 455 *top_uvalue[0, 1] = 'smallin' & *top_uvalue[1, 1] = smallin … … 458 465 *top_uvalue[0, 11] = 'noticebase' & *top_uvalue[1, 11] = 0l 459 466 *top_uvalue[0, 12] = 'extra' & *top_uvalue[1, 12] = ex 460 ; variables se rapportant aux differents fichiers que l''on peut lire467 ; variables refering to different files we can read 461 468 *top_uvalue[0, 13] = 'currentfile' & *top_uvalue[1, 13] = currentfile 462 469 *top_uvalue[0, 14] = 'filelist' & *top_uvalue[1, 14] = filelist … … 464 471 *top_uvalue[0, 16] = 'readparameters' & *top_uvalue[1, 16] = readparameters 465 472 *top_uvalue[0, 17] = 'meshparameters' & *top_uvalue[1, 17] = meshparameters 466 ; variables se rapportant aux differents dessins que l''on peut faire473 ; variables refering to different drawing we can do 467 474 *top_uvalue[0, 18] = 'penvs' & *top_uvalue[1, 18] = replicate(!p, nbredessin) 468 475 *top_uvalue[0, 19] = 'xenvs' & *top_uvalue[1, 19] = replicate(!x, nbredessin)
Note: See TracChangeset
for help on using the changeset viewer.