;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ ;+ ; NAME:widgetdessine ; ; PURPOSE: c'est la procedure qui lance le dessin. Si on ne le lui ; donne pas de commande, elle appelle construitcommande pour savoir ; quoi tracer. ; ; CATEGORY: ; ; CALLING SEQUENCE:widgetdessine, base ; ; INPUTS:base: l''id du widget ou appliquer le dessin ; ; KEYWORD PARAMETERS: ; COMMANDE: un string du style: read_data('sst'...),.... ; ; OUTPUTS: ; ; COMMON BLOCKS:common.pro ; ; SIDE EFFECTS: ; ; RESTRICTIONS: ; ; EXAMPLE: ; ; MODIFICATION HISTORY:Sebastien Masson (smasson@lodyc.jussieu.fr) ; ;- ;------------------------------------------------------------ ;------------------------------------------------------------ ;------------------------------------------------------------ PRO letsdraw, base, COMMANDE = commande, FORPLTH = forplth, FORPLTZ = forpltz, FORPLTT = forpltt, _extra = ex @common ; on recupere la uvalue de base ; widget_control,base, get_uvalue = top_uvalue ; print, '*****************' ; help, top_uvalue, /struct ; help, top_uvalue.exextra, /struct if NOT keyword_set(commande) then $ commande = buildcommand(base, FORPLTH=forplt, FORPLTZ=forpltz, FORPLTT=forpltt, _extra=ex) if commande[0] EQ '' then return ; on recupere la uvalue de base widget_control, base, /hourglass widget_control,base, get_uvalue = top_uvalue ; print, '*****************' ; help, top_uvalue, /struct ; print, '***..........****' ; help, top_uvalue.exextra, /struct ; help, top_uvalue.extra, /struct ; print, '-*-*-*-*-*-*-*-*-*' ; print, commande ; help,mixstru(top_uvalue.exextra,top_uvalue.extra), /struct ; ; ; on recuperel''id de la fenetre graphique associee au widget d''id base graphid = extractatt(top_uvalue, 'graphid') widget_control, graphid, get_value = win ; on la selectionne (c''est a elle que sera passe toutes les commandes ; concernant une fenetre) wset, win ; erase, 255 ; on netoie la fenetre ; on s''assure que si on travaille avec un ecran codant les couleurs ; sur 24 bits la couleur de fond specifiee!p.background est bien ; appliquee ; if !d.n_colors gt 256 then begin ; device, decomposed=1 ; !p.background='ffffff'x ; plot,[0],[0] ; device, decomposed=0 ; ENDIF ; petitout = long(extractatt(top_uvalue, 'petitout')) numdessinout = petitout[2]-1 ; tracecadre, petitout, /fill ; ; options = extractatt(top_uvalue, 'options') optionsflag = extractatt(top_uvalue, 'optionsflag') portrait = (strtrim(optionsflag[where(options EQ 'Portrait/Landscape'), 0], 1))[0] ; createpro, ['@common' $ , 'noerase = 1' $ , 'portrait = '+portrait $ , Commande] $ , filename = isafile(file = 'xxx_oneplot', io = homedir,/new) ; inserthistory, base, Commande,'; beginning of '+strtrim(petitout[2], 1) $ , '; end of '+strtrim(petitout[2], 1) ; (*top_uvalue[1, findline(top_uvalue, 'penvs')])[numdessinout] = !p (*top_uvalue[1, findline(top_uvalue, 'xenvs')])[numdessinout] = !x (*top_uvalue[1, findline(top_uvalue, 'yenvs')])[numdessinout] = !y return end