source: trunk/SRC/ToBeReviewed/WIDGET/COMPOUND_WIDGET/cw_pagelayout.pro @ 134

Last change on this file since 134 was 134, checked in by navarro, 18 years ago

change *.pro file properties (del eof-style, del executable, set keywords Id

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 4.7 KB
Line 
1;*********************************************************************
2;*********************************************************************
3FUNCTION cw_pagelayout_event, event
4;
5  compile_opt idl2, strictarrsubs
6;
7
8   widget_control, event.id, get_uvalue=uval
9   widget_control, event.top, get_uvalue=top_uvalue
10;
11   smallin = extractatt(top_uvalue, 'smallin')
12   numdessinin = smallin[2]-1
13   smallout = extractatt(top_uvalue, 'smallout')
14;
15   if uval.name EQ 'undo' then begin
16      return,{ID:event.handler, TOP:event.top, HANDLER:0L}
17   ENDIF ELSE BEGIN
18;
19@common
20; si on ne change pas le nombre de colonnes, on sort
21      if uval.name EQ 'column' then $
22       if event.index+1 EQ smallin[0] THEN $
23       return,{ID:event.handler, TOP:event.top, HANDLER:0L}
24; si on ne change pas le nombre de lignes, on sort
25      if uval.name EQ 'row' then $
26       if event.index+1 EQ smallin[1] THEN $
27       return,{ID:event.handler, TOP:event.top, HANDLER:0L}
28;
29; on efface la page
30;      graphid = widget_info(event.top,find_by_uname = 'graph')
31      graphid = extractatt(top_uvalue, 'graphid')
32      widget_control,graphid,get_value=win
33      wset, win
34      erase, 255
35      case uval.name of
36         'clear':
37         'column':BEGIN
38            smallin = [event.index+1, smallin[1], 1]
39            smallout = [event.index+1, smallout[1], 1]
40         END
41         'row':BEGIN
42            smallin = [smallin[0], event.index+1, 1]
43            smallout = [smallout[0], event.index+1, 1]
44         END
45      endcase
46      nbredessin = smallin[0]*smallin[1]
47;         
48; on remet tout a 0 en ce qui concerne les postscripts
49      createhistory, event.top, smallin
50;         
51      options = extractatt(top_uvalue, 'options')   
52      flags = extractatt(top_uvalue, 'optionsflag')
53      flag = flags[*, numdessinin]
54;         
55; update and reset all values of the top_uvalue...
56;
57      *top_uvalue[1, findline(top_uvalue, 'smallin')] = smallin
58      *top_uvalue[1, findline(top_uvalue, 'smallout')] = smallout
59;
60      *top_uvalue[1, findline(top_uvalue, 'penvs')] = replicate(!p, nbredessin)
61      *top_uvalue[1, findline(top_uvalue, 'xenvs')] = replicate(!x, nbredessin)
62      *top_uvalue[1, findline(top_uvalue, 'yenvs')] = replicate(!y, nbredessin)
63;
64      *top_uvalue[1, findline(top_uvalue, 'nameprocedures')] = strarr(nbredessin)
65      *top_uvalue[1, findline(top_uvalue, 'types')] = strarr(nbredessin)
66      *top_uvalue[1, findline(top_uvalue, 'varinfo')] = strarr(2, nbredessin)
67      *top_uvalue[1, findline(top_uvalue, 'domaines')] = fltarr(6, nbredessin)
68      *top_uvalue[1, findline(top_uvalue, 'dates')] = lonarr(2, nbredessin)
69      *top_uvalue[1, findline(top_uvalue, 'txtcmd')] = strarr(nbredessin)
70      *top_uvalue[1, findline(top_uvalue, 'optionsflag')] = flag#replicate(1, nbredessin)
71;
72      ptr_free, extractatt(top_uvalue, 'exextra')
73      *top_uvalue[1, findline(top_uvalue, 'exextra')] = ptrarr(nbredessin, /allocate_heap)
74;      *top_uvalue[1, findline(top_uvalue, '')] =
75;
76   ENDELSE
77
78   return,{ID:event.handler, TOP:event.top, HANDLER:0L}
79end
80;*********************************************************************
81FUNCTION cw_pagelayout, parent, small, UVALUE = uvalue, UNAME = uname, UNZOOM = unzoom, COLUMN = column, ROW = row, _extra = ex
82;------------------------------------------------
83;
84  compile_opt idl2, strictarrsubs
85;
86  row = keyword_set(row)*(1-keyword_set(column)) 
87  if NOT keyword_set(uvalue) then uvalue = ''
88  if NOT keyword_set(uname) then uname = ''
89  base = widget_base(parent $
90                     , EVENT_FUNC = 'cw_pagelayout_event' $
91                     , FUNC_GET_VALUE = 'cw_pagelayout_get_value' $
92                     , PRO_SET_VALUE = 'cw_pagelayout_set_value' $
93                     , UVALUE = uvalue, UNAME = uname, space = 0, _extra = ex)   
94;------------------------------------------------
95  IF n_elements(small) eq 0 then small = [1, 1, 1]
96;
97  dummy = widget_label(base, value = 'cln', yoffset = 3)
98  id = widget_combobox(base, value = strtrim(indgen(9)+1, 1), uvalue = {name:'column'} $
99                       , uname = 'column', xoffset = 20, xsize = 40)
100  widget_control, id, set_combobox_select = small[0]-1
101;
102  IF keyword_set(row) THEN BEGIN
103    xoff = 60
104    yoff = 0
105  ENDIF ELSE BEGIN
106    xoff = 0
107    yoff = 20
108  ENDELSE
109  dummy = widget_label(base, value = 'row', xoffset = xoff, yoffset = yoff+3)
110  id = widget_combobox(base, value = strtrim(indgen(9)+1, 1), uvalue = {name:'row'} $
111                       , uname = 'row', xoffset = xoff+20, xsize = 40, yoffset = yoff)
112  widget_control, id, set_combobox_select = small[1]-1
113;------------------------------------------------
114;------------------------------------------------
115  return, base
116end
117;*********************************************************************
Note: See TracBrowser for help on using the repository browser.