[2] | 1 | ;------------------------------------------------------------ |
---|
| 2 | ;------------------------------------------------------------ |
---|
| 3 | ;------------------------------------------------------------ |
---|
| 4 | ;+ |
---|
| 5 | ; NAME:widgetdessine |
---|
| 6 | ; |
---|
| 7 | ; PURPOSE: c'est la procedure qui lance le dessin. Si on ne le lui |
---|
| 8 | ; donne pas de commande, elle appelle construitcommande pour savoir |
---|
| 9 | ; quoi tracer. |
---|
| 10 | ; |
---|
| 11 | ; CATEGORY: |
---|
| 12 | ; |
---|
| 13 | ; CALLING SEQUENCE:widgetdessine, base |
---|
| 14 | ; |
---|
| 15 | ; INPUTS:base: l''id du widget ou appliquer le dessin |
---|
| 16 | ; |
---|
| 17 | ; KEYWORD PARAMETERS: |
---|
| 18 | ; COMMANDE: un string du style: read_data('sst'...),.... |
---|
| 19 | ; |
---|
| 20 | ; OUTPUTS: |
---|
| 21 | ; |
---|
| 22 | ; COMMON BLOCKS:common.pro |
---|
| 23 | ; |
---|
| 24 | ; SIDE EFFECTS: |
---|
| 25 | ; |
---|
| 26 | ; RESTRICTIONS: |
---|
| 27 | ; |
---|
| 28 | ; EXAMPLE: |
---|
| 29 | ; |
---|
| 30 | ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) |
---|
| 31 | ; |
---|
| 32 | ;- |
---|
| 33 | ;------------------------------------------------------------ |
---|
| 34 | ;------------------------------------------------------------ |
---|
| 35 | ;------------------------------------------------------------ |
---|
| 36 | |
---|
| 37 | PRO letsdraw, base, COMMANDE = commande, FORPLTH = forplth, FORPLTZ = forpltz, FORPLTT = forpltt, _extra = ex |
---|
| 38 | @common |
---|
| 39 | ; on recupere la uvalue de base |
---|
| 40 | ; widget_control,base, get_uvalue = top_uvalue |
---|
| 41 | ; print, '*****************' |
---|
| 42 | ; help, top_uvalue, /struct |
---|
| 43 | ; help, top_uvalue.exextra, /struct |
---|
| 44 | if NOT keyword_set(commande) then $ |
---|
| 45 | commande = buildcommand(base, FORPLTH=forplt, FORPLTZ=forpltz, FORPLTT=forpltt, _extra=ex) |
---|
| 46 | if commande[0] EQ '' then return |
---|
| 47 | ; on recupere la uvalue de base |
---|
| 48 | widget_control, base, /hourglass |
---|
| 49 | widget_control,base, get_uvalue = top_uvalue |
---|
| 50 | ; print, '*****************' |
---|
| 51 | ; help, top_uvalue, /struct |
---|
| 52 | ; print, '***..........****' |
---|
| 53 | ; help, top_uvalue.exextra, /struct |
---|
| 54 | ; help, top_uvalue.extra, /struct |
---|
| 55 | ; print, '-*-*-*-*-*-*-*-*-*' |
---|
| 56 | ; print, commande |
---|
| 57 | ; help,mixstru(top_uvalue.exextra,top_uvalue.extra), /struct |
---|
| 58 | ; |
---|
| 59 | ; |
---|
| 60 | ; on recuperel''id de la fenetre graphique associee au widget d''id base |
---|
| 61 | graphid = extractatt(top_uvalue, 'graphid') |
---|
| 62 | widget_control, graphid, get_value = win |
---|
| 63 | ; on la selectionne (c''est a elle que sera passe toutes les commandes |
---|
| 64 | ; concernant une fenetre) |
---|
| 65 | wset, win |
---|
| 66 | ; erase, 255 ; on netoie la fenetre |
---|
| 67 | ; on s''assure que si on travaille avec un ecran codant les couleurs |
---|
| 68 | ; sur 24 bits la couleur de fond specifiee!p.background est bien |
---|
| 69 | ; appliquee |
---|
| 70 | ; if !d.n_colors gt 256 then begin |
---|
| 71 | ; device, decomposed=1 |
---|
| 72 | ; !p.background='ffffff'x |
---|
| 73 | ; plot,[0],[0] |
---|
| 74 | ; device, decomposed=0 |
---|
| 75 | ; ENDIF |
---|
| 76 | ; |
---|
| 77 | petitout = long(extractatt(top_uvalue, 'petitout')) |
---|
| 78 | numdessinout = petitout[2]-1 |
---|
| 79 | ; |
---|
| 80 | tracecadre, petitout, /fill |
---|
| 81 | ; |
---|
| 82 | ; |
---|
| 83 | options = extractatt(top_uvalue, 'options') |
---|
| 84 | optionsflag = extractatt(top_uvalue, 'optionsflag') |
---|
| 85 | portrait = (strtrim(optionsflag[where(options EQ 'Portrait/Landscape'), 0], 1))[0] |
---|
| 86 | |
---|
| 87 | ; |
---|
| 88 | createpro, ['@common' $ |
---|
| 89 | , 'noerase = 1' $ |
---|
| 90 | , 'portrait = '+portrait $ |
---|
| 91 | , Commande] $ |
---|
| 92 | , filename = isafile(file = 'xxx_oneplot', io = homedir,/new) |
---|
| 93 | ; |
---|
| 94 | inserthistory, base, Commande,'; beginning of '+strtrim(petitout[2], 1) $ |
---|
| 95 | , '; end of '+strtrim(petitout[2], 1) |
---|
| 96 | ; |
---|
| 97 | (*top_uvalue[1, findline(top_uvalue, 'penvs')])[numdessinout] = !p |
---|
| 98 | (*top_uvalue[1, findline(top_uvalue, 'xenvs')])[numdessinout] = !x |
---|
| 99 | (*top_uvalue[1, findline(top_uvalue, 'yenvs')])[numdessinout] = !y |
---|
| 100 | |
---|
| 101 | return |
---|
| 102 | end |
---|