Changeset 1252 for trunk


Ignore:
Timestamp:
Dec 2, 2008 5:24:57 PM (15 years ago)
Author:
gah
Message:

Added drawer for xyresult legend

Location:
trunk/gui/scripts
Files:
2 edited

Legend:

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

    r1167 r1252  
    108108itcl::body Rappture::XyLegend::constructor { graph args } {
    109109    option add hull.width hull.height
     110    pack propagate $itk_component(hull) no
    110111    itk_component add scrollbars {
    111112        Rappture::Scroller $itk_interior.scrl \
    112             -xscrollmode auto -yscrollmode auto
     113            -xscrollmode auto -yscrollmode auto \
     114            -width 200 -height 100
    113115    }
    114116    set tree_ [blt::tree create]
    115117    itk_component add legend {
    116118        blt::treeview $itk_component(scrollbars).legend -linewidth 0 \
    117             -bg white -selectmode multiple -width 0 \
     119            -bg white -selectmode multiple \
    118120            -highlightthickness 0 \
    119121            -tree $tree_ \
  • trunk/gui/scripts/xyresult.tcl

    r1152 r1252  
    100100
    101101    private variable _dispatcher "" ;# dispatcher for !events
    102 
    103102    private variable _clist ""     ;# list of curve objects
    104103    private variable _curve2color  ;# maps curve => plotting color
     
    118117    private variable _markers
    119118    private variable cur_ ""
     119    private variable initialized_ 0
    120120}
    121121                                                                               
    122122itk::usual XyResult {
    123123    keep -background -foreground -cursor -font
     124}
     125
     126itk::usual Panedwindow {
     127    keep -background -cursor
    124128}
    125129
     
    159163    pack $itk_component(reset) -padx 4 -pady 2 -anchor e
    160164    Rappture::Tooltip::for $itk_component(reset) "Reset the view to the default zoom level"
    161 
     165    itk_component add drawer {
     166        panedwindow $itk_interior.drawer \
     167            -orient horizontal -opaqueresize 1 -handlepad 0 \
     168            -handlesize 1 -sashwidth 2     
     169    }
     170    pack $itk_component(drawer) -expand yes -fill both
    162171    itk_component add plot {
    163         blt::graph $itk_interior.plot \
     172        blt::graph $itk_component(drawer).plot \
    164173            -highlightthickness 0 -plotpadx 0 -plotpady 0 \
    165174            -rightmargin 10
     
    167176        keep -background -foreground -cursor -font
    168177    }
    169     pack $itk_component(plot) -expand yes -fill both
     178    $itk_component(drawer) add $itk_component(plot) -sticky nsew
    170179    $itk_component(plot) pen configure activeLine \
    171180        -symbol square -pixels 3 -linewidth 2 \
     
    251260   
    252261    itk_component add legend {
    253         Rappture::XyLegend $itk_component(controls).legend $itk_component(plot)
     262        Rappture::XyLegend $itk_component(drawer).legend $itk_component(plot)
    254263    }
    255264    after idle [subst {
     
    15771586    switch -- ${what} {
    15781587        "activate" {
    1579             pack $itk_component(legend) -expand yes -fill both
     1588            $itk_component(drawer) add $itk_component(legend) -sticky nsew
    15801589            after idle [list focus $itk_component(legend)]
     1590            if { !$initialized_ } {
     1591                set w [winfo width $itk_component(drawer)]
     1592                set x [expr $w - 100]
     1593                $itk_component(drawer) sash place 0 $x 0
     1594                set initialized_ 1
     1595            }
    15811596        }
    15821597        "deactivate" {
    1583             pack forget $itk_component(legend)
     1598            $itk_component(drawer) forget $itk_component(legend)
    15841599        }
    15851600        "toggle" {
    1586             set slaves [pack slave $itk_component(controls)]
     1601            set slaves [$itk_component(drawer) panes]
    15871602            if { [lsearch $slaves $itk_component(legend)] >= 0 } {
    15881603                legend deactivate
Note: See TracChangeset for help on using the changeset viewer.