Ignore:
Timestamp:
Oct 22, 2010, 4:06:10 PM (14 years ago)
Author:
gah
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gui/scripts/xyprint.tcl

    r1788 r1929  
    102102        label $itk_interior.preview \
    103103            -highlightthickness 0 -bd 0 -image $_preview -width 2.5i \
    104                 -height 2.25i -background grey -padx 10 -pady 10
     104                -height 2.25i -background grey -padx 10 -pady 10
    105105    } {
    106         ignore -background
     106        ignore -background
    107107    }
    108108    itk_component add ok {
    109109        button $itk_interior.ok -text "Save" \
    110110            -highlightthickness 0 -pady 2 -padx 0 \
    111             -command [itcl::code $this SetWaitVariable 1] \
    112             -compound left \
    113             -image [Rappture::icon download]
     111            -command [itcl::code $this SetWaitVariable 1] \
     112            -compound left \
     113            -image [Rappture::icon download]
    114114    }
    115115    itk_component add cancel {
    116116        button $itk_interior.cancel -text "Cancel" \
    117117            -highlightthickness 0 -pady 2 -padx 0 \
    118             -command [itcl::code $this SetWaitVariable 0] \
    119             -compound left \
    120             -image [Rappture::icon cancel]
     118            -command [itcl::code $this SetWaitVariable 0] \
     119            -compound left \
     120            -image [Rappture::icon cancel]
    121121    }
    122122    blt::table $itk_interior \
    123         0,0 $itk_component(preview) -cspan 2 -fill both \
    124         1,0 $itk_component(tabs) -fill both -cspan 2 \
     123        0,0 $itk_component(preview) -cspan 2 -fill both \
     124        1,0 $itk_component(tabs) -fill both -cspan 2 \
    125125        2,1 $itk_component(cancel) -padx 2 -pady 2 -width .9i -fill y \
    126         2,0 $itk_component(ok) -padx 2 -pady 2 -width .9i -fill y
     126        2,0 $itk_component(ok) -padx 2 -pady 2 -width .9i -fill y
    127127    blt::table configure $itk_interior r1 -resize none
    128128    blt::table configure $itk_interior r1 -resize both
     
    149149    set _graph ""
    150150    foreach font [array names _fonts] {
    151         font delete $font
     151        font delete $font
    152152    }
    153153    array unset _fonts
     
    173173    set output ""
    174174    if { $_wait($this) } {
    175         set output [GetOutput]
     175        set output [GetOutput]
    176176    }
    177177    DestroySettings
     
    185185
    186186    if { $format == "jpg" } {
    187         set img [image create photo]
    188         $_clone snap $img
    189         set bytes [$img data -format "jpeg -quality 100"]
    190         set bytes [Rappture::encoding::decode -as b64 $bytes]
    191         image delete $img
    192         return [list .jpg $bytes]
     187        set img [image create photo]
     188        $_clone snap $img
     189        set bytes [$img data -format "jpeg -quality 100"]
     190        set bytes [Rappture::encoding::decode -as b64 $bytes]
     191        image delete $img
     192        return [list .jpg $bytes]
    193193    } elseif { $format == "png" } {
    194         set img [image create photo]
    195         $_clone snap $img
    196         set bytes [$img data -format "png"]
    197         set bytes [Rappture::encoding::decode -as b64 $bytes]
    198         image delete $img
    199         return [list .png $bytes]
     194        set img [image create photo]
     195        $_clone snap $img
     196        set bytes [$img data -format "png"]
     197        set bytes [Rappture::encoding::decode -as b64 $bytes]
     198        image delete $img
     199        return [list .png $bytes]
    200200    }
    201201
     
    207207
    208208    $_clone postscript configure \
    209         -maxpect false \
    210         -decoration yes \
    211         -center yes \
    212         -width $w -height $h
     209        -maxpect false \
     210        -decoration yes \
     211        -center yes \
     212        -width $w -height $h
    213213   
    214214    set psdata [$_clone postscript output]
    215215
    216216    if 0 {
    217         set f [open "junk.raw" "w"]
    218         puts -nonewline $f $psdata
    219         close $f
     217        set f [open "junk.raw" "w"]
     218        puts -nonewline $f $psdata
     219        close $f
    220220    }
    221221    if { $format == "eps" } {
    222         return [list .$format $psdata]
     222        return [list .$format $psdata]
    223223    }
    224224
     
    226226    # | eps2eps << $psdata
    227227    lappend cmd "|" "/usr/bin/gs" \
    228         "-q" "-sDEVICE=epswrite" "-sstdout=%stderr" \
    229         "-sOutputFile=-" "-dNOPAUSE" "-dBATCH" "-dSAFER" \
    230         "-dDEVICEWIDTH=250000" "-dDEVICEHEIGHT=250000" "-" "<<" "$psdata"
     228        "-q" "-sDEVICE=epswrite" "-sstdout=%stderr" \
     229        "-sOutputFile=-" "-dNOPAUSE" "-dBATCH" "-dSAFER" \
     230        "-dDEVICEWIDTH=250000" "-dDEVICEHEIGHT=250000" "-" "<<" "$psdata"
    231231    if { $format == "pdf" } {
    232         # | eps2eps << $psdata | ps2pdf
    233         lappend cmd "|" "/usr/bin/gs" \
    234             "-q" "-sDEVICE=pdfwrite" "-sstdout=%stderr" \
    235             "-sOutputFile=-" "-dNOPAUSE" "-dBATCH" "-dSAFER" \
    236             "-dCompatibilityLevel=1.4" "-c" ".setpdfwrite" "-f" "-"
     232        # | eps2eps << $psdata | ps2pdf
     233        lappend cmd "|" "/usr/bin/gs" \
     234            "-q" "-sDEVICE=pdfwrite" "-sstdout=%stderr" \
     235            "-sOutputFile=-" "-dNOPAUSE" "-dBATCH" "-dSAFER" \
     236            "-dCompatibilityLevel=1.4" "-c" ".setpdfwrite" "-f" "-"
    237237    }
    238238    if { [catch {
    239         set f [open $cmd "r"]
    240         fconfigure $f -translation binary -encoding binary
    241         set output [read $f]
    242         close $f
     239        set f [open $cmd "r"]
     240        fconfigure $f -translation binary -encoding binary
     241        set output [read $f]
     242        close $f
    243243    } err ] != 0 } {
    244         global errorInfo
    245         puts stderr "failed to generate file: $err\n$errorInfo"
    246         return ""
     244        global errorInfo
     245        puts stderr "failed to generate file: $err\n$errorInfo"
     246        return ""
    247247    }
    248248    if 0 {
    249         set f [open "junk.$format" "w"]
    250         fconfigure $f -translation binary -encoding binary
    251         puts -nonewline $f $output
    252         close $f
     249        set f [open "junk.$format" "w"]
     250        fconfigure $f -translation binary -encoding binary
     251        puts -nonewline $f $output
     252        close $f
    253253    }
    254254    return [list .$format $output]
     
    259259    set configLine $clone
    260260    foreach name $exclude {
    261         set ignore($name) 1
     261        set ignore($name) 1
    262262    }
    263263    foreach arg $cmd {
    264         lappend configLine $arg
     264        lappend configLine $arg
    265265    }
    266266    foreach option $all {
    267         if { [llength $option] != 5 } {
    268             continue
    269         }
    270         set switch [lindex $option 0]
    271         set initial [lindex $option 3]
    272         set current [lindex $option 4]
    273         if { [info exists ignore($switch)] } {
    274             continue
    275         }
    276         if { [string compare $initial $current] == 0 } {
    277             continue
    278         }
    279         lappend configLine $switch $current
     267        if { [llength $option] != 5 } {
     268            continue
     269        }
     270        set switch [lindex $option 0]
     271        set initial [lindex $option 3]
     272        set current [lindex $option 4]
     273        if { [info exists ignore($switch)] } {
     274            continue
     275        }
     276        if { [string compare $initial $current] == 0 } {
     277            continue
     278        }
     279        lappend configLine $switch $current
    280280    }
    281281    eval $configLine
     
    285285    set top $itk_interior
    286286    if { [winfo exists $top.graph] } {
    287         destroy $top.graph
     287        destroy $top.graph
    288288    }
    289289    set _clone [blt::graph $top.graph]
     
    291291    # Axis component
    292292    foreach axis [$orig axis names] {
    293         if { [$orig axis cget $axis -hide] } {
    294             continue
    295         }
    296         if { [$_clone axis name $axis] == "" } {
    297             $_clone axis create $axis
    298         }
    299         CopyOptions [list axis configure $axis] $orig $_clone
     293        if { [$orig axis cget $axis -hide] } {
     294            continue
     295        }
     296        if { [$_clone axis name $axis] == "" } {
     297            $_clone axis create $axis
     298        }
     299        CopyOptions [list axis configure $axis] $orig $_clone
    300300    }
    301301    foreach axis { x y x2 y2 } {
    302         $_clone ${axis}axis use [$orig ${axis}axis use]
     302        $_clone ${axis}axis use [$orig ${axis}axis use]
    303303    }
    304304    # Pen component
    305305    foreach pen [$orig pen names] {
    306         if { [$_clone pen name $pen] == "" } {
    307             $_clone pen create $pen
    308         }
    309         CopyOptions [list pen configure $pen] $orig $_clone
     306        if { [$_clone pen name $pen] == "" } {
     307            $_clone pen create $pen
     308        }
     309        CopyOptions [list pen configure $pen] $orig $_clone
    310310    }
    311311    # Marker component
    312312    foreach marker [$orig marker names] {
    313         $_clone marker create [$orig marker type $marker] -name $marker
    314         CopyOptions [list marker configure $marker] $orig $_clone -name
     313        $_clone marker create [$orig marker type $marker] -name $marker
     314        CopyOptions [list marker configure $marker] $orig $_clone -name
    315315    }
    316316    # Element component
    317317    foreach elem [$orig element names] {
    318         $_clone element create $elem
    319         CopyOptions [list element configure $elem] $orig $_clone -data
    320         if { [$_clone element cget $elem -hide] } {
    321             $_clone element configure $elem -label ""
    322         }
     318        $_clone element create $elem
     319        CopyOptions [list element configure $elem] $orig $_clone -data
     320        if { [$_clone element cget $elem -hide] } {
     321            $_clone element configure $elem -label ""
     322        }
    323323    }
    324324    # Fix element display list
     
    335335    # Create markers representing lines at zero for the x and y axis.
    336336    $_clone marker create line -name x-zero \
    337         -coords "0 -Inf 0 Inf" -dashes 1 -hide yes
     337        -coords "0 -Inf 0 Inf" -dashes 1 -hide yes
    338338    $_clone marker create line -name y-zero \
    339         -coords "-Inf 0 Inf 0" -dashes 1 -hide yes
     339        -coords "-Inf 0 Inf 0" -dashes 1 -hide yes
    340340}
    341341
     
    343343   
    344344    $_clone configure -width 3.4i -height 3.4i -background white \
    345         -borderwidth 0 \
    346         -leftmargin 0 \
    347         -rightmargin 0 \
    348         -topmargin 0 \
    349         -bottommargin 0
     345        -borderwidth 0 \
     346        -leftmargin 0 \
     347        -rightmargin 0 \
     348        -topmargin 0 \
     349        -bottommargin 0
    350350   
    351351    # Kill the title and create a border around the plot
    352352    $_clone configure \
    353         -title "" \
    354         -plotborderwidth 1 -plotrelief solid  \
    355         -plotbackground white -plotpadx 0 -plotpady 0
     353        -title "" \
     354        -plotborderwidth 1 -plotrelief solid  \
     355        -plotbackground white -plotpadx 0 -plotpady 0
    356356    #
    357357    set _settings($this-layout-width) [Pixels2Inches [$_clone cget -width]]
     
    359359
    360360    set _fonts(legend) [font create legend \
    361                             -family helvetica -size 10 -weight normal]
     361                            -family helvetica -size 10 -weight normal]
    362362    update
    363363    $_clone legend configure \
    364         -position right \
    365         -font $_fonts(legend) \
    366         -hide yes -borderwidth 0 -background white -relief solid \
    367         -anchor nw -activeborderwidth 0
     364        -position right \
     365        -font $_fonts(legend) \
     366        -hide yes -borderwidth 0 -background white -relief solid \
     367        -anchor nw -activeborderwidth 0
    368368    #
    369369    foreach axis [$_clone axis names] {
    370         if { [$_clone axis cget $axis -hide] } {
    371             continue
    372         }
    373         set _fonts($axis-ticks) [font create $axis-ticks \
    374                                      -family helvetica -size 10 \
    375                                      -weight normal -slant roman]
    376         set _fonts($axis-title) [font create $axis-title \
    377                                      -family helvetica -size 10 \
    378                                      -weight normal -slant roman]
    379         update
    380         $_clone axis configure $axis -ticklength 5  \
    381             -majorticks {} -minorticks {}
    382         $_clone axis configure $axis \
    383             -tickfont $_fonts($axis-ticks) \
    384             -titlefont $_fonts($axis-title)
     370        if { [$_clone axis cget $axis -hide] } {
     371            continue
     372        }
     373        set _fonts($axis-ticks) [font create $axis-ticks \
     374                                     -family helvetica -size 10 \
     375                                     -weight normal -slant roman]
     376        set _fonts($axis-title) [font create $axis-title \
     377                                     -family helvetica -size 10 \
     378                                     -weight normal -slant roman]
     379        update
     380        $_clone axis configure $axis -ticklength 5  \
     381            -majorticks {} -minorticks {}
     382        $_clone axis configure $axis \
     383            -tickfont $_fonts($axis-ticks) \
     384            -titlefont $_fonts($axis-title)
    385385    }
    386386    foreach elem [$_clone element names] {
    387         if { [$_clone element cget $elem -linewidth] > 1 } {
    388             $_clone element configure $elem -linewidth 1 -pixels 3
    389         }
     387        if { [$_clone element cget $elem -linewidth] > 1 } {
     388            $_clone element configure $elem -linewidth 1 -pixels 3
     389        }
    390390    }
    391391}
     
    396396    set code [catch [list $_clone configure $opt $new] err]
    397397    if { $code != 0 } {
    398         bell
    399         global errorInfo
    400         puts stderr "$err: $errorInfo"
    401         set _settings($this-graph$opt) $old
    402         $_clone configure $opt $old
     398        bell
     399        global errorInfo
     400        puts stderr "$err: $errorInfo"
     401        set _settings($this-graph$opt) $old
     402        $_clone configure $opt $old
    403403    }
    404404}
     
    409409    set code [catch [list $_clone $comp configure $opt $new] err]
    410410    if { $code != 0 } {
    411         bell
    412         global errorInfo
    413         puts stderr "$err: $errorInfo"
    414         set _settings($this-$comp$opt) $old
    415         $_clone $comp configure $opt $old
     411        bell
     412        global errorInfo
     413        puts stderr "$err: $errorInfo"
     414        set _settings($this-$comp$opt) $old
     415        $_clone $comp configure $opt $old
    416416    }
    417417}
     
    422422    set code [catch [list $_clone $comp configure $name $opt $new] err]
    423423    if { $code != 0 } {
    424         bell
    425         global errorInfo
    426         puts stderr "$err: $errorInfo"
    427         set _settings($this-$comp$opt) $old
    428         $_clone $comp configure $name $opt $old
     424        bell
     425        global errorInfo
     426        puts stderr "$err: $errorInfo"
     427        set _settings($this-$comp$opt) $old
     428        $_clone $comp configure $name $opt $old
    429429    }
    430430}
     
    443443    if 0 {
    444444    if { ![winfo exists .labeltest] } {
    445         toplevel .labeltest -bg red
    446         label .labeltest.label -image $img
    447         pack .labeltest.label -fill both
     445        toplevel .labeltest -bg red
     446        label .labeltest.label -image $img
     447        pack .labeltest.label -fill both
    448448    }
    449449    }
     
    458458itcl::body Rappture::XyPrint::Pixels2Inches { pixels } {
    459459    if { [llength $pixels] == 2 } {
    460         set pixels [lindex $pixels 0]
     460        set pixels [lindex $pixels 0]
    461461    }
    462462    set pixelsPerInch [winfo pixels . 1i]
     
    468468    set n [scan $inches %g dummy]
    469469    if { $n != 1  && $defValue != "" } {
    470         set inches $defValue
     470        set inches $defValue
    471471    }
    472472    return  [winfo pixels . ${inches}i]
     
    475475itcl::body Rappture::XyPrint::Color2RGB { color } {
    476476    foreach { r g b } [winfo rgb $_clone $color] {
    477         set r [expr round($r / 257.0)]
    478         set g [expr round($g / 257.0)]
    479         set b [expr round($b / 257.0)]
     477        set r [expr round($r / 257.0)]
     478        set g [expr round($g / 257.0)]
     479        set b [expr round($b / 257.0)]
    480480    }
    481481    return [format "\#%02x%02x%02x" $r $g $b]
     
    484484itcl::body Rappture::XyPrint::GetAxisType { axis } {
    485485    foreach type { x y x2 y2 } {
    486         set axes [$_clone ${type}axis use]
    487         if { [lsearch $axes $axis] >= 0 } {
    488             return [string range $type 0 0]
    489         }
     486        set axes [$_clone ${type}axis use]
     487        if { [lsearch $axes $axis] >= 0 } {
     488            return [string range $type 0 0]
     489        }
    490490    }
    491491    return ""
     
    495495    set axis [$itk_component(axis_combo) current]
    496496    foreach option { -min -max -loose -title -stepsize -subdivisions } {
    497         set _settings($this-axis$option) [$_clone axis cget $axis $option]
     497        set _settings($this-axis$option) [$_clone axis cget $axis $option]
    498498    }
    499499    set type [GetAxisType $axis]
    500500    if { [$_clone grid cget -map${type}] == $axis } {
    501         set _settings($this-axis-grid) 1
     501        set _settings($this-axis-grid) 1
    502502    }  else {
    503         set _settings($this-axis-grid) 0
     503        set _settings($this-axis-grid) 0
    504504    }
    505505    set _settings($this-axis-plotpad${type}) \
    506         [Pixels2Inches [$_clone cget -plotpad${type}]]
     506        [Pixels2Inches [$_clone cget -plotpad${type}]]
    507507    set _settings($this-axis-zero) [$_clone marker cget ${type}-zero -hide]
    508508}
     
    512512    array unset _settings $this-element-*
    513513    foreach elem [$_clone element show] {
    514         set _settings($this-element-$index) $elem
    515         incr index
     514        set _settings($this-element-$index) $elem
     515        incr index
    516516    }
    517517    set index [$itk_component(element_slider) get]
     
    524524    set color [$page.color label $_settings($this-element-color)]
    525525    if { $color == "" } {
    526         set color [Color2RGB $_settings($this-element-color)]
    527         $page.color choices insert end $color $color
    528         $page.color value $color
     526        set color [Color2RGB $_settings($this-element-color)]
     527        $page.color choices insert end $color $color
     528        $page.color value $color
    529529    } else {
    530         $page.color value [$page.color label $_settings($this-element-color)]
     530        $page.color value [$page.color label $_settings($this-element-color)]
    531531    }
    532532    $page.symbol value [$page.symbol label $_settings($this-element-symbol)]
     
    537537itcl::body Rappture::XyPrint::BuildLayoutTab {} {
    538538    itk_component add layout_page {
    539         frame $itk_component(tabs).layout_page
     539        frame $itk_component(tabs).layout_page
    540540    }
    541541    set page $itk_component(layout_page)
     
    545545    label $page.width_l -text "width" 
    546546    entry $page.width -width 6 \
    547         -textvariable [itcl::scope _settings($this-layout-width)]
     547        -textvariable [itcl::scope _settings($this-layout-width)]
    548548    bind  $page.width <KeyPress-Return> [itcl::code $this ApplyLayoutSettings]
    549549    Rappture::Tooltip::for $page.width \
     
    552552    label $page.height_l -text "height"
    553553    entry $page.height -width 6 \
    554         -textvariable [itcl::scope _settings($this-layout-height)]
     554        -textvariable [itcl::scope _settings($this-layout-height)]
    555555    bind  $page.height <KeyPress-Return> [itcl::code $this ApplyLayoutSettings]
    556556    Rappture::Tooltip::for $page.height \
     
    561561    label $page.left_l -text "left"
    562562    entry $page.left -width 6 \
    563         -textvariable [itcl::scope _settings($this-layout-leftmargin)]
     563        -textvariable [itcl::scope _settings($this-layout-leftmargin)]
    564564    bind  $page.left <KeyPress-Return> [itcl::code $this ApplyLayoutSettings]
    565565    Rappture::Tooltip::for $page.left \
     
    568568    label $page.right_l -text "right"
    569569    entry $page.right -width 6 \
    570         -textvariable [itcl::scope _settings($this-layout-rightmargin)]
     570        -textvariable [itcl::scope _settings($this-layout-rightmargin)]
    571571    bind  $page.right <KeyPress-Return> [itcl::code $this ApplyLayoutSettings]
    572572    Rappture::Tooltip::for $page.right \
     
    576576    label $page.top_l -text "top"
    577577    entry $page.top -width 6 \
    578         -textvariable [itcl::scope _settings($this-layout-topmargin)]
     578        -textvariable [itcl::scope _settings($this-layout-topmargin)]
    579579    bind  $page.top <KeyPress-Return> [itcl::code $this ApplyLayoutSettings]
    580580    Rappture::Tooltip::for $page.top \
     
    583583    label $page.bottom_l -text "bottom"
    584584    entry $page.bottom -width 6 \
    585         -textvariable [itcl::scope _settings($this-layout-bottommargin)]
     585        -textvariable [itcl::scope _settings($this-layout-bottommargin)]
    586586    bind  $page.bottom <KeyPress-Return> [itcl::code $this ApplyLayoutSettings]
    587587    Rappture::Tooltip::for $page.bottom \
     
    591591    label $page.map -image [Rappture::icon graphmargins]
    592592    blt::table $page \
    593         0,0 $page.width_l -anchor e \
    594         0,1 $page.width -fill x  \
    595         1,0 $page.height_l -anchor e \
    596         1,1 $page.height -fill x \
    597         3,0 $page.left_l -anchor e \
    598         3,1 $page.left -fill x  \
    599         4,0 $page.right_l -anchor e \
    600         4,1 $page.right -fill x \
    601         5,0 $page.top_l -anchor e \
    602         5,1 $page.top -fill x \
    603         6,0 $page.bottom_l -anchor e \
    604         6,1 $page.bottom -fill x  \
    605         0,2 $page.map -fill both -rspan 7 -padx 2
     593        0,0 $page.width_l -anchor e \
     594        0,1 $page.width -fill x  \
     595        1,0 $page.height_l -anchor e \
     596        1,1 $page.height -fill x \
     597        3,0 $page.left_l -anchor e \
     598        3,1 $page.left -fill x  \
     599        4,0 $page.right_l -anchor e \
     600        4,1 $page.right -fill x \
     601        5,0 $page.top_l -anchor e \
     602        5,1 $page.top -fill x \
     603        6,0 $page.bottom_l -anchor e \
     604        6,1 $page.bottom -fill x  \
     605        0,2 $page.map -fill both -rspan 7 -padx 2
    606606
    607607    blt::table configure $page c0 r* -resize none
     
    612612itcl::body Rappture::XyPrint::BuildGeneralTab {} {
    613613    itk_component add graph_page {
    614         frame $itk_component(tabs).graph_page
     614        frame $itk_component(tabs).graph_page
    615615    }
    616616    set page $itk_component(graph_page)
     
    621621    Rappture::Combobox $page.format -width 30 -editable no
    622622    $page.format choices insert end \
    623         "pdf" "PDF Portable Document Format" \
    624         "ps"  "PS PostScript Format"  \
    625         "eps" "EPS Encapsulated PostScript"  \
    626         "jpg" "JPEG Joint Photographic Experts Group Format" \
    627         "png" "PNG Portable Network Graphics Format"         
     623        "pdf" "PDF Portable Document Format" \
     624        "ps"  "PS PostScript Format"  \
     625        "eps" "EPS Encapsulated PostScript"  \
     626        "jpg" "JPEG Joint Photographic Experts Group Format" \
     627        "png" "PNG Portable Network Graphics Format"         
    628628
    629629    bind $page.format <<Value>> [itcl::code $this ApplyGeneralSettings]
     
    634634    Rappture::Combobox $page.style -width 20 -editable no
    635635    $page.style choices insert end \
    636         "ieee" "IEEE Journal"  \
    637         "gekco" "G Klimeck" 
     636        "ieee" "IEEE Journal"  \
     637        "gekco" "G Klimeck" 
    638638    bind $page.style <<Value>> [itcl::code $this ApplyGeneralSettings]
    639639    Rappture::Tooltip::for $page.format \
     
    641641
    642642    checkbutton $page.remember -text "remember settings" \
    643         -variable [itcl::scope _settings($this-general-remember)] 
     643        -variable [itcl::scope _settings($this-general-remember)] 
    644644    Rappture::Tooltip::for $page.remember \
    645645        "Remember the settings. They will be override the default settings."
    646646
    647647    button $page.revert -text "revert" -image [Rappture::icon revert] \
    648         -compound left -padx 3 -pady 1 -overrelief raised -relief flat \
    649         -command [itcl::code $this ResetSettings]
     648        -compound left -padx 3 -pady 1 -overrelief raised -relief flat \
     649        -command [itcl::code $this ResetSettings]
    650650    Rappture::Tooltip::for $page.revert \
    651651        "Revert to the default settings."
    652652
    653653    blt::table $page \
    654         2,0 $page.format_l -anchor e \
    655         2,1 $page.format -fill x -cspan 2 \
    656         3,0 $page.style_l -anchor e \
    657         3,1 $page.style -fill x -cspan 2 \
    658         5,0 $page.remember -cspan 2 -anchor w \
    659         5,2 $page.revert -anchor e
     654        2,0 $page.format_l -anchor e \
     655        2,1 $page.format -fill x -cspan 2 \
     656        3,0 $page.style_l -anchor e \
     657        3,1 $page.style -fill x -cspan 2 \
     658        5,0 $page.remember -cspan 2 -anchor w \
     659        5,2 $page.revert -anchor e
    660660    blt::table configure $page r* -resize none  -pady { 0 2 }
    661661    blt::table configure $page r4 -resize both
     
    668668    set _settings($this-legend-anchor)    [$page.anchor current]
    669669    foreach option { -hide -position -anchor -borderwidth } {
    670         SetComponentOption legend $option
     670        SetComponentOption legend $option
    671671    }
    672672    $_clone legend configure -font legend
     
    676676itcl::body Rappture::XyPrint::BuildLegendTab {} {
    677677    itk_component add legend_page {
    678         frame $itk_component(tabs).legend_page
     678        frame $itk_component(tabs).legend_page
    679679    }
    680680    set page $itk_component(legend_page)
     
    683683
    684684    checkbutton $page.show -text "show legend" \
    685         -offvalue 1 -onvalue 0 \
    686         -variable [itcl::scope _settings($this-legend-hide)]  \
    687         -command [itcl::code $this ApplyLegendSettings]
     685        -offvalue 1 -onvalue 0 \
     686        -variable [itcl::scope _settings($this-legend-hide)]  \
     687        -command [itcl::code $this ApplyLegendSettings]
    688688    Rappture::Tooltip::for $page.show \
    689689        "Display the legend."
     
    692692    Rappture::Combobox $page.position -width 15 -editable no
    693693    $page.position choices insert end \
    694         "leftmargin" "left margin"  \
    695         "rightmargin" "right margin"  \
    696         "bottommargin" "bottom margin"  \
    697         "topmargin" "top margin"  \
    698         "plotarea" "inside plot"
     694        "leftmargin" "left margin"  \
     695        "rightmargin" "right margin"  \
     696        "bottommargin" "bottom margin"  \
     697        "topmargin" "top margin"  \
     698        "plotarea" "inside plot"
    699699    bind $page.position <<Value>> [itcl::code $this ApplyLegendSettings]
    700700    Rappture::Tooltip::for $page.position \
     
    703703    Rappture::Combobox $page.anchor -width 10 -editable no
    704704    $page.anchor choices insert end \
    705         "nw" "northwest"  \
    706         "n" "north"  \
    707         "ne" "northeast"  \
    708         "sw" "southwest"  \
    709         "s" "south"  \
    710         "se" "southeast"  \
    711         "c" "center"  \
    712         "e" "east"  \
    713         "w" "west" 
     705        "nw" "northwest"  \
     706        "n" "north"  \
     707        "ne" "northeast"  \
     708        "sw" "southwest"  \
     709        "s" "south"  \
     710        "se" "southeast"  \
     711        "c" "center"  \
     712        "e" "east"  \
     713        "w" "west" 
    714714    bind $page.anchor <<Value>> [itcl::code $this ApplyLegendSettings]
    715715    Rappture::Tooltip::for $page.anchor \
     
    717717
    718718    checkbutton $page.border -text "border" \
    719         -variable [itcl::scope _settings($this-legend-borderwidth)] \
    720         -onvalue 1 -offvalue 0 \
    721         -command [itcl::code $this ApplyLegendSettings]
     719        -variable [itcl::scope _settings($this-legend-borderwidth)] \
     720        -onvalue 1 -offvalue 0 \
     721        -command [itcl::code $this ApplyLegendSettings]
    722722    Rappture::Tooltip::for $page.border \
    723723        "Display a solid border around the legend."
     
    725725    label $page.slider_l -text "legend\nentry"  -justify right
    726726    itk_component add element_slider {
    727         ::scale $page.slider -from 1 -to 1 \
    728             -orient horizontal -width 12 \
    729             -command [itcl::code $this GetElement]
     727        ::scale $page.slider -from 1 -to 1 \
     728            -orient horizontal -width 12 \
     729            -command [itcl::code $this GetElement]
    730730    }
    731731    Rappture::Tooltip::for $page.slider \
     
    734734    label $page.label_l -text "label"
    735735    entry $page.label \
    736         -background white \
    737         -textvariable [itcl::scope _settings($this-element-label)]
     736        -background white \
     737        -textvariable [itcl::scope _settings($this-element-label)]
    738738    bind  $page.label <KeyPress-Return> [itcl::code $this ApplyElementSettings]
    739739    Rappture::Tooltip::for $page.label \
     
    743743    Rappture::Combobox $page.color -width 15 -editable no
    744744    $page.color choices insert end \
    745         "#000000" "black" \
    746         "#ffffff" "white" \
    747         "#0000cd" "blue" \
    748         "#cd0000" "red" \
    749         "#00cd00" "green" \
    750         "#3a5fcd" "royal blue" \
     745        "#000000" "black" \
     746        "#ffffff" "white" \
     747        "#0000cd" "blue" \
     748        "#cd0000" "red" \
     749        "#00cd00" "green" \
     750        "#3a5fcd" "royal blue" \
    751751        "#cdcd00" "yellow" \
    752752        "#cd1076" "deep pink" \
    753753        "#009acd" "deep sky blue" \
    754         "#00c5cd" "torquise" \
     754        "#00c5cd" "torquise" \
    755755        "#a2b5cd" "light steel blue" \
    756         "#7ac5cd" "cadet blue" \
    757         "#66cdaa" "aquamarine" \
    758         "#a2cd5a" "dark olive green" \
     756        "#7ac5cd" "cadet blue" \
     757        "#66cdaa" "aquamarine" \
     758        "#a2cd5a" "dark olive green" \
    759759        "#cd9b9b" "rosy brown" \
    760         "#0000ff" "blue1" \
    761         "#ff0000" "red1" \
    762         "#00ff00" "green1"
     760        "#0000ff" "blue1" \
     761        "#ff0000" "red1" \
     762        "#00ff00" "green1"
    763763    bind $page.color <<Value>> [itcl::code $this ApplyElementSettings]
    764764    Rappture::Tooltip::for $page.color \
     
    768768    Rappture::Combobox $page.dashes -width 15 -editable no
    769769    $page.dashes choices insert end \
    770         "" "solid"  \
     770        "" "solid"  \
    771771        "1" "dot" \
    772772        "5 2" "dash" \
     
    780780    Rappture::Combobox $page.symbol -editable no
    781781    $page.symbol choices insert end \
    782         "none" "none"  \
    783         "square" "square" \
    784         "circle" "circle" \
    785         "diamond" "diamond" \
    786         "plus" "plus" \
    787         "cross" "cross" \
    788         "splus" "skinny plus"  \
    789         "scross" "skinny cross" \
    790         "triangle" "triangle"
     782        "none" "none"  \
     783        "square" "square" \
     784        "circle" "circle" \
     785        "diamond" "diamond" \
     786        "plus" "plus" \
     787        "cross" "cross" \
     788        "splus" "skinny plus"  \
     789        "scross" "skinny cross" \
     790        "triangle" "triangle"
    791791    bind $page.symbol <<Value>> [itcl::code $this ApplyElementSettings]
    792792    Rappture::Tooltip::for $page.symbol \
     
    796796    Rappture::Combobox $page.fontfamily -width 10 -editable no
    797797    $page.fontfamily choices insert end \
    798         "courier" "courier" \
    799         "helvetica" "helvetica"  \
    800         "new*century*schoolbook"  "new century schoolbook" \
    801         "symbol"  "symbol" \
    802         "times"  "times"         
     798        "courier" "courier" \
     799        "helvetica" "helvetica"  \
     800        "new*century*schoolbook"  "new century schoolbook" \
     801        "symbol"  "symbol" \
     802        "times"  "times"         
    803803    bind $page.fontfamily <<Value>> [itcl::code $this ApplyLegendSettings]
    804804    Rappture::Tooltip::for $page.fontfamily \
     
    807807    Rappture::Combobox $page.fontsize -width 4 -editable no
    808808    $page.fontsize choices insert end \
    809         "8" "8" \
    810         "9" "9" \
    811         "10" "10" \
    812         "11" "11" \
    813         "12" "12" \
    814         "14" "14" \
    815         "17" "17" \
    816         "18" "18" \
    817         "20" "20"
     809        "8" "8" \
     810        "9" "9" \
     811        "10" "10" \
     812        "11" "11" \
     813        "12" "12" \
     814        "14" "14" \
     815        "17" "17" \
     816        "18" "18" \
     817        "20" "20"
    818818    bind  $page.fontsize <<Value>> [itcl::code $this ApplyLegendSettings]
    819819    Rappture::Tooltip::for $page.fontsize \
     
    821821
    822822    Rappture::PushButton $page.fontweight \
    823         -width 18 -height 18 \
    824         -onimage [Rappture::icon font-bold] \
    825         -offimage [Rappture::icon font-bold] \
    826         -onvalue "bold" -offvalue "normal" \
    827         -command [itcl::code $this ApplyLegendSettings] \
    828         -variable [itcl::scope _settings($this-legend-font-weight)]
     823        -width 18 -height 18 \
     824        -onimage [Rappture::icon font-bold] \
     825        -offimage [Rappture::icon font-bold] \
     826        -onvalue "bold" -offvalue "normal" \
     827        -command [itcl::code $this ApplyLegendSettings] \
     828        -variable [itcl::scope _settings($this-legend-font-weight)]
    829829    Rappture::Tooltip::for $page.fontweight \
    830830        "Use the bold version of the font."
    831831
    832832    Rappture::PushButton $page.fontslant \
    833         -width 18 -height 18 \
    834         -onimage [Rappture::icon font-italic] \
    835         -offimage [Rappture::icon font-italic] \
    836         -onvalue "italic" -offvalue "roman" \
    837         -command [itcl::code $this ApplyLegendSettings] \
    838         -variable [itcl::scope _settings($this-legend-font-slant)]
     833        -width 18 -height 18 \
     834        -onimage [Rappture::icon font-italic] \
     835        -offimage [Rappture::icon font-italic] \
     836        -onvalue "italic" -offvalue "roman" \
     837        -command [itcl::code $this ApplyLegendSettings] \
     838        -variable [itcl::scope _settings($this-legend-font-slant)]
    839839    Rappture::Tooltip::for $page.fontslant \
    840840        "Use the italic version of the font."
    841841
    842842    blt::table $page \
    843         1,0 $page.show -cspan 2 -anchor w \
    844         1,2 $page.border -cspan 2 -anchor w \
    845         2,0 $page.position_l -anchor e \
    846         2,1 $page.position -fill x \
    847         2,2 $page.anchor -fill x  -cspan 3 \
    848         3,0 $page.font_l -anchor e \
    849         3,1 $page.fontfamily -fill x \
    850         3,2 $page.fontsize -fill x \
    851         3,3 $page.fontweight -anchor e \
    852         3,4 $page.fontslant -anchor e \
    853         4,0 $page.slider_l -anchor e \
    854         4,1 $page.slider -fill x -cspan 5 \
    855         5,0 $page.label_l -anchor e \
    856         5,1 $page.label -fill x -cspan 5 \
    857         6,0 $page.color_l -anchor e \
    858         6,1 $page.color -fill x \
    859         6,2 $page.symbol_l -anchor e \
    860         6,3 $page.symbol -fill both -cspan 3 \
    861         7,0 $page.dashes_l -anchor e \
    862         7,1 $page.dashes -fill x \
     843        1,0 $page.show -cspan 2 -anchor w \
     844        1,2 $page.border -cspan 2 -anchor w \
     845        2,0 $page.position_l -anchor e \
     846        2,1 $page.position -fill x \
     847        2,2 $page.anchor -fill x  -cspan 3 \
     848        3,0 $page.font_l -anchor e \
     849        3,1 $page.fontfamily -fill x \
     850        3,2 $page.fontsize -fill x \
     851        3,3 $page.fontweight -anchor e \
     852        3,4 $page.fontslant -anchor e \
     853        4,0 $page.slider_l -anchor e \
     854        4,1 $page.slider -fill x -cspan 5 \
     855        5,0 $page.label_l -anchor e \
     856        5,1 $page.label -fill x -cspan 5 \
     857        6,0 $page.color_l -anchor e \
     858        6,1 $page.color -fill x \
     859        6,2 $page.symbol_l -anchor e \
     860        6,3 $page.symbol -fill both -cspan 3 \
     861        7,0 $page.dashes_l -anchor e \
     862        7,1 $page.dashes -fill x \
    863863
    864864    blt::table configure $page r* -resize none -pady { 0 2 }
     
    869869itcl::body Rappture::XyPrint::BuildAxisTab {} {
    870870    itk_component add axis_page {
    871         frame $itk_component(tabs).axis_page
     871        frame $itk_component(tabs).axis_page
    872872    }
    873873    set page $itk_component(axis_page)
     
    877877    label $page.axis_l -text "axis"
    878878    itk_component add axis_combo {
    879         Rappture::Combobox $page.axis -width 20 -editable no
     879        Rappture::Combobox $page.axis -width 20 -editable no
    880880    }
    881881    bind $itk_component(axis_combo) <<Value>> [itcl::code $this GetAxis]
     
    885885    label $page.title_l -text "title"
    886886    entry $page.title \
    887         -textvariable [itcl::scope _settings($this-axis-title)]
     887        -textvariable [itcl::scope _settings($this-axis-title)]
    888888    bind  $page.title <KeyPress-Return> [itcl::code $this ApplyAxisSettings]
    889889    Rappture::Tooltip::for $page.title \
     
    892892    label $page.min_l -text "min"
    893893    entry $page.min -width 10 \
    894         -textvariable [itcl::scope _settings($this-axis-min)]
     894        -textvariable [itcl::scope _settings($this-axis-min)]
    895895    bind  $page.min <KeyPress-Return> [itcl::code $this ApplyAxisSettings]
    896896    Rappture::Tooltip::for $page.min \
     
    899899    label $page.max_l -text "max"
    900900    entry $page.max -width 10 \
    901         -textvariable [itcl::scope _settings($this-axis-max)]
     901        -textvariable [itcl::scope _settings($this-axis-max)]
    902902    bind  $page.max <KeyPress-Return> [itcl::code $this ApplyAxisSettings]
    903903    Rappture::Tooltip::for $page.max \
     
    906906    label $page.subdivisions_l -text "subdivisions"
    907907    entry $page.subdivisions \
    908         -textvariable [itcl::scope _settings($this-axis-subdivisions)]
     908        -textvariable [itcl::scope _settings($this-axis-subdivisions)]
    909909    bind  $page.subdivisions <KeyPress-Return> \
    910         [itcl::code $this ApplyAxisSettings]
     910        [itcl::code $this ApplyAxisSettings]
    911911    Rappture::Tooltip::for $page.subdivisions \
    912912        "Set the number of subdivisions (minor ticks) for the current axis."
     
    914914    label $page.stepsize_l -text "step size"
    915915    entry $page.stepsize \
    916         -textvariable [itcl::scope _settings($this-axis-stepsize)]
     916        -textvariable [itcl::scope _settings($this-axis-stepsize)]
    917917    bind  $page.stepsize <KeyPress-Return> [itcl::code $this ApplyAxisSettings]
    918918    Rappture::Tooltip::for $page.stepsize \
     
    920920
    921921    checkbutton $page.loose -text "loose limits" \
    922         -onvalue "always" -offvalue "0" \
    923         -variable [itcl::scope _settings($this-axis-loose)] \
    924         -command [itcl::code $this ApplyAxisSettings]
     922        -onvalue "always" -offvalue "0" \
     923        -variable [itcl::scope _settings($this-axis-loose)] \
     924        -command [itcl::code $this ApplyAxisSettings]
    925925    Rappture::Tooltip::for $page.loose \
    926926        "Set major ticks outside of the limits for the current axis."
     
    928928    label $page.plotpad_l -text "pad" 
    929929    entry $page.plotpad -width 6 \
    930         -textvariable [itcl::scope _settings($this-axis-plotpad)]
     930        -textvariable [itcl::scope _settings($this-axis-plotpad)]
    931931    bind  $page.plotpad <KeyPress-Return> [itcl::code $this ApplyAxisSettings]
    932932    Rappture::Tooltip::for $page.plotpad \
     
    934934
    935935    checkbutton $page.grid -text "show grid lines" \
    936         -variable [itcl::scope _settings($this-axis-grid)] \
    937         -command [itcl::code $this ApplyAxisSettings]
     936        -variable [itcl::scope _settings($this-axis-grid)] \
     937        -command [itcl::code $this ApplyAxisSettings]
    938938    Rappture::Tooltip::for $page.grid \
    939939        "Display grid lines for the current axis."
    940940
    941941    checkbutton $page.zero -text "mark zero" \
    942         -offvalue 1 -onvalue 0 \
    943         -variable [itcl::scope _settings($this-axis-zero)] \
    944         -command [itcl::code $this ApplyAxisSettings]
     942        -offvalue 1 -onvalue 0 \
     943        -variable [itcl::scope _settings($this-axis-zero)] \
     944        -command [itcl::code $this ApplyAxisSettings]
    945945    Rappture::Tooltip::for $page.zero \
    946946        "Display a line at zero for the current axis."
     
    949949    Rappture::Combobox $page.tickfontfamily -width 10 -editable no
    950950    $page.tickfontfamily choices insert end \
    951         "courier" "courier" \
    952         "helvetica" "helvetica"  \
    953         "new*century*schoolbook"  "new century schoolbook" \
    954         "symbol"  "symbol" \
    955         "times"  "times"         
     951        "courier" "courier" \
     952        "helvetica" "helvetica"  \
     953        "new*century*schoolbook"  "new century schoolbook" \
     954        "symbol"  "symbol" \
     955        "times"  "times"         
    956956    bind $page.tickfontfamily <<Value>> [itcl::code $this ApplyAxisSettings]
    957957    Rappture::Tooltip::for $page.tickfontfamily \
     
    960960    Rappture::Combobox $page.tickfontsize -width 4 -editable no
    961961    $page.tickfontsize choices insert end \
    962         "8" "8" \
    963         "9" "9" \
    964         "10" "10" \
    965         "11" "11" \
    966         "12" "12" \
    967         "14" "14" \
    968         "17" "17" \
    969         "18" "18" \
    970         "20" "20"
     962        "8" "8" \
     963        "9" "9" \
     964        "10" "10" \
     965        "11" "11" \
     966        "12" "12" \
     967        "14" "14" \
     968        "17" "17" \
     969        "18" "18" \
     970        "20" "20"
    971971    bind $page.tickfontsize <<Value>> [itcl::code $this ApplyAxisSettings]
    972972    Rappture::Tooltip::for $page.tickfontsize \
     
    974974
    975975    Rappture::PushButton $page.tickfontweight \
    976         -width 18 -height 18 \
    977         -onimage [Rappture::icon font-bold] \
    978         -offimage [Rappture::icon font-bold] \
    979         -onvalue "bold" -offvalue "normal" \
    980         -command [itcl::code $this ApplyAxisSettings] \
    981         -variable [itcl::scope _settings($this-axis-tickfont-weight)]
     976        -width 18 -height 18 \
     977        -onimage [Rappture::icon font-bold] \
     978        -offimage [Rappture::icon font-bold] \
     979        -onvalue "bold" -offvalue "normal" \
     980        -command [itcl::code $this ApplyAxisSettings] \
     981        -variable [itcl::scope _settings($this-axis-tickfont-weight)]
    982982    Rappture::Tooltip::for $page.tickfontweight \
    983983        "Use the bold version of the tick font."
    984984
    985985    Rappture::PushButton $page.tickfontslant \
    986         -width 18 -height 18 \
    987         -onimage [Rappture::icon font-italic] \
    988         -offimage [Rappture::icon font-italic] \
    989         -onvalue "italic" -offvalue "roman" \
    990         -command [itcl::code $this ApplyAxisSettings] \
    991         -variable [itcl::scope _settings($this-axis-tickfont-slant)]
     986        -width 18 -height 18 \
     987        -onimage [Rappture::icon font-italic] \
     988        -offimage [Rappture::icon font-italic] \
     989        -onvalue "italic" -offvalue "roman" \
     990        -command [itcl::code $this ApplyAxisSettings] \
     991        -variable [itcl::scope _settings($this-axis-tickfont-slant)]
    992992    Rappture::Tooltip::for $page.tickfontslant \
    993993        "Use the italic version of the tick font."
     
    996996    Rappture::Combobox $page.titlefontfamily -width 10 -editable no
    997997    $page.titlefontfamily choices insert end \
    998         "courier" "courier" \
    999         "helvetica" "helvetica"  \
    1000         "new*century*schoolbook"  "new century schoolbook" \
    1001         "symbol"  "symbol" \
    1002         "times"  "times"         
     998        "courier" "courier" \
     999        "helvetica" "helvetica"  \
     1000        "new*century*schoolbook"  "new century schoolbook" \
     1001        "symbol"  "symbol" \
     1002        "times"  "times"         
    10031003    bind $page.titlefontfamily <<Value>> [itcl::code $this ApplyAxisSettings]
    10041004    Rappture::Tooltip::for $page.titlefontfamily \
     
    10071007    Rappture::Combobox $page.titlefontsize -width 4 -editable no
    10081008    $page.titlefontsize choices insert end \
    1009         "8" "8" \
    1010         "9" "9" \
    1011         "10" "10" \
    1012         "11" "11" \
    1013         "12" "12" \
    1014         "14" "14" \
    1015         "17" "17" \
    1016         "18" "18" \
    1017         "20" "20"
     1009        "8" "8" \
     1010        "9" "9" \
     1011        "10" "10" \
     1012        "11" "11" \
     1013        "12" "12" \
     1014        "14" "14" \
     1015        "17" "17" \
     1016        "18" "18" \
     1017        "20" "20"
    10181018    bind $page.titlefontsize <<Value>> [itcl::code $this ApplyAxisSettings]
    10191019    Rappture::Tooltip::for $page.titlefontsize \
     
    10211021
    10221022    Rappture::PushButton $page.titlefontweight \
    1023         -width 18 -height 18 \
    1024         -onimage [Rappture::icon font-bold] \
    1025         -offimage [Rappture::icon font-bold] \
    1026         -onvalue "bold" -offvalue "normal" \
    1027         -command [itcl::code $this ApplyAxisSettings] \
    1028         -variable [itcl::scope _settings($this-axis-titlefont-weight)]
     1023        -width 18 -height 18 \
     1024        -onimage [Rappture::icon font-bold] \
     1025        -offimage [Rappture::icon font-bold] \
     1026        -onvalue "bold" -offvalue "normal" \
     1027        -command [itcl::code $this ApplyAxisSettings] \
     1028        -variable [itcl::scope _settings($this-axis-titlefont-weight)]
    10291029    Rappture::Tooltip::for $page.titlefontweight \
    10301030        "Use the bold version of the title font."
    10311031
    10321032    Rappture::PushButton $page.titlefontslant \
    1033         -width 18 -height 18 \
    1034         -onimage [Rappture::icon font-italic] \
    1035         -offimage [Rappture::icon font-italic] \
    1036         -onvalue "italic" -offvalue "roman" \
    1037         -command [itcl::code $this ApplyAxisSettings] \
    1038         -variable [itcl::scope _settings($this-axis-titlefont-slant)]
     1033        -width 18 -height 18 \
     1034        -onimage [Rappture::icon font-italic] \
     1035        -offimage [Rappture::icon font-italic] \
     1036        -onvalue "italic" -offvalue "roman" \
     1037        -command [itcl::code $this ApplyAxisSettings] \
     1038        -variable [itcl::scope _settings($this-axis-titlefont-slant)]
    10391039    Rappture::Tooltip::for $page.titlefontslant \
    10401040        "Use the italic version of the title font."
    10411041
    10421042    blt::table $page \
    1043         1,1 $page.axis_l -anchor e  -pady 6 \
    1044         1,2 $page.axis -fill x -cspan 6 \
    1045         2,1 $page.title_l -anchor e \
    1046         2,2 $page.title -fill x -cspan 5 \
    1047         3,1 $page.min_l -anchor e \
    1048         3,2 $page.min -fill x \
    1049         3,3 $page.stepsize_l -anchor e \
    1050         3,4 $page.stepsize -fill both -cspan 3 \
    1051         4,1 $page.max_l -anchor e \
    1052         4,2 $page.max -fill both \
    1053         4,3 $page.subdivisions_l -anchor e \
    1054         4,4 $page.subdivisions -fill both -cspan 3  \
    1055         5,1 $page.titlefont_l -anchor e \
    1056         5,2 $page.titlefontfamily -fill x -cspan 2 \
    1057         5,4 $page.titlefontsize -fill x \
    1058         5,5 $page.titlefontweight -anchor e \
    1059         5,6 $page.titlefontslant -anchor e \
    1060         6,1 $page.tickfont_l -anchor e \
    1061         6,2 $page.tickfontfamily -fill x -cspan 2 \
    1062         6,4 $page.tickfontsize -fill x \
    1063         6,5 $page.tickfontweight -anchor e \
    1064         6,6 $page.tickfontslant -anchor e \
    1065         7,1 $page.loose -cspan 2 -anchor w \
    1066         7,3 $page.grid -anchor w -cspan 2 \
    1067         8,1 $page.zero -cspan 2 -anchor w \
    1068         8,3 $page.plotpad_l -anchor e \
    1069         8,4 $page.plotpad -fill both -cspan 3
     1043        1,1 $page.axis_l -anchor e  -pady 6 \
     1044        1,2 $page.axis -fill x -cspan 6 \
     1045        2,1 $page.title_l -anchor e \
     1046        2,2 $page.title -fill x -cspan 5 \
     1047        3,1 $page.min_l -anchor e \
     1048        3,2 $page.min -fill x \
     1049        3,3 $page.stepsize_l -anchor e \
     1050        3,4 $page.stepsize -fill both -cspan 3 \
     1051        4,1 $page.max_l -anchor e \
     1052        4,2 $page.max -fill both \
     1053        4,3 $page.subdivisions_l -anchor e \
     1054        4,4 $page.subdivisions -fill both -cspan 3  \
     1055        5,1 $page.titlefont_l -anchor e \
     1056        5,2 $page.titlefontfamily -fill x -cspan 2 \
     1057        5,4 $page.titlefontsize -fill x \
     1058        5,5 $page.titlefontweight -anchor e \
     1059        5,6 $page.titlefontslant -anchor e \
     1060        6,1 $page.tickfont_l -anchor e \
     1061        6,2 $page.tickfontfamily -fill x -cspan 2 \
     1062        6,4 $page.tickfontsize -fill x \
     1063        6,5 $page.tickfontweight -anchor e \
     1064        6,6 $page.tickfontslant -anchor e \
     1065        7,1 $page.loose -cspan 2 -anchor w \
     1066        7,3 $page.grid -anchor w -cspan 2 \
     1067        8,1 $page.zero -cspan 2 -anchor w \
     1068        8,3 $page.plotpad_l -anchor e \
     1069        8,4 $page.plotpad -fill both -cspan 3
    10701070
    10711071    blt::table configure $page  c0 c7 c8 -resize none
     
    10821082
    10831083    foreach option { -hide -position -anchor -borderwidth } {
    1084         SetComponentOption legend $option
     1084        SetComponentOption legend $option
    10851085    }
    10861086    font configure $_fonts(legend) \
    1087         -family [$page.fontfamily current] \
    1088         -size [$page.fontsize current] \
    1089         -weight $_settings($this-legend-font-weight) \
    1090         -slant $_settings($this-legend-font-slant)
     1087        -family [$page.fontfamily current] \
     1088        -size [$page.fontsize current] \
     1089        -weight $_settings($this-legend-font-weight) \
     1090        -slant $_settings($this-legend-font-slant)
    10911091    $_clone legend configure -font fixed -font $_fonts(legend)
    10921092    ApplyElementSettings
     
    10981098    set page $itk_component(axis_page)
    10991099    if { $_settings($this-axis-grid) } {
    1100         $_clone grid configure -hide no -map${type} ${axis}
     1100        $_clone grid configure -hide no -map${type} ${axis}
    11011101    } else {
    1102         $_clone grid configure -hide no -map${type} ""
     1102        $_clone grid configure -hide no -map${type} ""
    11031103    }
    11041104    $_clone configure -plotpad${type} $_settings($this-axis-plotpad)
    11051105    foreach option { -min -max -loose -title -stepsize -subdivisions } {
    1106         SetNamedComponentOption axis $axis $option
     1106        SetNamedComponentOption axis $axis $option
    11071107    }
    11081108    $_clone marker configure ${type}-zero -hide $_settings($this-axis-zero)
    11091109    font configure $axis-title \
    1110         -family [$page.titlefontfamily current] \
    1111         -size   [$page.titlefontsize current] \
    1112         -weight $_settings($this-axis-titlefont-weight) \
    1113         -slant  $_settings($this-axis-titlefont-slant)
     1110        -family [$page.titlefontfamily current] \
     1111        -size   [$page.titlefontsize current] \
     1112        -weight $_settings($this-axis-titlefont-weight) \
     1113        -slant  $_settings($this-axis-titlefont-slant)
    11141114    font configure $axis-ticks \
    1115         -family [$page.tickfontfamily current] \
    1116         -size   [$page.tickfontsize current] \
    1117         -weight $_settings($this-axis-tickfont-weight) \
    1118         -slant  $_settings($this-axis-tickfont-slant)
     1115        -family [$page.tickfontfamily current] \
     1116        -size   [$page.tickfontsize current] \
     1117        -weight $_settings($this-axis-tickfont-weight) \
     1118        -slant  $_settings($this-axis-tickfont-slant)
    11191119    $_clone axis configure $axis -tickfont $axis-ticks -titlefont $axis-title
    11201120    GetAxis
     
    11301130    set _settings($this-element-dashes) [$page.dashes current]
    11311131    foreach option { -symbol -color -dashes -label } {
    1132         SetNamedComponentOption element $elem $option
     1132        SetNamedComponentOption element $elem $option
    11331133    }
    11341134    RegeneratePreview
     
    11421142itcl::body Rappture::XyPrint::ApplyLayoutSettings {} {
    11431143    foreach opt { -width -height -leftmargin -rightmargin -topmargin
    1144         -bottommargin } {
    1145         set old [$_clone cget $opt]
    1146         set code [catch { SetLayoutOption $opt } err]
    1147         if { $code != 0 } {
    1148             bell
    1149             global errorInfo
    1150             puts stderr "$err: $errorInfo"
    1151             set _settings($this-layout$opt) [Pixels2Inches $old]
    1152             $_clone configure $opt [Pixels2Inches $old]
    1153         }
     1144        -bottommargin } {
     1145        set old [$_clone cget $opt]
     1146        set code [catch { SetLayoutOption $opt } err]
     1147        if { $code != 0 } {
     1148            bell
     1149            global errorInfo
     1150            puts stderr "$err: $errorInfo"
     1151            set _settings($this-layout$opt) [Pixels2Inches $old]
     1152            $_clone configure $opt [Pixels2Inches $old]
     1153        }
    11541154    }
    11551155    RegeneratePreview
     
    11721172    set _settings($this-layout-height) [Pixels2Inches [$_clone cget -height]]
    11731173    set _settings($this-layout-leftmargin) \
    1174         [Pixels2Inches [$_clone cget -leftmargin]]
     1174        [Pixels2Inches [$_clone cget -leftmargin]]
    11751175    set _settings($this-layout-rightmargin) \
    1176         [Pixels2Inches [$_clone cget -rightmargin]]
     1176        [Pixels2Inches [$_clone cget -rightmargin]]
    11771177    set _settings($this-layout-topmargin) \
    1178         [Pixels2Inches [$_clone cget -topmargin]]
     1178        [Pixels2Inches [$_clone cget -topmargin]]
    11791179    set _settings($this-layout-bottommargin) \
    1180         [Pixels2Inches [$_clone cget -bottommargin]]
     1180        [Pixels2Inches [$_clone cget -bottommargin]]
    11811181
    11821182    # Legend settings
     
    12001200    set _settings($this-legend-font-slant) $info(-slant)
    12011201    if { $info(-weight) == "bold" } {
    1202         set _settings($this-legend-font-bold) 1
     1202        set _settings($this-legend-font-bold) 1
    12031203    }
    12041204    set _settings($this-legend-hide) [$_clone legend cget -hide]
     
    12061206    set _settings($this-legend-anchor) [$_clone legend cget -anchor]
    12071207    $page.position value \
    1208         [$page.position label $_settings($this-legend-position)]
     1208        [$page.position label $_settings($this-legend-position)]
    12091209    $page.anchor value [$page.anchor label $_settings($this-legend-anchor)]
    12101210    GetElement
     
    12151215    $itk_component(axis_combo) choices delete 0 end
    12161216    foreach axis $names {
    1217         if { ![$_clone axis cget $axis -hide] } {
    1218             $itk_component(axis_combo) choices insert end $axis $axis
    1219         }
    1220         lappend axisnames $axis
     1217        if { ![$_clone axis cget $axis -hide] } {
     1218            $itk_component(axis_combo) choices insert end $axis $axis
     1219        }
     1220        lappend axisnames $axis
    12211221    }
    12221222    set axis [lindex $names 0]
     
    12511251itcl::body Rappture::XyPrint::RestoreSettings { toolName plotName } {
    12521252    if { ![file readable $_settingsFile] } {
    1253         return;                         # No file or not readable
     1253        return;                         # No file or not readable
    12541254    }
    12551255    if { [file exists $_oldSettingsFile] } {
    1256         file delete $_oldSettingsFile
     1256        file delete $_oldSettingsFile
    12571257    }
    12581258    # Read the file by sourcing it into a safe interpreter The only commands
     
    12711271    set key [list $toolName $plotName]
    12721272    if { [info exists _savedSettings($key)] }  {
    1273         $parser alias "preview" $_clone
    1274         $parser eval $_savedSettings($key)
     1273        $parser alias "preview" $_clone
     1274        $parser eval $_savedSettings($key)
    12751275    }
    12761276    foreach {name value} [$parser eval "array get general"] {
    1277         set _settings($this-graph-$name) $value
     1277        set _settings($this-graph-$name) $value
    12781278    }
    12791279    interp delete $parser
     
    12911291itcl::body Rappture::XyPrint::SaveSettings { toolName plotName } {
    12921292    if { !$_settings($this-general-remember) } {
    1293         return
     1293        return
    12941294    }
    12951295    if { [catch { open $_settingsFile "w" 0600 } f ] != 0 } {
    1296         puts stderr "$_settingsFile isn't writable: $f"
    1297         bell
    1298         return
     1296        puts stderr "$_settingsFile isn't writable: $f"
     1297        bell
     1298        return
    12991299    }
    13001300    set key [list $toolName $plotName]
     
    13021302    # Write the settings out
    13031303    foreach key [lsort [array names _savedSettings]] {
    1304         set tool [lindex $key 0]
    1305         set plot [lindex $key 1]
    1306         puts $f "xyprint \"$tool\" \"$plot\" \{"
    1307         set settings [string trim $_savedSettings($key) \n]
    1308         puts $f "$settings"
    1309         puts $f "\}\n"
     1304        set tool [lindex $key 0]
     1305        set plot [lindex $key 1]
     1306        puts $f "xyprint \"$tool\" \"$plot\" \{"
     1307        set settings [string trim $_savedSettings($key) \n]
     1308        puts $f "$settings"
     1309        puts $f "\}\n"
    13101310    }
    13111311    close $f
     
    13191319
    13201320    foreach font [array names _fonts] {
    1321         append out "    font configure $font"
    1322         array unset info
    1323         array set info [font configure $font]
    1324         foreach opt { -family -size -weight -slant } {
    1325             set value [list $info($opt)]
    1326             append out " $opt $value"
    1327         }
    1328         append out "\n"
     1321        append out "    font configure $font"
     1322        array unset info
     1323        array set info [font configure $font]
     1324        foreach opt { -family -size -weight -slant } {
     1325            set value [list $info($opt)]
     1326            append out " $opt $value"
     1327        }
     1328        append out "\n"
    13291329    }
    13301330    append out "\n"
     
    13331333    append out "    preview configure"
    13341334    foreach opt { -width -height -leftmargin -rightmargin -topmargin
    1335         -bottommargin -plotpadx -plotpady } {
    1336         set value [list [$_clone cget $opt]]
    1337         append out " $opt $value"
     1335        -bottommargin -plotpadx -plotpady } {
     1336        set value [list [$_clone cget $opt]]
     1337        append out " $opt $value"
    13381338    }
    13391339    append out "\n"
     
    13421342    append out "    preview legend configure"
    13431343    foreach opt { -position -anchor -borderwidth -hide } {
    1344         set value [list [$_clone legend cget $opt]]
    1345         append out " $opt $value"
     1344        set value [list [$_clone legend cget $opt]]
     1345        append out " $opt $value"
    13461346    }
    13471347    append out " -font legend\n"
     
    13491349    # Element settings
    13501350    foreach elem [$_clone element show] {
    1351         set label [$_clone element cget $elem -label]
    1352         if { $label == "" } {
    1353             continue
    1354         }
    1355         append out "    if \{ \[preview element exists \"$label\"\] \} \{\n"
    1356         append out "        preview element configure \"$label\""
    1357         foreach opt { -symbol -color -dashes -label } {
    1358             set value [list [$_clone element cget $elem $opt]]
    1359             append out " $opt $value"
    1360         }
    1361         append out "    \}\n"
     1351        set label [$_clone element cget $elem -label]
     1352        if { $label == "" } {
     1353            continue
     1354        }
     1355        append out "    if \{ \[preview element exists \"$label\"\] \} \{\n"
     1356        append out "        preview element configure \"$label\""
     1357        foreach opt { -symbol -color -dashes -label } {
     1358            set value [list [$_clone element cget $elem $opt]]
     1359            append out " $opt $value"
     1360        }
     1361        append out "    \}\n"
    13621362    }
    13631363   
    13641364    # Axis settings
    13651365    foreach axis [$_clone axis names] {
    1366         if { [$_clone axis cget $axis -hide] } {
    1367             continue
    1368         }
    1369         append out "    if \{ \[preview axis names \"$axis\"\] == \"$axis\" \} \{\n"
    1370         append out "        preview axis configure \"$axis\""
    1371         foreach opt { -hide -min -max -loose -title -stepsize -subdivisions } {
    1372             set value [list [$_clone axis cget $axis $opt]]
    1373             append out " $opt $value"
    1374         }
    1375         append out " -tickfont \"$axis-ticks\""
    1376         append out " -titlefont \"$axis-title\"\n"
    1377         set hide [$_clone marker cget ${axis}-zero -hide]
    1378         append out "        preview marker configure \"${axis}-zero\" -hide $hide\n"
    1379         append out "    \}\n"
     1366        if { [$_clone axis cget $axis -hide] } {
     1367            continue
     1368        }
     1369        append out "    if \{ \[preview axis names \"$axis\"\] == \"$axis\" \} \{\n"
     1370        append out "        preview axis configure \"$axis\""
     1371        foreach opt { -hide -min -max -loose -title -stepsize -subdivisions } {
     1372            set value [list [$_clone axis cget $axis $opt]]
     1373            append out " $opt $value"
     1374        }
     1375        append out " -tickfont \"$axis-ticks\""
     1376        append out " -titlefont \"$axis-title\"\n"
     1377        set hide [$_clone marker cget ${axis}-zero -hide]
     1378        append out "        preview marker configure \"${axis}-zero\" -hide $hide\n"
     1379        append out "    \}\n"
    13801380    }   
    13811381
Note: See TracChangeset for help on using the changeset viewer.