Changeset 3547 for trunk/gui/scripts


Ignore:
Timestamp:
Mar 21, 2013, 7:29:50 AM (11 years ago)
Author:
gah
Message:

remove test in DrawLegend? allowing title to be created.

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r3546 r3547  
    23342334        # If there's a legend title, create a text item for the title.
    23352335        $c create text $x $y \
    2336             -anchor ne \
    2337             -fill $itk_option(-plotforeground) -tags "title legend" \
    2338             -font $font
    2339             incr y $lineht
     2336                -anchor ne \
     2337                -fill $itk_option(-plotforeground) -tags "title legend" \
     2338                -font $font
    23402339        $c create text $x $y \
    23412340            -anchor ne \
  • trunk/gui/scripts/vtkisosurfaceviewer.tcl

    r3544 r3547  
    23822382        set y 2
    23832383        # If there's a legend title, create a text item for the title.
    2384         if { $title != "" } {
    2385             $c create text $x $y \
     2384        $c create text $x $y \
    23862385                -anchor ne \
    23872386                -fill $itk_option(-plotforeground) -tags "title legend" \
    23882387                -font $font
    23892388            incr y $lineht
    2390         }
    23912389        $c create text $x $y \
    23922390            -anchor ne \
     
    24512449    set y 2
    24522450    # If there's a legend title, move the title to the correct position
     2451puts stderr "DrawLegend title=$title x=$x y=$y $itk_option(-plotforeground)"
    24532452    if { $title != "" } {
     2453        $c itemconfigure title -text $title
    24542454        $c coords title $x $y
    24552455        incr y $lineht
     2456        $c raise title
    24562457    }
    24572458    $c coords zmax $x $y
     
    24812482        post {
    24822483            foreach { x1 y1 x2 y2 } [$c bbox title] break
    2483             set x1 [expr [winfo width $itk_component(view)] - [winfo reqwidth $itk_component(fieldmenu)]]
     2484            set cw [winfo width $itk_component(view)]
     2485            set mw [winfo reqwidth $itk_component(fieldmenu)]
     2486            set x1 [expr $cw - $mw]
    24842487            set x [expr $x1 + [winfo rootx $itk_component(view)]]
    24852488            set y [expr $y2 + [winfo rooty $itk_component(view)]]
Note: See TracChangeset for help on using the changeset viewer.