Changeset 2748 for branches/blt4/gui/scripts/xyprint.tcl
- Timestamp:
- Dec 28, 2011 2:01:15 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/blt4/gui/scripts/xyprint.tcl
r2746 r2748 39 39 private variable _savedSettings; # Array of settings. 40 40 private variable _outputFormatType ""; 41 private variable _formatIcon ""; 41 42 42 43 private common _oldSettingsFile "~/.rpsettings" … … 678 679 set m $page.format.menu 679 680 blt::comboentry $page.format \ 680 -width 30\681 -width 1i \ 681 682 -textvariable [itcl::scope _settings($this-general-format)] \ 682 683 -editable no -menu $m \ 684 -iconvariable [itcl::scope _formatIcon] \ 683 685 -command [itcl::code $this ApplyGeneralSettings] 684 686 blt::combomenu $m \ … … 686 688 -yscrollbar $m.ys \ 687 689 -textvariable [itcl::scope _settings($this-general-format)] \ 690 -iconvariable [itcl::scope _formatIcon] \ 688 691 -height { 0 2i } 689 692 blt::tk::scrollbar $m.xs 690 693 blt::tk::scrollbar $m.ys 691 $m add -value "pdf" -text "PDF Portable Document Format" 692 $m add -value "ps" -text "PS PostScript Format" 693 $m add -value "eps" -text "EPS Encapsulated PostScript" 694 $m add -value "jpg" -text "JPEG Joint Photographic Experts Group Format" 695 $m add -value "png" -text "PNG Portable Network Graphics Format" 696 $m add -value "gif" -text "GIF Graphics Interchange Format" 694 $m add -value "pdf" -text "PDF Portable Document Format" \ 695 -icon [Rappture::icon pdf] 696 $m add -value "ps" -text "PS PostScript Format" \ 697 -icon [Rappture::icon ps] 698 $m add -value "eps" -text "EPS Encapsulated PostScript" \ 699 -icon [Rappture::icon eps] 700 $m add -value "jpg" -text "JPEG Joint Photographic Experts Group Format" \ 701 -icon [Rappture::icon jpg] 702 $m add -value "png" -text "PNG Portable Network Graphics Format" \ 703 -icon [Rappture::icon png] 704 $m add -value "gif" -text "GIF Graphics Interchange Format" \ 705 -icon [Rappture::icon gif] 697 706 Rappture::Tooltip::for $page.format_l "Set the format of the image." 698 707 … … 700 709 set m $page.style.menu 701 710 blt::comboentry $page.style \ 702 -width 30\711 -width 1i \ 703 712 -textvariable [itcl::scope _settings($this-general-style)] \ 704 713 -editable no -menu $m \ … … 740 749 } 741 750 742 itcl::body Rappture::XyPrint::ApplyLegendSettings {} {743 set page $itk_component(legend_page)744 set _settings($this-legend-anchor) [$page.anchor current]745 if { $_clone != "" } {746 lappend font $_settings($this-legend-fontfamily)747 lappend font $_settings($this-legend-fontsize)748 lappend font $_settings($this-legend-fontweight)749 lappend font $_settings($this-legend-fontslant)750 foreach option { -hide -position -anchor -borderwidth } {751 SetComponentOption legend $option752 }753 $_clone legend configure -font fixed -font $font754 }755 ApplyElementSettings756 }757 758 751 itcl::body Rappture::XyPrint::BuildLegendTab {} { 759 752 itk_component add legend_page { … … 875 868 "Set the symbol of the current entry. \"none\" display no symbols." 876 869 877 label $page.font_l -text "font" 878 Rappture::Combobox $page.fontfamily -width 10 -editable no 879 $page.fontfamily choices insert end \ 880 "courier" "courier" \ 881 "helvetica" "helvetica" \ 882 "new*century*schoolbook" "new century schoolbook" \ 883 "symbol" "symbol" \ 884 "times" "times" 885 bind $page.fontfamily <<Value>> [itcl::code $this ApplyLegendSettings] 870 blt::tk::label $page.font_l -text "font" 871 set m $page.fontfamily.menu 872 blt::comboentry $page.fontfamily \ 873 -width 1i \ 874 -textvariable [itcl::scope _settings($this-legend-fontfamily)] \ 875 -editable no -menu $m \ 876 -command [itcl::code $this ApplyLegendSettings] 877 blt::combomenu $m \ 878 -xscrollbar $m.xs \ 879 -yscrollbar $m.ys \ 880 -textvariable [itcl::scope _settings($this-legend-fontfamily)] \ 881 -height { 0 2i } 882 blt::tk::scrollbar $m.xs 883 blt::tk::scrollbar $m.ys 884 $m style create "courier" -font "{courier new} 9" 885 $m style create "helvetica" -font "{arial} 9" 886 $m style create "newcentury" -font "{new century schoolbook} 9" 887 $m style create "times" -font "{times new roman} 9" 888 $m add -text "courier" -value "courier" -style "courier" 889 $m add -text "helvetica" -value "helvetica" -style "helvetica" 890 $m add -text "new century schoolbook" -value "new*century*schoolbook" \ 891 -style "newcentury" 892 $m add -text "symbol" -value "symbol" 893 $m add -text "times" -value "times" -style "times" 894 $m item configure all -icon [Rappture::icon font] 886 895 Rappture::Tooltip::for $page.fontfamily \ 887 896 "Set the font of entries in the legend." 888 897 889 Rappture::Combobox $page.fontsize -width 4 -editable no 890 $page.fontsize choices insert end \ 891 "8" "8" \ 892 "9" "9" \ 893 "10" "10" \ 894 "11" "11" \ 895 "12" "12" \ 896 "14" "14" \ 897 "17" "17" \ 898 "18" "18" \ 899 "20" "20" 900 bind $page.fontsize <<Value>> [itcl::code $this ApplyLegendSettings] 898 set m $page.fontsize.menu 899 blt::comboentry $page.fontsize \ 900 -width 0.5i \ 901 -textvariable [itcl::scope _settings($this-legend-fontsize)] \ 902 -editable no -menu $m \ 903 -command [itcl::code $this ApplyLegendSettings] 904 blt::combomenu $m \ 905 -xscrollbar $m.xs \ 906 -yscrollbar $m.ys \ 907 -textvariable [itcl::scope _settings($this-legend-fontsize)] \ 908 -height { 0 2i } 909 blt::tk::scrollbar $m.xs 910 blt::tk::scrollbar $m.ys 911 foreach size { "8" "9" "10" "11" "12" "14" "17" "18" "20" } { 912 $m add -text $size -value $size 913 } 901 914 Rappture::Tooltip::for $page.fontsize \ 902 "Set the size ( points) of thefont."915 "Set the size (in points) of the legend font." 903 916 904 917 blt::tk::pushbutton $page.fontweight \ … … 1032 1045 set m $page.tickfontfamily.menu 1033 1046 blt::comboentry $page.tickfontfamily \ 1034 -width 1 0\1047 -width 1i \ 1035 1048 -textvariable [itcl::scope _settings($this-axis-ticks-fontfamily)] \ 1036 1049 -editable no -menu $m \ … … 1053 1066 $m add -text "symbol" -value "symbol" 1054 1067 $m add -text "times" -value "times" -style "times" 1055 $m item configure all \ 1056 -variable [itcl::scope _settings($this-axis-ticks-fontfamily)] 1068 $m item configure all -icon [Rappture::icon font] 1057 1069 Rappture::Tooltip::for $page.tickfontfamily \ 1058 1070 "Set the font of the ticks for the current axis." 1059 1071 1060 if 0 { 1061 label $page.tickfont_l -text "tick font" 1062 Rappture::Combobox $page.tickfontfamily -width 10 -editable no 1063 $page.tickfontfamily choices insert end \ 1064 "courier" "courier" \ 1065 "helvetica" "helvetica" \ 1066 "new*century*schoolbook" "new century schoolbook" \ 1067 "symbol" "symbol" \ 1068 "times" "times" 1069 bind $page.tickfontfamily <<Value>> [itcl::code $this ApplyAxisSettings] 1070 Rappture::Tooltip::for $page.tickfontfamily \ 1071 "Set the font of the ticks for the current axis." 1072 } 1073 Rappture::Combobox $page.tickfontsize -width 4 -editable no 1074 $page.tickfontsize choices insert end \ 1075 "8" "8" \ 1076 "9" "9" \ 1077 "10" "10" \ 1078 "11" "11" \ 1079 "12" "12" \ 1080 "14" "14" \ 1081 "17" "17" \ 1082 "18" "18" \ 1083 "20" "20" 1084 bind $page.tickfontsize <<Value>> [itcl::code $this ApplyAxisSettings] 1072 set m $page.tickfontsize.menu 1073 blt::comboentry $page.tickfontsize \ 1074 -width 0.5i \ 1075 -textvariable [itcl::scope _settings($this-axis-ticks-fontsize)] \ 1076 -editable no -menu $m \ 1077 -command [itcl::code $this ApplyLegendSettings] 1078 blt::combomenu $m \ 1079 -xscrollbar $m.xs \ 1080 -yscrollbar $m.ys \ 1081 -textvariable [itcl::scope _settings($this-axis-ticks-fontsize)] \ 1082 -height { 0 2i } 1083 blt::tk::scrollbar $m.xs 1084 blt::tk::scrollbar $m.ys 1085 foreach size { "8" "9" "10" "11" "12" "14" "17" "18" "20" } { 1086 $m add -text $size -value $size 1087 } 1085 1088 Rappture::Tooltip::for $page.tickfontsize \ 1086 "Set the size ( points) of the tick font."1089 "Set the size (in points) of the tick font." 1087 1090 1088 1091 blt::tk::pushbutton $page.tickfontweight \ … … 1106 1109 "Use the italic version of the tick font." 1107 1110 1108 label $page.titlefont_l -text "title font" 1109 Rappture::Combobox $page.titlefontfamily -width 10 -editable no 1110 $page.titlefontfamily choices insert end \ 1111 "courier" "courier" \ 1112 "helvetica" "helvetica" \ 1113 "new*century*schoolbook" "new century schoolbook" \ 1114 "symbol" "symbol" \ 1115 "times" "times" 1116 bind $page.titlefontfamily <<Value>> [itcl::code $this ApplyAxisSettings] 1111 blt::tk::label $page.titlefont_l -text "title font" 1112 set m $page.titlefontfamily.menu 1113 blt::comboentry $page.titlefontfamily \ 1114 -width 1i \ 1115 -textvariable [itcl::scope _settings($this-axis-title-fontfamily)] \ 1116 -editable no -menu $m \ 1117 -command [itcl::code $this ApplyAxisSettings] 1118 blt::combomenu $m \ 1119 -xscrollbar $m.xs \ 1120 -yscrollbar $m.ys \ 1121 -textvariable [itcl::scope _settings($this-axis-title-fontfamily)] \ 1122 -height { 0 2i } 1123 blt::tk::scrollbar $m.xs 1124 blt::tk::scrollbar $m.ys 1125 $m style create "courier" -font "{courier new} 9" 1126 $m style create "helvetica" -font "{arial} 9" 1127 $m style create "newcentury" -font "{new century schoolbook} 9" 1128 $m style create "times" -font "{times new roman} 9" 1129 $m add -text "courier" -value "courier" -style "courier" 1130 $m add -text "helvetica" -value "helvetica" -style "helvetica" 1131 $m add -text "new century schoolbook" -value "new*century*schoolbook" \ 1132 -style "newcentury" 1133 $m add -text "symbol" -value "symbol" 1134 $m add -text "times" -value "times" -style "times" 1135 $m item configure all -icon [Rappture::icon font] 1117 1136 Rappture::Tooltip::for $page.titlefontfamily \ 1118 1137 "Set the font of the title for the current axis." 1119 1138 1120 Rappture::Combobox $page.titlefontsize -width 4 -editable no 1121 $page.titlefontsize choices insert end \ 1122 "8" "8" \ 1123 "9" "9" \ 1124 "10" "10" \ 1125 "11" "11" \ 1126 "12" "12" \ 1127 "14" "14" \ 1128 "17" "17" \ 1129 "18" "18" \ 1130 "20" "20" 1131 bind $page.titlefontsize <<Value>> [itcl::code $this ApplyAxisSettings] 1139 set m $page.titlefontsize.menu 1140 blt::comboentry $page.titlefontsize \ 1141 -width 0.5i \ 1142 -textvariable [itcl::scope _settings($this-axis-title-fontsize)] \ 1143 -editable no -menu $m \ 1144 -command [itcl::code $this ApplyLegendSettings] 1145 blt::combomenu $m \ 1146 -xscrollbar $m.xs \ 1147 -yscrollbar $m.ys \ 1148 -textvariable [itcl::scope _settings($this-axis-title-fontsize)] \ 1149 -height { 0 2i } 1150 blt::tk::scrollbar $m.xs 1151 blt::tk::scrollbar $m.ys 1152 foreach size { "8" "9" "10" "11" "12" "14" "17" "18" "20" } { 1153 $m add -text $size -value $size 1154 } 1132 1155 Rappture::Tooltip::for $page.titlefontsize \ 1133 "Set the size ( point) of the title font."1156 "Set the size (in points) of the title font." 1134 1157 1135 1158 blt::tk::pushbutton $page.titlefontweight \ … … 1193 1216 itcl::body Rappture::XyPrint::ApplyLegendSettings {} { 1194 1217 set page $itk_component(legend_page) 1218 1195 1219 set _settings($this-legend-position) [$page.position current] 1196 1220 set _settings($this-legend-anchor) [$page.anchor current] 1197 1198 1221 foreach option { -hide -position -anchor -borderwidth } { 1199 1222 SetComponentOption legend $option 1200 1223 } 1201 set _settings($this-legend-fontfamily) [$page.fontfamily value]1202 set _settings($this-legend-fontsize) [$page.fontsize value]1203 1224 lappend font $_settings($this-legend-fontfamily) 1204 1225 lappend font $_settings($this-legend-fontsize) … … 1206 1227 lappend font $_settings($this-legend-fontslant) 1207 1228 $_clone legend configure -font fixed -font $font 1229 1230 # Set the font of the comboentry to the selected legend font. 1231 set m $page.fontfamily.menu 1232 set style [$m item cget $_settings($this-legend-fontfamily) -style] 1233 set font [$m style cget $style -font] 1234 $page.fontfamily configure -font $font 1208 1235 ApplyElementSettings 1209 1236 } … … 1217 1244 SetNamedComponentOption axis $axis $option 1218 1245 } 1219 #set _settings($this-axis-ticks-fontfamily) [$page.tickfontfamily value]1220 #set _settings($this-axis-ticks-fontfamily) $_settings($this-$axis-ticks-fontfamily)1221 set _settings($this-axis-ticks-fontsize) [$page.tickfontsize value]1222 set _settings($this-axis-title-fontfamily) [$page.titlefontfamily value]1223 set _settings($this-axis-title-fontsize) [$page.titlefontsize value]1224 1225 1246 set tickfont {} 1226 1247 set titlefont {} … … 1236 1257 lappend titlefont $_settings(${general}-${attr}) 1237 1258 } 1238 set style [$page.tickfontfamily.menu item cget \ 1239 $_settings($this-axis-ticks-fontfamily) -style] 1240 set font [$page.tickfontfamily.menu style cget $style -font] 1259 # Set the font of the comboentry to the selected tick font. 1260 set m $page.tickfontfamily.menu 1261 set style [$m item cget $_settings($this-axis-ticks-fontfamily) -style] 1262 set font [$m style cget $style -font] 1241 1263 $page.tickfontfamily configure -font $font 1264 1265 # Set the font of the comboentry to the selected title font. 1266 set m $page.titlefontfamily.menu 1267 set style [$m item cget $_settings($this-axis-title-fontfamily) -style] 1268 set font [$m style cget $style -font] 1269 $page.titlefontfamily configure -font $font 1242 1270 1243 1271 $_clone axis configure $axis -tickfont $tickfont -titlefont $titlefont 1244 1272 $_clone marker configure ${type}-zero -hide $_settings($this-axis-zero) 1245 #GetAxis 1273 1246 1274 RegeneratePreview 1247 1275 } … … 1291 1319 itcl::body Rappture::XyPrint::InitializeSettings {} { 1292 1320 # General settings 1321 set page $itk_component(graph_page) 1293 1322 1294 1323 # Always set to "jpg" "ieee" 1295 1324 set _settings($this-general-format) \ 1296 1325 "JPEG Joint Photographic Experts Group Format" 1326 $page.format.menu select "JPEG Joint Photographic Experts Group Format" 1297 1327 set _settings($this-general-style) ieee 1298 1328 set _settings($this-general-remember) 0 1299 set page $itk_component(graph_page)1300 1329 1301 1330 # Layout settings … … 1324 1353 set _settings($this-legend-borderwidth) 0 1325 1354 1326 $page.fontfamily value $_settings($this-legend-fontfamily)1327 $page.fontsize value $_settings($this-legend-fontsize)1328 1355 if { $_settings($this-legend-fontweight) == "bold" } { 1329 1356 set _settings($this-legend-font-bold) 1 … … 1351 1378 } 1352 1379 set axis [lindex $names 0] 1353 1354 $page.titlefontfamily value $_settings($this-$axis-title-fontfamily)1355 $page.titlefontsize value $_settings($this-$axis-title-fontsize)1356 #set _settings($this-axis-ticks-fontfamily) $_settings($this-$axis-ticks-fontfamily)1357 $page.tickfontsize value $_settings($this-$axis-ticks-fontsize)1358 1380 1359 1381 # Always hide the zero line.
Note: See TracChangeset
for help on using the changeset viewer.