default { report-set own "?? $notown" }
}
- if {[string length $xabbrev]} {
- report-set xabbrev "Notes flags: $xabbrev"
+ global smash_xabbrev_map
+ if {[llength $smash_xabbrev_map]} {
+ if {[string length $xabbrev]} {
+ report-set xabbrev "(Flags: $xabbrev)"
+ } else {
+ report-set xabbrev "(No flags)"
+ }
} else {
- report-set xabbrev "No flags in notes"
+ if {[string length $xabbrev]} {
+ report-set xabbrev "Notes flags: $xabbrev"
+ } else {
+ report-set xabbrev "No flags in notes"
+ }
}
}
return $cw
}
-proc make-control-grid-entry {cw kind ix ekind args} {
+proc make-control-grid-elem {cw kind ix ekind args} {
upvar #0 control_grid_properties($cw) props
manyset $props rows inrow
set ew $cw.$ix
- debug "MAKE-CONTROL-GRID-ENTRY $cw $kind $ix $ekind $rows $inrow $ew"
+ debug "MAKE-CONTROL-GRID-ELEM $cw $kind $ix $ekind $rows $inrow $ew"
eval [list $ekind $ew] $args
for {set ix 0} {$ix < $count} {incr ix} {
set val [lindex $values $ix]
set vars($val) [uplevel 1 $default_get]
- set ew [make-control-grid-entry $cw ix $ix checkbutton \
+ set ew [make-control-grid-elem $cw ix $ix checkbutton \
-variable ${varsvn}($val) \
-font fixed \
-command [list redraw-needed c.-g.-tickbox $cw $val]]
image { $ew configure -height 16 }
}
}
- [make-control-grid-entry $cw final invert button] \
+ [make-control-grid-elem $cw final invert button] \
configure \
-text flip -command [list control-tickbox-flip $varsvn $flipvalues] \
-padx 0 -pady 0
4 { set lockown 33 }
}
+ global smash_xabbrev_map
+ set xabbrev [string map $smash_xabbrev_map $xabbrev]
+
return [join [list $inport $smsize $subclass $lockown $xabbrev] _]
}
}
set smash_sizemap($size) $mapto
}
+
+ global smash_xabbrev_a smash_xabbrev_b smash_xabbrev_map
+ set smash_xabbrev_map {}
+ foreach a [split $smash_xabbrev_a ""] b [split $smash_xabbrev_b ""] {
+ if {![string length $a]} continue
+ lappend smash_xabbrev_map $a $b
+ }
+ debug "SMASH-PREPAE xabbrev_map=[list $smash_xabbrev_map]"
}
proc make-smasher {sma label ekind} {
set w [make-smasher $sma $label frame]
begin-control-grid $w [llength $descs] $rows $inrow
for {set i 0} {$i < [llength $descs]} {incr i} {
- make-control-grid-entry $w ix $i \
+ make-control-grid-elem $w ix $i \
radiobutton \
-variable $variable -value $i -command redraw-needed \
-text [lindex $descs $i]
make-radio-smasher owner Owner smash_owner \
{Show Yours? {For you} Lock Hide} 2 3
+
+ set cw [make-smasher xabbrev "Flags" frame]
+ foreach ix {1 3} ab {a b} width {14 12} {
+ set vn smash_xabbrev_$ab
+ global $vn
+ set $vn {}
+ entry $cw.$ix -textvariable $vn -width $width
+ trace add variable $vn write [list redraw-needed $vn]
+ }
+ set ix 0
+ foreach str {y/ / /d} { label $cw.$ix -text $str; incr ix 2 }
+ eval pack [lsort [winfo children $cw]] -side left
}
#---------- filtering ----------
}]]
}
-
-set scale 16
+proc init-scales {} {
+ global scales scaleix scale
+ set defscale 16
+ set scales {1 2 3 4 5 6 8}
+ set e12 {10 12 15 18 22 27 33 39 47 56 68 82}
+ foreach t $e12 {
+ if {$t < $defscale} { set scaleix [llength $scales] }
+ lappend scales $t
+ }
+ foreach t [lrange $e12 0 6] { lappend scales [expr {$t * 10}] }
+ set scale [lindex $scales $scaleix]
+}
proc coord {c} {
global scale
frame .cp.ctrl.zoom
pack .cp.ctrl.zoom -side top
- button .cp.ctrl.zoom.out -text - -font {Courier 16} -command {zoom /2} -pady 0
- button .cp.ctrl.zoom.in -text + -font {Courier 16} -command {zoom *2} -pady 0
- pack .cp.ctrl.zoom.out .cp.ctrl.zoom.in -side left
+ foreach inout {out in} minplus {- +} {
+ button .cp.ctrl.zoom.$inout -text $minplus -font {Courier 16} \
+ -command "zoom ${minplus}1" -pady 0
+ pack .cp.ctrl.zoom.$inout -side left
+ }
parser-control-create .cp.ctrl.acquire \
acquire Acquire \
.cp.report.list delete 0 end
- foreach entry $k {
- manyset $entry vid name owner
+ foreach elem $k {
+ manyset $elem vid name owner
lappend owned($owner) $name
}
}
}
-proc zoom {extail} {
- global scale canvas
- set nscale [expr "\$scale $extail"]
- debug "ZOOM $scale $nscale"
- if {$nscale < 1 || $nscale > 200} return
- set scale $nscale
+proc zoom {amt} {
+ global scaleix scales scale canvas
+ incr scaleix $amt
+ if {$scaleix < 0} { set scaleix 0 }
+ set nscales [llength $scales]
+ if {$scaleix >= $nscales} { set scaleix [expr {$nscales-1}] }
+ set scale [lindex $scales $scaleix]
+ debug "ZOOM $amt $scaleix $scale"
draw
}
#---------- main program ----------
+init-scales
parseargs
argdefaults
httpclientsetup where-vessels