make-entry-filter xabbre "Flags\n regexp" {}
}
+proc filterstyle-changed {n1 n2 op} {
+ global filterstyle
+ debug "filterstyle-changed $filterstyle"
+ redraw-needed
+}
+
proc filters-say-yes {code} {
- global filters
+ global filters filterstyle
debug "filters-say-yes $code"
+ set codel [split $code _]
+ set lockown [lindex $codel 3]
+ switch -exact $filterstyle {
+ 0 { return 1 }
+ 1 { return [filter-default/lockown $lockown] }
+ 2 { return [regexp {^.0} $lockown] }
+ 3 { }
+ default { error $filterstyle }
+ }
+
foreach fil $filters {
- if {![filter-says-yes/$fil [split $code _]]} { return 0 }
+ if {![filter-says-yes/$fil $codel]} { return 0 }
}
return 1
}
#---------- main user interface ----------
proc widgets-setup {} {
- global canvas debug pirate ocean
+ global canvas debug pirate ocean filterstyle
- wm geometry . 1024x480
+ wm geometry . 1024x600
wm title . "where-vessels - $pirate on the $ocean ocean"
#----- map -----
frame .islands -pady 2
pack .cp .filter .islands -side top
- label .filter.title -text Filter
+ set filterstyle 1
+ trace add variable filterstyle write filterstyle-changed
+
+ frame .filter.title
+ label .filter.title.title -text Show
+ pack .filter.title.title -side left
+ for {set fing 0} {$fing < 4} {incr fing} {
+ radiobutton .filter.title.f$fing \
+ -variable filterstyle -value $fing \
+ -text [lindex {All Useable Mine These:} $fing]
+ pack .filter.title.f$fing -side left
+ }
+
grid configure .filter.title -row 0 -column 0 -columnspan 2
#----- control panel -----