Ignore:
Timestamp:
Nov 25, 2010 11:32:59 PM (13 years ago)
Author:
braffert
Message:

Developing regression tester

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tester/testtree.tcl

    r1965 r1966  
    2222namespace eval Rappture::Regression::TestTree { #forward declaration }
    2323
    24 # ----------------------------------------------------------------------
    25 # CONSTRUCTOR
    26 # ----------------------------------------------------------------------
    2724itcl::class Rappture::Regression::TestTree {
    2825    inherit itk::Widget
    2926
    3027    public variable command
     28    public variable selectcommand
    3129    public variable testdir
    3230
     
    4139}
    4240
    43 # TODO: figure out exactly what should go in here.
    4441itk::usual TestTree {
    4542    keep -background -foreground -font
    4643}
    47 itk::usual TreeView {
    48     keep -background -foreground -font
    49 }
    50 
     44
     45# ----------------------------------------------------------------------
     46# CONSTRUCTOR
     47# ----------------------------------------------------------------------
    5148itcl::body Rappture::Regression::TestTree::constructor {args} {
    52     # TODO: Use separate tree data structure and insert into treeview
    53     puts "Constructing TestTree."
    54 
    5549    itk_component add treeview {
    5650        blt::treeview $itk_interior.treeview -separator . -autocreate true \
    5751            -selectmode multiple
     52    } {
    5853    }
    5954    $itk_component(treeview) column insert 0 result
     
    6661    }
    6762    pack $itk_component(bottomBar) -fill x
     63    # TODO: Adjust spacing in bottom bar
    6864
    6965    itk_component add bSelectAll {
     
    8379    }
    8480    pack $itk_component(lSelected) -side left -expand yes -fill x
    85     $itk_component(treeview) configure -selectcommand "$this updateLabel"
    8681
    8782    itk_component add bRun {
     
    10196itcl::configbody Rappture::Regression::TestTree::testdir {
    10297    populate
     98}
     99
     100# Forward the TestTree's selectcommand to the treeview, and update the label
     101# as well.
     102itcl::configbody Rappture::Regression::TestTree::selectcommand {
     103    $itk_component(treeview) configure -selectcommand \
     104        "$this updateLabel; $selectcommand"
    103105}
    104106
     
    113115# ----------------------------------------------------------------------
    114116itcl::body Rappture::Regression::TestTree::populate {} {
    115     puts "Populating TestTree."
    116117    $itk_component(treeview) delete 0
    117118    # TODO: add an appropriate icon
     
    205206itcl::body Rappture::Regression::TestTree::updateLabel {} {
    206207    set n [llength [getSelected]]
    207     $itk_component(lSelected) configure -text "$n tests selcted"
     208    if {$n == 1} {
     209        $itk_component(lSelected) configure -text "1 test selcted"
     210    } else {
     211        $itk_component(lSelected) configure -text "$n tests selected"
     212    }
     213
    208214    if {$n > 0} {
    209215        $itk_component(bRun) configure -state normal
Note: See TracChangeset for help on using the changeset viewer.