From: Tom J. <bl...@us...> - 2006-01-26 23:29:18
|
Update of /cvsroot/amsn/msn/utils/contentmanager In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32649 Modified Files: contentmanager.tcl Log Message: Added basic filter/search support. Index: contentmanager.tcl =================================================================== RCS file: /cvsroot/amsn/msn/utils/contentmanager/contentmanager.tcl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** contentmanager.tcl 25 Jan 2006 21:55:40 -0000 1.5 --- contentmanager.tcl 26 Jan 2006 23:29:09 -0000 1.6 *************** *** 66,69 **** --- 66,73 ---- set tree [eval $type gettree $args] + # Check item type + if { ![string equal $_type group] && ![string equal $_type element] } { + error "unknown object type $_type" + } # Check item doesn't already exist if { [info command $path] != {} } { *************** *** 198,207 **** typemethod show { args } { set path [eval $type getpath $args] ! eval $path show } typemethod hide { args } { set path [eval $type getpath $args] ! eval $path hide } --- 202,213 ---- typemethod show { args } { set path [eval $type getpath $args] ! set opts [eval $type getopts $args] ! eval $path show $opts } typemethod hide { args } { set path [eval $type getpath $args] ! set opts [eval $type getopts $args] ! eval $path hide $opts } *************** *** 454,466 **** } ! method hide { } { set omnipresent 0 foreach item $items { set tree $options(-tree) lappend tree $item ! if { [string equal [eval contentmanager cget $tree -state] hidden] } { ! lappend hiddenitems $item ! } ! if { [eval contentmanager cget $tree -omnipresent] } { set omnipresent 1 continue --- 460,474 ---- } ! method hide { args } { ! if { [string equal $args {}] } { ! set force 0 ! } else { ! set force [lindex $args 1] ! } set omnipresent 0 foreach item $items { set tree $options(-tree) lappend tree $item ! if { [eval contentmanager cget $tree -omnipresent] && !$force } { set omnipresent 1 continue *************** *** 468,472 **** eval contentmanager hide $tree } ! if { $omnipresent } { set options(-state) "partlyhidden" } else { --- 476,480 ---- eval contentmanager hide $tree } ! if { $omnipresent && !$force } { set options(-state) "partlyhidden" } else { |