- Timestamp:
- 07/21/06 14:47:49 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SRC/Documentation/idldoc_html_output/ToBeReviewed/STRING/str_size.html
r138 r142 696 696 </div> 697 697 698 <div id="file_comments"></div> 698 <div id="file_comments"> 699 The purpose of this function is to return the proper 700 character size to make a specified string a specifed 701 width in a window. The width is specified in normalized 702 coordinates. The function is extremely useful for sizing 703 strings and labels in resizeable graphics windows. 704 </div> 699 705 700 706 … … 711 717 <div class="routine_details" id="_STR_SIZE"> 712 718 713 <h2><a class="top" href="#container">top</a>STR_SIZE </h2> 719 <h2><a class="top" href="#container">top</a>STR_SIZE <span class="categories"> 720 Graphics Programs, Widgets. 721 </span></h2> 714 722 715 723 <p class="header"> 716 <span class="result">result = </span>STR_SIZE(<span class="result"><a href="#_STR_SIZE_param_string">string</a> , <a href="#_STR_SIZE_param_targetWidth">targetWidth</a></span>, <a href="#_STR_SIZE_keyword_INITSIZE">INITSIZE</a>=<span class="result">INITSIZE</span>, <a href="#_STR_SIZE_keyword_STEP">STEP</a>=<span class="result">STEP</span>)</p>724 <span class="result">result = </span>STR_SIZE(<span class="result"><a href="#_STR_SIZE_param_string">string</a>[, <a href="#_STR_SIZE_param_targetWidth">targetWidth</a>]</span>, <a href="#_STR_SIZE_keyword_INITSIZE">INITSIZE</a>=<span class="result">INITSIZE</span>, <a href="#_STR_SIZE_keyword_STEP">STEP</a>=<span class="result">STEP</span>)</p> 717 725 718 726 <div class="comments"> 719 NAME: 720 STR_SIZE 721 722 PURPOSE: 723 724 The purpose of this function is to return the proper 725 character size to make a specified string a specifed 726 width in a window. The width is specified in normalized 727 coordinates. The function is extremely useful for sizing 728 strings and labels in resizeable graphics windows. 729 730 CATEGORY: 731 732 Graphics Programs, Widgets. 733 734 CALLING SEQUENCE: 735 736 thisCharSize = STR_SIZE(thisSting, targetWidth) 737 738 INPUTS: 739 740 thisString: This is the string that you want to make a specifed 741 target size or width. 742 743 OPTIONAL INPUTS: 744 745 targetWidth: This is the target width of the string in normalized 746 coordinates in the current graphics window. The character 747 size of the string (returned as thisCharSize) will be 748 calculated to get the string width as close as possible to 749 the target width. The default is 0.25. 750 751 KEYWORD PARAMETERS: 752 753 INITSIZE: This is the initial size of the string. Default is 1.0. 754 755 STEP: This is the amount the string size will change in each step 756 of the interative process of calculating the string size. 757 The default value is 0.05. 758 759 OUTPUTS: 760 761 thisCharSize: This is the size the specified string should be set 762 to if you want to produce output of the specified target 763 width. The value is in standard character size units where 764 1.0 is the standard character size. 765 766 EXAMPLE: 767 768 To make the string "Happy Holidays" take up 30% of the width of 769 the current graphics window, type this: 770 771 XYOUTS, 0.5, 0.5, ALIGN=0.5, "Happy Holidays", $ 772 CHARSIZE=STR_SIZE("Happy Holidays", 0.3) 773 774 MODIFICATION HISTORY: 775 776 Written by: David Fanning, 17 DEC 96. 777 Added a scaling factor to take into account the aspect ratio 778 of the window in determing the character size. 28 Oct 97. DWF</div> 779 780 727 </div> 728 729 <h3>Return value</h3><div class="preformat"> 730 thisCharSize. This is the size the specified string should be set 731 to if you want to produce output of the specified target 732 width. The value is in standard character size units where 733 1.0 is the standard character size. 734 </div> 781 735 782 736 … … 785 739 786 740 <h4 id="_STR_SIZE_param_string">string 787 788 789 790 741 <span class="attr">in</span> 742 743 744 <span class="attr">required</span> 791 745 792 746 … … 795 749 </h4> 796 750 797 <div class="comments"></div> 751 <div class="comments"> 752 This is the string that you want to make a specifed 753 target size or width. 754 </div> 798 755 799 756 <h4 id="_STR_SIZE_param_targetWidth">targetWidth 800 801 802 757 <span class="attr">in</span> 758 759 <span class="attr">optional</span> 803 760 804 761 … … 808 765 </h4> 809 766 810 <div class="comments"></div> 767 <div class="comments"> 768 This is the target width of the string in normalized 769 coordinates in the current graphics window. The character 770 size of the string (returned as thisCharSize) will be 771 calculated to get the string width as close as possible to 772 the target width. The default is 0.25. 773 </div> 811 774 812 775 … … 828 791 </h4> 829 792 830 <div class="comments"></div> 793 <div class="comments"> 794 This is the initial size of the string. Default is 1.0. 795 </div> 831 796 832 797 <h4 id="_STR_SIZE_keyword_STEP">STEP … … 841 806 </h4> 842 807 843 <div class="comments"></div> 808 <div class="comments"> 809 This is the amount the string size will change in each step 810 of the interative process of calculating the string size. 811 The default value is 0.05. 812 </div> 844 813 845 814 846 815 847 848 849 850 851 816 <h3>Examples</h3><div class="preformat"> 817 To make the string "Happy Holidays" take up 30% of the width of 818 the current graphics window, type this: 819 820 XYOUTS, 0.5, 0.5, ALIGN=0.5, "Happy Holidays", $ 821 CHARSIZE=STR_SIZE("Happy Holidays", 0.3) 822 </div> 823 <h3>Version history</h3> 824 825 <h4>Version</h4><div class="preformat"> 826 $Id: str_size.pro 134 2006-07-07 10:19:08Z navarro $ 827 </div> 828 <h4>History</h4><div class="preformat"> 829 Written by: David Fanning, 17 DEC 96. 830 Added a scaling factor to take into account the aspect ratio 831 of the window in determing the character size. 28 Oct 97. DWF 832 </div> 852 833 853 834
Note: See TracChangeset
for help on using the changeset viewer.