source: trunk/SRC/ToBeReviewed/WIDGET/AUTOUR_de_XXX/letsdraw.pro @ 114

Last change on this file since 114 was 114, checked in by smasson, 18 years ago

new compilation options (compile_opt idl2, strictarrsubs) in each routine

  • Property svn:eol-style set to native
  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.1 KB
Line 
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
37PRO letsdraw, base, COMMANDE = commande, _extra = ex
38;
39  compile_opt idl2, strictarrsubs
40;
41@common
42; on recupere la uvalue de base
43; widget_control,base, get_uvalue = top_uvalue
44; print, '*****************'
45; help,  top_uvalue, /struct
46; help,  top_uvalue.exextra, /struct
47   if NOT keyword_set(commande) then $
48    commande = buildcmd(base, _extra=ex)
49   if commande[0] EQ '' then return
50; on recupere la uvalue de base
51   widget_control, base, /hourglass
52   widget_control,base, get_uvalue = top_uvalue
53; print, '*****************'
54; help,  top_uvalue, /struct
55; print, '***..........****'
56;  help,  top_uvalue.exextra, /struct
57;  help,  top_uvalue.extra, /struct
58; print, '-*-*-*-*-*-*-*-*-*'
59; print, commande
60; help,mixstru(top_uvalue.exextra,top_uvalue.extra), /struct
61;
62;
63; on recuperel''id de la fenetre graphique associee au widget d''id base
64   graphid = extractatt(top_uvalue, 'graphid')
65   widget_control, graphid, get_value = win
66; on la selectionne (c''est a elle que sera passe toutes les commandes
67; concernant une fenetre)
68   wset, win
69;   erase, 255                       ; on netoie la fenetre
70; on s''assure que si on travaille avec un ecran codant les couleurs
71; sur 24 bits la couleur de fond specifiee!p.background est bien
72; appliquee
73;    if !d.n_colors gt 256 then begin
74;       device, decomposed=1
75;       !p.background='ffffff'x
76;       plot,[0],[0]
77;       device, decomposed=0
78;    ENDIF
79;
80   smallout = long(extractatt(top_uvalue, 'smallout'))
81   numdessinout = smallout[2]-1
82;
83   tracecadre, smallout, /fill
84;
85;
86   options = extractatt(top_uvalue, 'options')   
87   optionsflag = extractatt(top_uvalue, 'optionsflag')
88   portrait = (strtrim(optionsflag[where(options EQ 'Portrait/Landscape'), 0], 1))[0]
89   
90;
91   createpro, ['@common' $
92               , 'noerase = 1' $
93               , 'key_portrait = '+ portrait $
94               , Commande] $
95    , filename =  myuniquetmpdir + 'xxx_oneplot.pro'
96;
97   inserthistory, base, Commande,'; beginning of '+strtrim(smallout[2], 1) $
98    , '; end of '+strtrim(smallout[2], 1)
99;
100   (*top_uvalue[1, findline(top_uvalue, 'penvs')])[numdessinout] = !p
101   (*top_uvalue[1, findline(top_uvalue, 'xenvs')])[numdessinout] = !x
102   (*top_uvalue[1, findline(top_uvalue, 'yenvs')])[numdessinout] = !y
103
104   return
105end
Note: See TracBrowser for help on using the repository browser.