Changeset 1966 for trunk/tester/testtree.tcl
- Timestamp:
- Nov 25, 2010 11:32:59 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tester/testtree.tcl
r1965 r1966 22 22 namespace eval Rappture::Regression::TestTree { #forward declaration } 23 23 24 # ----------------------------------------------------------------------25 # CONSTRUCTOR26 # ----------------------------------------------------------------------27 24 itcl::class Rappture::Regression::TestTree { 28 25 inherit itk::Widget 29 26 30 27 public variable command 28 public variable selectcommand 31 29 public variable testdir 32 30 … … 41 39 } 42 40 43 # TODO: figure out exactly what should go in here.44 41 itk::usual TestTree { 45 42 keep -background -foreground -font 46 43 } 47 itk::usual TreeView { 48 keep -background -foreground -font 49 } 50 44 45 # ---------------------------------------------------------------------- 46 # CONSTRUCTOR 47 # ---------------------------------------------------------------------- 51 48 itcl::body Rappture::Regression::TestTree::constructor {args} { 52 # TODO: Use separate tree data structure and insert into treeview53 puts "Constructing TestTree."54 55 49 itk_component add treeview { 56 50 blt::treeview $itk_interior.treeview -separator . -autocreate true \ 57 51 -selectmode multiple 52 } { 58 53 } 59 54 $itk_component(treeview) column insert 0 result … … 66 61 } 67 62 pack $itk_component(bottomBar) -fill x 63 # TODO: Adjust spacing in bottom bar 68 64 69 65 itk_component add bSelectAll { … … 83 79 } 84 80 pack $itk_component(lSelected) -side left -expand yes -fill x 85 $itk_component(treeview) configure -selectcommand "$this updateLabel"86 81 87 82 itk_component add bRun { … … 101 96 itcl::configbody Rappture::Regression::TestTree::testdir { 102 97 populate 98 } 99 100 # Forward the TestTree's selectcommand to the treeview, and update the label 101 # as well. 102 itcl::configbody Rappture::Regression::TestTree::selectcommand { 103 $itk_component(treeview) configure -selectcommand \ 104 "$this updateLabel; $selectcommand" 103 105 } 104 106 … … 113 115 # ---------------------------------------------------------------------- 114 116 itcl::body Rappture::Regression::TestTree::populate {} { 115 puts "Populating TestTree."116 117 $itk_component(treeview) delete 0 117 118 # TODO: add an appropriate icon … … 205 206 itcl::body Rappture::Regression::TestTree::updateLabel {} { 206 207 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 208 214 if {$n > 0} { 209 215 $itk_component(bRun) configure -state normal
Note: See TracChangeset
for help on using the changeset viewer.