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

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

debug + new xxx

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