- Timestamp:
- Apr 6, 2016, 9:03:25 AM (8 years ago)
- Location:
- branches/multichoice
- Files:
-
- 9 added
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/multichoice/configure
r6229 r6251 10225 10225 10226 10226 10227 ac_config_files="$ac_config_files Makefile packages/Makefile src/Makefile src/core/Makefile src/core2/Makefile src/objects/Makefile src/objects/RpHash.h gui/Makefile gui/apps/Makefile gui/apps/about gui/apps/copy_rappture_examples gui/apps/encodedata gui/apps/rappture gui/apps/rappture-csh.env gui/apps/rappture.env gui/apps/rappture.use gui/apps/rerun gui/apps/simsim gui/apps/xmldiff gui/pkgIndex.tcl gui/scripts/Makefile gui/src/Makefile builder/Makefile builder/pkgIndex.tcl builder/scripts/Makefile tester/Makefile tester/pkgIndex.tcl tester/scripts/Makefile lang/Makefile lang/java/Makefile lang/java/rappture/Makefile lang/perl/Makefile lang/perl/Makefile.PL lang/python/Makefile lang/python/setup.py lang/matlab/Makefile lang/octave/Makefile lang/octave/octave2/Makefile lang/octave/octave3/Makefile lang/R/Makefile lang/ruby/Makefile lang/ruby/build.rb lang/tcl/Makefile lang/tcl/pkgIndex.tcl lang/tcl/scripts/Makefile lang/tcl/src/Makefile lang/tcl/tests/Makefile lib/Makefile examples/3D/Makefile examples/Makefile examples/app-fermi/2.0/Makefile examples/app-fermi/Makefile examples/app-fermi/cee/Makefile examples/app-fermi/fortran/Makefile examples/app-fermi/java/Makefile examples/app-fermi/matlab/Makefile examples/app-fermi/matlab/compiled/Makefile examples/app-fermi/matlab/uncompiled/Makefile examples/app-fermi/octave/octave2/Makefile examples/app-fermi/octave/octave3/Makefile examples/app-fermi/octave/Makefile examples/app-fermi/perl/Makefile examples/app-fermi/python/Makefile examples/app-fermi/ruby/Makefile examples/app-fermi/tcl/Makefile examples/app-fermi/wrapper/Makefile examples/app-fermi/wrapper/cee/Makefile examples/app-fermi/wrapper/perl/Makefile examples/app-fermi/wrapper/python/Makefile examples/app-fermi/wrapper/tcl/Makefile examples/app-fermi/R/Makefile examples/c-example/Makefile examples/canvas/Makefile examples/demo.bash examples/flow/Makefile examples/flow/demo1/Makefile examples/flow/demo2/Makefile examples/flow/demo3/Makefile examples/graph/Makefile examples/mapviewer/Makefile examples/mapviewer/camera/Makefile examples/mapviewer/colorramp/Makefile examples/mapviewer/common/Makefile examples/mapviewer/feature/Makefile examples/mapviewer/gdal/Makefile examples/mapviewer/layers/Makefile examples/mapviewer/ogr/Makefile examples/mapviewer/placard/Makefile examples/mapviewer/select/Makefile examples/mapviewer/tms/Makefile examples/mapviewer/wms/Makefile examples/mapviewer/xyz/Makefile examples/objects/Makefile examples/objects/axis/Makefile examples/objects/curve/Makefile examples/objects/dxWriter/Makefile examples/objects/floatBuffer/Makefile examples/objects/histogram/Makefile examples/objects/library/Makefile examples/objects/number/Makefile examples/objects/path/Makefile examples/objects/plot/Makefile examples/objects/scatter/Makefile examples/objects/string/Makefile examples/objects/tree/Makefile examples/objects/xmlparser/Makefile examples/zoo/Makefile examples/zoo/binary/Makefile examples/zoo/boolean/Makefile examples/zoo/choice/Makefile examples/zoo/curve/Makefile examples/zoo/drawing/Makefile examples/zoo/enable/Makefile examples/zoo/field/Makefile examples/zoo/group/Makefile examples/zoo/histogram/Makefile examples/zoo/image/Makefile examples/zoo/image/docs/Makefile examples/zoo/image/examples/Makefile examples/zoo/integer/Makefile examples/zoo/integer2/Makefile examples/zoo/loader/Makefile examples/zoo/loader/examples/Makefile examples/zoo/log/Makefile examples/zoo/mesh/Makefile examples/zoo/ note/Makefile examples/zoo/note/docs/Makefile examples/zoo/number/Makefile examples/zoo/number2/Makefile examples/zoo/parallelepiped/Makefile examples/zoo/periodicelement/Makefile examples/zoo/phase/Makefile examples/zoo/sequence/Makefile examples/zoo/sequence/examples/Makefile examples/zoo/string/Makefile examples/zoo/structure/Makefile examples/zoo/structure/examples/Makefile examples/zoo/table/Makefile video/Makefile video/pkgIndex.tcl oldtest/Makefile oldtest/src/Makefile puq/Makefile puq/puq.sh"10227 ac_config_files="$ac_config_files Makefile packages/Makefile src/Makefile src/core/Makefile src/core2/Makefile src/objects/Makefile src/objects/RpHash.h gui/Makefile gui/apps/Makefile gui/apps/about gui/apps/copy_rappture_examples gui/apps/encodedata gui/apps/rappture gui/apps/rappture-csh.env gui/apps/rappture.env gui/apps/rappture.use gui/apps/rerun gui/apps/simsim gui/apps/xmldiff gui/pkgIndex.tcl gui/scripts/Makefile gui/src/Makefile builder/Makefile builder/pkgIndex.tcl builder/scripts/Makefile tester/Makefile tester/pkgIndex.tcl tester/scripts/Makefile lang/Makefile lang/java/Makefile lang/java/rappture/Makefile lang/perl/Makefile lang/perl/Makefile.PL lang/python/Makefile lang/python/setup.py lang/matlab/Makefile lang/octave/Makefile lang/octave/octave2/Makefile lang/octave/octave3/Makefile lang/R/Makefile lang/ruby/Makefile lang/ruby/build.rb lang/tcl/Makefile lang/tcl/pkgIndex.tcl lang/tcl/scripts/Makefile lang/tcl/src/Makefile lang/tcl/tests/Makefile lib/Makefile examples/3D/Makefile examples/Makefile examples/app-fermi/2.0/Makefile examples/app-fermi/Makefile examples/app-fermi/cee/Makefile examples/app-fermi/fortran/Makefile examples/app-fermi/java/Makefile examples/app-fermi/matlab/Makefile examples/app-fermi/matlab/compiled/Makefile examples/app-fermi/matlab/uncompiled/Makefile examples/app-fermi/octave/octave2/Makefile examples/app-fermi/octave/octave3/Makefile examples/app-fermi/octave/Makefile examples/app-fermi/perl/Makefile examples/app-fermi/python/Makefile examples/app-fermi/ruby/Makefile examples/app-fermi/tcl/Makefile examples/app-fermi/wrapper/Makefile examples/app-fermi/wrapper/cee/Makefile examples/app-fermi/wrapper/perl/Makefile examples/app-fermi/wrapper/python/Makefile examples/app-fermi/wrapper/tcl/Makefile examples/app-fermi/R/Makefile examples/c-example/Makefile examples/canvas/Makefile examples/demo.bash examples/flow/Makefile examples/flow/demo1/Makefile examples/flow/demo2/Makefile examples/flow/demo3/Makefile examples/graph/Makefile examples/mapviewer/Makefile examples/mapviewer/camera/Makefile examples/mapviewer/colorramp/Makefile examples/mapviewer/common/Makefile examples/mapviewer/feature/Makefile examples/mapviewer/gdal/Makefile examples/mapviewer/layers/Makefile examples/mapviewer/ogr/Makefile examples/mapviewer/placard/Makefile examples/mapviewer/select/Makefile examples/mapviewer/tms/Makefile examples/mapviewer/wms/Makefile examples/mapviewer/xyz/Makefile examples/objects/Makefile examples/objects/axis/Makefile examples/objects/curve/Makefile examples/objects/dxWriter/Makefile examples/objects/floatBuffer/Makefile examples/objects/histogram/Makefile examples/objects/library/Makefile examples/objects/number/Makefile examples/objects/path/Makefile examples/objects/plot/Makefile examples/objects/scatter/Makefile examples/objects/string/Makefile examples/objects/tree/Makefile examples/objects/xmlparser/Makefile examples/zoo/Makefile examples/zoo/binary/Makefile examples/zoo/boolean/Makefile examples/zoo/choice/Makefile examples/zoo/curve/Makefile examples/zoo/drawing/Makefile examples/zoo/enable/Makefile examples/zoo/field/Makefile examples/zoo/group/Makefile examples/zoo/histogram/Makefile examples/zoo/image/Makefile examples/zoo/image/docs/Makefile examples/zoo/image/examples/Makefile examples/zoo/integer/Makefile examples/zoo/integer2/Makefile examples/zoo/loader/Makefile examples/zoo/loader/examples/Makefile examples/zoo/log/Makefile examples/zoo/mesh/Makefile examples/zoo/multichoice/Makefile examples/zoo/note/Makefile examples/zoo/note/docs/Makefile examples/zoo/number/Makefile examples/zoo/number2/Makefile examples/zoo/parallelepiped/Makefile examples/zoo/periodicelement/Makefile examples/zoo/phase/Makefile examples/zoo/sequence/Makefile examples/zoo/sequence/examples/Makefile examples/zoo/string/Makefile examples/zoo/structure/Makefile examples/zoo/structure/examples/Makefile examples/zoo/table/Makefile video/Makefile video/pkgIndex.tcl oldtest/Makefile oldtest/src/Makefile puq/Makefile puq/puq.sh" 10228 10228 10229 10229 cat >confcache <<\_ACEOF … … 11045 11045 "examples/zoo/log/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/log/Makefile" ;; 11046 11046 "examples/zoo/mesh/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/mesh/Makefile" ;; 11047 "examples/zoo/multichoice/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/multichoice/Makefile" ;; 11047 11048 "examples/zoo/note/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/note/Makefile" ;; 11048 11049 "examples/zoo/note/docs/Makefile") CONFIG_FILES="$CONFIG_FILES examples/zoo/note/docs/Makefile" ;; -
branches/multichoice/configure.in
r6229 r6251 603 603 examples/zoo/log/Makefile 604 604 examples/zoo/mesh/Makefile 605 examples/zoo/multichoice/Makefile 605 606 examples/zoo/note/Makefile 606 607 examples/zoo/note/docs/Makefile -
branches/multichoice/examples/zoo/Makefile.in
r3714 r6251 30 30 log \ 31 31 mesh \ 32 multichoice \ 32 33 note \ 33 34 number \ -
branches/multichoice/gui/scripts/Makefile.in
r6021 r6251 82 82 $(srcdir)/meshresult.tcl \ 83 83 $(srcdir)/molvisviewer.tcl \ 84 $(srcdir)/multichoiceentry.tcl \ 84 85 $(srcdir)/nanovisviewer.tcl \ 85 86 $(srcdir)/note.tcl \ -
branches/multichoice/gui/scripts/combobox.tcl
r5659 r6251 175 175 176 176 # ---------------------------------------------------------------------- 177 # USAGE: getValue <value> 178 # 179 # Clients use this to translate a value to a label. 177 # USAGE: current 178 # 179 # Clients use this to retrieve a label from the entry widget and return 180 # its value, if one exists. If no value exists for the label, then the 181 # label is returned. 180 182 # ---------------------------------------------------------------------- 181 183 itcl::body Rappture::Combobox::current {} { -
branches/multichoice/gui/scripts/combochecks.tcl
r5659 r6251 19 19 option add *Combochecks.relief sunken widgetDefault 20 20 option add *Combochecks.width 10 widgetDefault 21 option add *Combochecks.editable yes widgetDefault 21 22 option add *Combochecks.textBackground white widgetDefault 22 23 option add *Combochecks.textForeground black widgetDefault … … 28 29 inherit itk::Widget 29 30 31 itk_option define -editable editable Editable "" 30 32 itk_option define -state state State "normal" 31 33 itk_option define -width width Width 0 32 34 itk_option define -disabledbackground disabledBackground DisabledBackground "" 33 35 itk_option define -disabledforeground disabledForeground DisabledForeground "" 36 itk_option define -interactcommand interactCommand InteractCommand "" 34 37 35 38 constructor {args} { # defined below } 36 39 37 40 public method value {args} 38 public method current {} 41 public method translate {value {defValue ""}} 42 public method label {value} 39 43 public method choices {option args} 40 44 41 45 protected method _entry {option} 42 protected method _ fixDisplay {}46 protected method _dropdown {option} 43 47 protected method _fixState {} 44 48 … … 57 61 keep -foreground -background 58 62 keep -textforeground -textbackground 63 keep -selectbackground -selectforeground -selectborderwidth 59 64 } 60 65 … … 95 100 96 101 itk_component add ddlist { 97 Rappture::Dropdownchecks $itk_component(button).ddlist 98 } 102 Rappture::Dropdownchecks $itk_component(button).ddlist \ 103 -postcommand [itcl::code $this _dropdown post] \ 104 -unpostcommand [itcl::code $this _dropdown unpost] \ 105 } 106 99 107 bind $itk_component(ddlist) <<DropdownchecksSelect>> \ 100 [itcl::code $this _ fixDisplay]108 [itcl::code $this _dropdown select] 101 109 102 110 $itk_component(button) configure -command \ … … 115 123 # ---------------------------------------------------------------------- 116 124 itcl::body Rappture::Combochecks::value {args} { 117 switch -- [llength $args] { 118 0 { 119 # return a list of checked optons 120 set max [$itk_component(ddlist) size] 121 set rlist "" 122 foreach val [$itk_component(ddlist) get -value] { 123 if {[$itk_component(ddlist) state $val]} { 124 lappend rlist $val 125 } 126 } 127 return $rlist 128 } 129 1 { 130 set newval [lindex $args 0] 131 132 $itk_component(ddlist) reset 133 foreach part $newval { 134 $itk_component(ddlist) state $part 1 135 } 136 _fixDisplay 137 138 after 10 [list catch \ 139 [list event generate $itk_component(hull) <<Value>>]] 140 141 } 142 default { 143 error "wrong # args: should be \"value ?newval?\"" 144 } 145 } 125 if {[llength $args] == 1} { 126 set newval [lindex $args 0] 127 128 # FIXME: not sure if I need to update the ddlist just in case 129 # user calls value() without manipulating the ddlist 130 $itk_component(ddlist) reset 131 foreach part $newval { 132 set part [translate $part] 133 $itk_component(ddlist) state $part 1 134 } 135 136 $itk_component(entry) configure -state normal 137 $itk_component(entry) delete 0 end 138 $itk_component(entry) insert end [join $newval {, }] 139 if {!$itk_option(-editable)} { 140 $itk_component(entry) configure -state disabled 141 } 142 143 after 10 [list catch \ 144 [list event generate $itk_component(hull) <<Value>>]] 145 } elseif {[llength $args] != 0} { 146 error "wrong # args: should be \"value ?newval?\"" 147 } 148 return [$itk_component(entry) get] 149 } 150 151 # ---------------------------------------------------------------------- 152 # USAGE: translate <value> 153 # 154 # Clients use this to translate a value from the entry part of the 155 # combobox to one of the underlying values in the combobox. If the 156 # <value> string matches one of the labels for the choices, this 157 # method returns the corresponding value. Otherwise, it returns "". 158 # ---------------------------------------------------------------------- 159 itcl::body Rappture::Combochecks::translate {value {defValue ""}} { 160 foreach {val label} [choices get -both] { 161 if {$label eq $value} { 162 return $val 163 } 164 } 165 return $defValue 166 } 167 168 # ---------------------------------------------------------------------- 169 # USAGE: label <value> 170 # 171 # Clients use this to translate a value to a label. 172 # ---------------------------------------------------------------------- 173 itcl::body Rappture::Combochecks::label { myValue } { 174 foreach {val label} [choices get -both] { 175 if {$myValue == $val} { 176 return $label 177 } 178 } 179 return "" 146 180 } 147 181 … … 167 201 # USAGE: _entry click 168 202 # 203 # Used internally to handle the entry widget for this combobox. The 204 # click option is invoked when the user click on the entry widget and 205 # performs a post operation on the dropdown list. The apply option 206 # is invoked when the user presses the Return key to set the value of 207 # the entry widget or selects a value. It generates a Value signal. 208 # ---------------------------------------------------------------------- 209 itcl::body Rappture::Combochecks::_entry {option} { 210 switch -- $option { 211 apply { 212 if {$itk_option(-editable) && $itk_option(-state) == "normal"} { 213 event generate $itk_component(hull) <<Value>> 214 if {[string length $itk_option(-interactcommand)] > 0} { 215 uplevel #0 $itk_option(-interactcommand) 216 } 217 } 218 } 219 click { 220 if {!$itk_option(-editable) && $itk_option(-state) == "normal"} { 221 $itk_component(button) configure -relief sunken 222 update idletasks; after 100 223 $itk_component(button) configure -relief raised 224 225 $itk_component(ddlist) post $itk_component(hull) left 226 } 227 } 228 default { 229 error "bad option \"$option\": should be apply, click" 230 } 231 } 232 } 233 234 # ---------------------------------------------------------------------- 235 # USAGE: _dropdown post 236 # USAGE: _dropdown unpost 237 # USAGE: _dropdown select 238 # 169 239 # Used internally to handle the dropdown list for this combobox. The 170 240 # post/unpost options are invoked when the list is posted or unposted 171 241 # to manage the relief of the controlling button. The select option 172 242 # is invoked whenever there is a selection from the list, to assign 173 # the value back to the gauge.174 # ---------------------------------------------------------------------- 175 itcl::body Rappture::Combochecks::_ entry{option} {243 # the value back to the entry. 244 # ---------------------------------------------------------------------- 245 itcl::body Rappture::Combochecks::_dropdown {option} { 176 246 switch -- $option { 177 apply { 178 if {$itk_option(-state) == "normal"} { 179 event generate $itk_component(hull) <<Value>> 180 } 181 } 182 click { 183 if {$itk_option(-state) == "normal"} { 184 $itk_component(button) configure -relief sunken 185 update idletasks; after 100 186 $itk_component(button) configure -relief raised 187 188 $itk_component(ddlist) post $itk_component(hull) left 247 post { 248 # set value [$itk_component(entry) get] 249 # set i [$itk_component(ddlist) index -label $value] 250 # if {$i >= 0} { 251 # $itk_component(ddlist) select clear 0 end 252 # $itk_component(ddlist) select set $i 253 # } 254 } 255 unpost { 256 if {$itk_option(-editable)} { 257 focus $itk_component(entry) 258 } 259 } 260 select { 261 set newval [$itk_component(ddlist) current -label] 262 set val [$itk_component(entry) get] 263 if {$newval ne "" && $newval ne $val} { 264 value $newval 265 if {[string length $itk_option(-interactcommand)] > 0} { 266 uplevel #0 $itk_option(-interactcommand) 267 } 268 } 269 if {$newval eq ""} { 270 value $val 189 271 } 190 272 } 191 273 default { 192 error "bad option \"$option\": should be apply, click" 193 } 194 } 195 } 196 197 # ---------------------------------------------------------------------- 198 # USAGE: _fixDisplay 199 # 200 # Used internally to handle the dropdown list for this combobox. 201 # Invoked whenever there is a selection from the list, to assign 202 # the value back to the entry. 203 # ---------------------------------------------------------------------- 204 itcl::body Rappture::Combochecks::_fixDisplay {} { 205 $itk_component(entry) configure -state normal 206 $itk_component(entry) delete 0 end 207 $itk_component(entry) insert end [join [value] {, }] 208 $itk_component(entry) configure -state disabled 274 error "bad option \"$option\": should be post, unpost, select" 275 } 276 } 209 277 } 210 278 … … 212 280 # USAGE: _fixState 213 281 # 214 # Used internally to fix the widget state when the - state option215 # changes.282 # Used internally to fix the widget state when the -editable/-state 283 # options change. 216 284 # ---------------------------------------------------------------------- 217 285 itcl::body Rappture::Combochecks::_fixState {} { … … 232 300 } 233 301 234 if {$itk_option(-state) != "normal"} { 302 if {$itk_option(-editable)} { 303 if {$itk_option(-state) == "normal"} { 304 $itk_component(entry) configure -state normal 305 } else { 306 $itk_component(entry) configure -state disabled 307 } 308 } else { 309 $itk_component(entry) configure -state disabled 310 } 311 312 if {!$itk_option(-editable) || $itk_option(-state) != "normal"} { 235 313 # can't keep focus here -- move it along to the next widget 236 314 if {[focus] == $itk_component(entry)} { … … 238 316 } 239 317 } 318 } 319 320 # ---------------------------------------------------------------------- 321 # CONFIGURATION OPTION: -editable 322 # ---------------------------------------------------------------------- 323 itcl::configbody Rappture::Combochecks::editable { 324 if {![string is boolean -strict $itk_option(-editable)]} { 325 error "bad value \"$itk_option(-editable)\": should be boolean" 326 } 327 _fixState 240 328 } 241 329 -
branches/multichoice/gui/scripts/controlOwner.tcl
r5659 r6251 67 67 integer current 68 68 loader current 69 multichoice current 69 70 note contents 70 71 number current -
branches/multichoice/gui/scripts/controls.tcl
r5659 r6251 154 154 loader { 155 155 Rappture::Loader $w $_owner $path -tool [$_owner tool] 156 bind $w <<Value>> [itcl::code $this _controlChanged $name] 157 } 158 multichoice { 159 Rappture::MultiChoiceEntry $w $_owner $path 156 160 bind $w <<Value>> [itcl::code $this _controlChanged $name] 157 161 } -
branches/multichoice/gui/scripts/dropdownchecks.tcl
r5659 r6251 38 38 public method state {value {newval ""}} 39 39 public method reset {} 40 public method current {{what -value}} 40 41 41 42 private variable _dispatcher "" ;# dispatcher for !events … … 280 281 set _states($val) 0 281 282 } 283 } 284 285 # ---------------------------------------------------------------------- 286 # USAGE: current ?-value|-label|-both? 287 # 288 # Clients use this to query the current selections from the listbox/canvas. 289 # Returns a list of values, labels, or list of lists of both, according 290 # to the option. 291 # ---------------------------------------------------------------------- 292 itcl::body Rappture::Dropdownchecks::current {{what -value}} { 293 set rlist "" 294 set l [llength $_values] 295 for {set i 0} {$i < $l} {incr i} { 296 set val [lindex $_values $i] 297 if {$_states($val)} { 298 switch -- $what { 299 -value { lappend rlist [lindex $_values $i] } 300 -label { lappend rlist [lindex $_labels $i] } 301 -both { lappend rlist [list [lindex $_values $i] \ 302 [lindex $_labels $i]] } 303 default { 304 error "bad option \"$what\": should be -value, -label, -both" 305 } 306 } 307 } 308 } 309 return $rlist 282 310 } 283 311 -
branches/multichoice/gui/scripts/page.tcl
r5659 r6251 176 176 set type [$obj element -as type] 177 177 switch -- $type { 178 number - integer - boolean - choice {178 number - integer - boolean - choice - multichoice { 179 179 Rappture::ResultViewer $w -width 0 -height 0 180 180 pack $w -fill x -padx 4 -pady 4 -
branches/multichoice/gui/scripts/resultviewer.tcl
r6052 r6251 26 26 27 27 constructor {args} { 28 28 # defined below 29 29 } 30 30 destructor { … … 395 395 } 396 396 } 397 boolean - choice {397 boolean - choice - multichoice { 398 398 set mode "value" 399 399 if {![info exists _mode2widget($mode)]} { … … 549 549 set dobj [$xmlobj element -as object $path] 550 550 } 551 number - integer - boolean - choice {551 number - integer - boolean - choice - multichoice { 552 552 set dobj [$xmlobj element -as object $path] 553 553 } -
branches/multichoice/lang/tcl/scripts/Makefile.in
r4209 r6251 57 57 image \ 58 58 integer \ 59 multichoice \ 59 60 note \ 60 61 number \
Note: See TracChangeset
for help on using the changeset viewer.