Changeset 114 for trunk/SRC/ToBeReviewed/UTILITAIRE/text_box.pro
- Timestamp:
- 06/19/06 16:14:56 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/ToBeReviewed/UTILITAIRE/text_box.pro
r97 r114 17 17 ; keywords 18 18 ; pos 4 element vector specifying the box position and size 19 ; pos (0),pos(1)specify the lower left corner coordinate20 ; pos (2),pos(3)specify the upper right corner coordinate19 ; pos[0],pos[1] specify the lower left corner coordinate 20 ; pos[2],pos[3] specify the upper right corner coordinate 21 21 ; data window normalized coordinates are use 22 22 ; … … 43 43 center=center,right=right,box=box,vert_space=vert_space, _EXTRA = ex 44 44 ; 45 ; 46 compile_opt idl2, strictarrsubs 47 ; 45 48 ON_ERROR, 2 46 49 ; … … 63 66 xx2=xx1+nx 64 67 yy2=yy1+ny 65 pos=[(xx1-nnx (0))/(nnx(1)-nnx(0)),(yy1-nny(0))/(nny(1)-nny(0)),$66 (xx2-nnx (0))/(nnx(1)-nnx(0)),(yy2-nny(0))/(nny(1)-nny(0))]68 pos=[(xx1-nnx[0])/(nnx[1]-nnx[0]),(yy1-nny[0])/(nny[1]-nny[0]),$ 69 (xx2-nnx[0])/(nnx[1]-nnx[0]),(yy2-nny[0])/(nny[1]-nny[0])] 67 70 posstring=string(form='(a,4(f5.2,a))',$ 68 ',pos=[',pos (0),',',pos(1),',',pos(2),',',pos(3),']')71 ',pos=[',pos[0],',',pos[1],',',pos[2],',',pos[3],']') 69 72 print,strcompress(posstring,/remove_all) 70 73 … … 72 75 endif else begin 73 76 74 xx1 = nnx (0)+pos(0)*(nnx(1)-nnx(0))75 xx2 = nnx (0)+pos(2)*(nnx(1)-nnx(0))76 yy1 = nny (0)+pos(1)*(nny(1)-nnx(0))77 yy2 = nny (0)+pos(3)*(nny(1)-nnx(0))77 xx1 = nnx[0]+pos[0]*(nnx[1]-nnx[0]) 78 xx2 = nnx[0]+pos[2]*(nnx[1]-nnx[0]) 79 yy1 = nny[0]+pos[1]*(nny[1]-nnx[0]) 80 yy2 = nny[0]+pos[3]*(nny[1]-nnx[0]) 78 81 79 82 endelse … … 107 110 ; print,f='(8a8)','charsz','i','ilines','n_lines','lpnt','wlen','sum','xwdth' 108 111 for i=0,nwords-1 do begin 109 sum=sum+wlen (i)+blen112 sum=sum+wlen[i]+blen 110 113 if sum+3*blen gt xx2-xx1 then begin 111 114 ilines=ilines+1 112 sum=wlen (i)+blen115 sum=wlen[i]+blen 113 116 endif 114 lpnt (i)=ilines117 lpnt[i]=ilines 115 118 116 ; print,f='(f8.2,4i8,3f8.2)',charsize,i,ilines,n_lines,lpnt (i),$117 ; wlen (i)+blen,sum+3*blen,xx2-xx1119 ; print,f='(f8.2,4i8,3f8.2)',charsize,i,ilines,n_lines,lpnt[i],$ 120 ; wlen[i]+blen,sum+3*blen,xx2-xx1 118 121 endfor 119 122 case 1 of … … 131 134 for i=0,n_lines-1 do begin 132 135 ii=where(lpnt eq i,nc) 133 maxlen=(total(wlen (ii))+nc*blen)>maxlen134 lines (i)=string(f='(200a)',words(ii)+' ')135 ; print,i,words (ii)136 ; print,i,lines (i)136 maxlen=(total(wlen[ii])+nc*blen)>maxlen 137 lines[i]=string(f='(200a)',words[ii]+' ') 138 ; print,i,words[ii] 139 ; print,i,lines[i] 137 140 endfor 138 141 … … 160 163 for i_line = 0,n_lines-1 do begin 161 164 yy = yy-dy 162 ; print,xx,yy,lines (i_line),charsize163 xyouts, xx, yy, lines (i_line), /device, charsize=charsize, $165 ; print,xx,yy,lines[i_line],charsize 166 xyouts, xx, yy, lines[i_line], /device, charsize=charsize, $ 164 167 alignment=align, color=color, font=-1, _extra = ex 165 168 endfor
Note: See TracChangeset
for help on using the changeset viewer.