Changeset 224 for trunk/SRC/Utilities/text_box.pro
- Timestamp:
- 03/15/07 11:22:28 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Utilities/text_box.pro
r163 r224 1 1 ;+ 2 2 ; 3 ; @file_comments 3 ; @file_comments 4 4 ; This procedure writes a short text message within a box-shaped 5 5 ; area in a graphics window. The message may be split at word 6 6 ; boundaries into several lines, and the character size and 7 7 ; orientation may be adjusted for the text to fit within the box. 8 ; 9 ; @param TEXT {in}{required} 8 ; 9 ; @param TEXT {in}{required} 10 10 ; ASCII text string containing the message. 11 11 ; 12 ; @keyword POS 12 ; @keyword POS 13 13 ; 4 element vector specifying the box position and size 14 14 ; pos[0],pos[1] specify the lower left corner coordinate … … 19 19 ; color of box and legend titles 20 20 ; 21 ; @keyword BG_COLOR 22 ; background color. Setting BG_COLOR erases the area 21 ; @keyword BG_COLOR 22 ; background color. Setting BG_COLOR erases the area 23 23 ; covered by the text box (filling it with color BG_COLOR) 24 24 ; prior to writing the text. If both BG_COLOR and !p.color 25 25 ; are zero then the background color is reset to 255 to 26 26 ; gaurantee a readability. 27 ; 28 ; @keyword RIGHT 27 ; 28 ; @keyword RIGHT 29 29 ; if set, right justify text 30 30 ; 31 ; @keyword CENTER 31 ; @keyword CENTER 32 32 ; if set, center the text 33 33 ; … … 35 35 ; vertical spacing of lines in units of character height 36 36 ; 37 ; @keyword _EXTRA 37 ; @keyword _EXTRA 38 38 ; used to pass your keyword 39 39 ; 40 ; @keyword BOX 40 ; @keyword BOX 41 41 ; activate to show the box on graphics window. 42 42 ; 43 ; @history Paul Ricchiazzi 7Jul93 43 ; @history 44 ; Paul Ricchiazzi 7Jul93 44 45 ; Institute for Computational Earth System Science 45 46 ; University of California, Santa Barbara 46 47 ; 47 ; @version $Id$ 48 ; @version 49 ; $Id$ 48 50 ; 49 51 ;- … … 80 82 print,strcompress(posstring,/remove_all) 81 83 82 84 83 85 endif else begin 84 86 85 87 xx1 = nnx[0]+pos[0]*(nnx[1]-nnx[0]) 86 88 xx2 = nnx[0]+pos[2]*(nnx[1]-nnx[0]) … … 103 105 blanklen=lenstr(' ')*!d.x_vsize 104 106 maxcharsize=(xx2-xx1)/(4*blanklen+max(wordlen)) 105 charsize=1 107 charsize=1 106 108 lpnt=intarr(nwords) 107 109 nomore=0 … … 123 125 sum=wlen[i]+blen 124 126 endif 125 lpnt[i]=ilines 126 127 lpnt[i]=ilines 128 127 129 ; print,f='(f8.2,4i8,3f8.2)',charsize,i,ilines,n_lines,lpnt[i],$ 128 130 ; wlen[i]+blen,sum+3*blen,xx2-xx1 129 endfor 131 endfor 130 132 case 1 of 131 133 ilines+1 lt n_lines: if charsize*1.1 gt maxcharsize then $ … … 135 137 ilines+1 gt n_lines: charsize=charsize*.9 136 138 endcase 137 endrep until nomore 139 endrep until nomore 138 140 139 141 lines=strarr(n_lines) … … 150 152 ; 151 153 align=.5*(1+justify) 152 154 153 155 case justify of 154 156 -1:xx = xx1+.5*((xx2-xx1)-maxlen)
Note: See TracChangeset
for help on using the changeset viewer.