From: <ro...@us...> - 2015-05-01 11:56:39
|
Revision: 2311 http://sourceforge.net/p/nsclspectcl/code/2311 Author: ron-fox Date: 2015-05-01 11:56:37 +0000 (Fri, 01 May 2015) Log Message: ----------- Feature #382 - Add a parameter selection tree-button to the tree param classic gui. Modified Paths: -------------- branches/4.0-dev/ChangeLog branches/4.0-dev/treegui/gateContainer.tcl branches/4.0-dev/treegui/gateCreate.tcl branches/4.0-dev/treegui/gateTabActions.tcl Modified: branches/4.0-dev/ChangeLog =================================================================== --- branches/4.0-dev/ChangeLog 2015-04-30 21:03:18 UTC (rev 2310) +++ branches/4.0-dev/ChangeLog 2015-05-01 11:56:37 UTC (rev 2311) @@ -1062,4 +1062,7 @@ * Feature #2760 - new analysis framework to replace the 8.0 version. * Feature #3479 (change to existing functionality) Make spectra/displays from [low, hi) with nchan binning. + * Feature #3922 - provide over/underflow statistics for spectra. + * Feature #382 - Add a parameter selection menu button to the tree + parameter classic gate tab to aid in generating gates. Modified: branches/4.0-dev/treegui/gateContainer.tcl =================================================================== --- branches/4.0-dev/treegui/gateContainer.tcl 2015-04-30 21:03:18 UTC (rev 2310) +++ branches/4.0-dev/treegui/gateContainer.tcl 2015-05-01 11:56:37 UTC (rev 2311) @@ -102,6 +102,7 @@ delegate option -createcmd to gatecreate delegate option -menugates to gatecreate as -gates + delegate option -menuparams to gatecreate as -parameters delegate option -gatename to gatecreate delegate option -definition to gatecreate delegate option -type to gatecreate Modified: branches/4.0-dev/treegui/gateCreate.tcl =================================================================== --- branches/4.0-dev/treegui/gateCreate.tcl 2015-04-30 21:03:18 UTC (rev 2310) +++ branches/4.0-dev/treegui/gateCreate.tcl 2015-05-01 11:56:37 UTC (rev 2311) @@ -25,10 +25,10 @@ # Provides a megawidget for creating gates. # The physicsl layout of this widget is shown below: # -# +---------------------------------------------------------------+ -# | [Create/Replace] [Gate Select] [Clear Dependency] [Slice] | -# | <Gate name entry> < gate definition entry > | -# +---------------------------------------------------------------+ +# +---------------------------------------------------------------------------+ +# | [Create/Replace] [Gate Select] [parameter] [Clear Dependency] [Slice] | +# | <Gate name entry> < gate definition entry > | +# +---------------------------------------------------------------------------+ # # OPTIONS # @@ -62,19 +62,21 @@ option -type -configuremethod SetTypename option -typename -configuremethod SetType option -gates -configuremethod SetGates - + option -parameters -configuremethod SetParameters + # Dictionary whose keys populate the gate type menu # button drop down and whose values are the gate types # Expected by the SpecTcl gate definition. + # 4.0 - reordered so that more common gate types are at the top. typevariable gateTypes [dict create \ + Slice s \ + Contour c \ + Band b \ And * \ Or + \ Not - \ C2Band c2band \ - Slice s \ - Contour c \ - Band b \ {Gamma Band} gb \ {Gamma Contour} gc \ {Gamma Slice} gs \ @@ -100,6 +102,8 @@ ttk::button $win.create -text Create/Replace -command [mymethod Dispatch -createcmd] ttk::menubutton $win.gatesel -text {Gate Select} -menu $win.gatesel.gates treeMenu $win.gatesel.gates -command [mymethod AddDependency %N] + ttk::menubutton $win.paramsel -text {Parameter} -menu $win.paramsel.params + treeMenu $win.paramsel.params -command [mymethod AddParameter %N] ttk::button $win.clear -text {Clear Definition} -command [mymethod ClearDefinition] ttk::menubutton $win.type -textvariable ${selfns}::options(-typename) \ -menu $win.type.typemenu @@ -126,14 +130,15 @@ # Layout the widget. # - grid $win.create $win.gatesel $win.clear $win.type -sticky w + grid $win.create $win.gatesel $win.paramsel $win.clear $win.type -sticky w grid $win.name -row 1 -column 0 -sticky w -padx 3px - grid $win.definition -row 1 -column 1 -columnspan 3 -sticky ew + grid $win.definition -row 1 -column 1 -columnspan 4 -sticky ew grid columnconfigure $win 0 -weight 0 grid columnconfigure $win 1 -weight 1 grid columnconfigure $win 2 -weight 0 - grid columnconfigure $win 3 -weight 1 + grid columnconfigure $win 3 -weight 0 + grid columnconfigure $win 4 -weight 1 # Configure the args which in turn will configure some of the widget contents. @@ -159,7 +164,21 @@ #------------------------------------------------------------------- # Configuration handlers. + + ## + # SetParameters + # Called to update the list of parameters that are in the parameter selection + # tree menubutton. + # + # + method SetParameters {option value} { + set options($option) $value + destroy $win.paramsel.params + treeMenu $win.paramsel.params -command [mymethod AddParameter %N] -items $value + } + + ## # Set the gates for the $in.gatesel.gates menu. # At this point in time this required killing and rebuilding that menu: # @param option - Name of the option being configured (-gates) @@ -241,4 +260,13 @@ set options(-typename) $label set options(-type) $value } + ## + # Add Paramete + # Insert a space and the most recently selected parameter name in the + # gate definition line. + + method AddParameter {name} { + $win.definition insert end " " + $win.definition insert end $name + } } \ No newline at end of file Modified: branches/4.0-dev/treegui/gateTabActions.tcl =================================================================== --- branches/4.0-dev/treegui/gateTabActions.tcl 2015-04-30 21:03:18 UTC (rev 2310) +++ branches/4.0-dev/treegui/gateTabActions.tcl 2015-05-01 11:56:37 UTC (rev 2311) @@ -60,6 +60,7 @@ private method doScheduledLoadUpdate {} { set menuUpdateAfterId -1 loadGateMenu + loadParamMenu } ## @@ -75,6 +76,7 @@ private method updateGates {} { loadGateTable [$widget cget -mask] loadGateMenu + loadParamMenu } ## @@ -159,6 +161,18 @@ } } ## + # loadParameterMenu + # Load the gate parameter selection button with the names of all parameters. + # + private method loadParameterMenu {} { + set parameters [parameter -list] + set names [list] + foreach parameter $parameters { + lappend names [lindex $parameter 0] + } + $widget configure -menuparams $names + } + ## # Load the gate menu with the names of all of the gates: # private method loadGateMenu {} { @@ -302,7 +316,8 @@ -createcmd [itcl::code $this createGate %G %T %D] loadGateTable * - loadGateMenu + loadGateMenu + loadParameterMenu # Set up a gate add/delete trace to reload the gate menu: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |