From: Ian Jackson Date: Sun, 8 Aug 2010 19:32:25 +0000 (+0100) Subject: where-vessels: much better docs re ui; auto switch to "These:" X-Git-Tag: 6.6.2~8 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-test.git;a=commitdiff_plain;h=792a2a676fb8c320255990e3b7bbc22ea74c6ae6;hp=c96f16bf07dc3254155d3d31acf91e82fc69da56 where-vessels: much better docs re ui; auto switch to "These:" --- diff --git a/yarrg/README.where-vessels b/yarrg/README.where-vessels index 7678784..e52e272 100644 --- a/yarrg/README.where-vessels +++ b/yarrg/README.where-vessels @@ -75,6 +75,56 @@ OPTIONS: Do not fetch ocean map from Yppedia. Instead, use copy in DIR. +USER INTERFACE: +=============== + +There are some things that won't be obvious from the user interface. + +The black square with the blue square inside it is the panner for the +map. + +If you get an error message from Acquire, or a message about the +notes, shown as a red, yellow or blue message below the Acquire or +Reload Notes button, you can click on the message to get a pop-up +window with the full error message. + +Colonised islands are shown with names in black; uncolonised in grey. +Dotted routes are unpurchaseable charts. (Information from Yppedia.) + +If you click on one of the little white icons on the map, you'll see +an explanation of what that icon string means appear in the top right. +Each element of the icon is explained in turn from left to right. +Then you'll see a list of the ships represented below, ordered by +owning pirate (if known) and then by name. + +The "Show" panel allows you to filter the displayed ships. If you +don't select "These:" then none of the other controls in the "Show" +panel have any effect, so touching any of the latter sets the overall +filtering style back to "These:". + +"Display/combine details" allows the map display to be decluttered by +squashing together differing ships: + * "Size round down": selecting a size means that every ship of that + size will be rounded down to the next un-selected size. Naturally + you cannot select sloops for rounding down! + * "Lock/owner": "Yours?" simply pretends that all unknown ships are + not yours; that is useful if your crew has many ships and you only + bother writing about your own ships in the notes. "For you" shows + the vessel lock status, except that if it's your ship and unlocked + it shows just that it's yours (and doesn't show whether it's + unlocked or crew use). + * Flags: See perlop(1) on the tr/// (aka y///) operator. All + characters entered into the boxes are literal; ranges etc. are not + supported. +Filtering done by the "Show" panel takes effect before the collapsing +done by "Display/combine details", so you can filter on details which +you are collapsing for display. + +If you select (click on) one of the ship names in the list in the top +right, you'll get an icon string below the vessel list which gives the +complete information for that vessel, as it was before the collapsing. + + VESSEL NOTES: ============= diff --git a/yarrg/where-vessels b/yarrg/where-vessels index 0aa7290..9005a7f 100755 --- a/yarrg/where-vessels +++ b/yarrg/where-vessels @@ -541,16 +541,16 @@ proc make-control-grid-elem {cw kind ix ekind args} { return $ew } -proc control-tickbox-flip {varsvn values} { +proc control-tickbox-flip {varsvn values onflip} { upvar #0 $varsvn vars foreach val $values { set vars($val) [expr {!$vars($val)}] } - redraw-needed c.-tickbox-flip $varsvn $values + $onflip c.-tickbox-flip $varsvn $values } proc populate-control-grid-tickboxes {cw rows inrow varsvn values flipvalues - label_kind valvn default_get label_get} { + label_kind valvn default_get label_get onflip} { debug "POPULATE-CONTROL-GRID-TICKBOXES $cw $rows $inrow $varsvn\ [list $values] $label_kind $valvn" @@ -566,7 +566,7 @@ proc populate-control-grid-tickboxes {cw rows inrow varsvn values flipvalues set ew [make-control-grid-elem $cw ix $ix checkbutton \ -variable ${varsvn}($val) \ -font fixed \ - -command [list redraw-needed c.-g.-tickbox $cw $val]] + -command [list $onflip c.-g.-tickbox $cw $val]] $ew configure -$label_kind [uplevel 1 $label_get] switch -exact $label_kind { image { $ew configure -height 16 } @@ -574,8 +574,8 @@ proc populate-control-grid-tickboxes {cw rows inrow varsvn values flipvalues } [make-control-grid-elem $cw final invert button] \ configure \ - -text flip -command [list control-tickbox-flip $varsvn $flipvalues] \ - -padx 0 -pady 0 + -text flip -padx 0 -pady 0 \ + -command [list control-tickbox-flip $varsvn $flipvalues $onflip] } #---------- smashing ---------- @@ -650,7 +650,8 @@ proc make-radio-smasher {sma label variable descs rows inrow} { for {set i 0} {$i < [llength $descs]} {incr i} { make-control-grid-elem $w ix $i \ radiobutton \ - -variable $variable -value $i -command redraw-needed \ + -variable $variable -value $i \ + -command [list redraw-needed radio-smasher $sma] \ -text [lindex $descs $i] } } @@ -660,7 +661,8 @@ proc make-smashers {} { set cw [make-smasher size "Size\n round\n down" frame] populate-control-grid-tickboxes $cw 2 0 smash_size \ $vc_codes [lrange $vc_codes 1 end] \ - image val { expr 0 } { expr {"icon/$vc_code2abbrev($val)"} } + image val { expr 0 } { expr {"icon/$vc_code2abbrev($val)"} } \ + redraw-needed $cw.0 configure -state disabled glset smash_subclass 0 @@ -668,7 +670,7 @@ proc make-smashers {} { {Show Normal/LE Hide} 1 0 glset smash_owner [expr {[have-notes] ? 0 : 3}] - make-radio-smasher owner Owner smash_owner \ + make-radio-smasher owner "Lock/\nowner" smash_owner \ {Show Yours? {For you} Lock Hide} 2 3 set cw [make-smasher xabbrev "Flags" frame] @@ -770,7 +772,8 @@ proc make-tickbox-filter {fil label rows inrow} { populate-control-grid-tickboxes $fw $rows $inrow filter_$fil \ $values $values \ - $label_kind val { filter-default/$fil $val } $label_get + $label_kind val { filter-default/$fil $val } $label_get \ + specific-filter-adjusted } proc entry-filter-changed {fw fil n1 n2 op} { @@ -786,7 +789,7 @@ proc entry-filter-changed {fw fil n1 n2 op} { } else { $fw.error configure -text { } -background $def_background set realvar $entryvar - redraw-needed + specific-filter-adjusted entry-filter-changed $fw } } emsg]} { puts stderr "FILTER CHECK ERROR $emsg $errorInfo" @@ -826,10 +829,15 @@ proc make-filters {} { make-entry-filter xabbre "Flags\n regexp" {} } +proc specific-filter-adjusted {args} { + glset filterstyle 3 + eval redraw-needed $args +} + proc filterstyle-changed {n1 n2 op} { global filterstyle - debug "filterstyle-changed $filterstyle" - redraw-needed + debug "FILTERSTYLE-CHANGED $filterstyle" + redraw-needed filterstyle-changed } proc filters-say-yes {code} {