Changeset 711
- Timestamp:
- May 7, 2007, 3:18:15 PM (17 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/examples/graph/graph.py
r555 r711 27 27 28 28 io.put('output.curve(result).about.label','Formula: Y vs X',append=0) 29 io.put('output.curve(result).yaxis.label','Y') 30 io.put('output.curve(result).xaxis.label','X') 29 31 30 32 for i in range(npts): -
trunk/examples/zoo/loader/tool.xml
r72 r711 22 22 </about> 23 23 <example>*.xml</example> 24 <upload> 25 <to>input.string(one)</to> 26 <to>input.string(two)</to> 27 </upload> 28 <download> 29 <from>input.string(one)</from> 30 <from>input.string(two)</from> 31 </download> 24 32 </loader> 25 33 … … 34 42 </about> 35 43 </string> 44 <number id="e"> 45 <about> 46 <label>Mass</label> 47 </about> 48 <units>kg</units> 49 <default>10g</default> 50 </number> 36 51 </input> 37 52 </run> -
trunk/gui/scripts/mainwin.tcl
r676 r711 150 150 set _sync(selection) "" 151 151 152 global tcl_platform 153 if {$tcl_platform(platform) == "unix"} { 154 # this sync stuff works only for X windows 155 blt::cutbuffer set "" 156 syncCutBuffer ifneeded 157 } 152 # 153 # We used to do this to make "copy/paste with desktop" work 154 # properly. Well, it never really worked *properly*, but 155 # it was an attempt. We might as well skip it. We use 156 # the importfile/exportfile stuff now. 157 # 158 ##global tcl_platform 159 ##if {$tcl_platform(platform) == "unix"} { 160 ## # this sync stuff works only for X windows 161 ## blt::cutbuffer set "" 162 ## syncCutBuffer ifneeded 163 ##} 158 164 } 159 165 -
trunk/gui/scripts/moleculeViewer.tcl
r464 r711 31 31 destructor { # defined below } 32 32 33 public method add {dataobj {settings ""}} 34 public method get {} 35 public method delete {args} 36 33 37 public method emblems {option} 34 38 public method download {option args} … … 44 48 45 49 private variable _tool "" ;# tool containing this viewer 50 private variable _dlist "" ;# list of dataobj objects 51 private variable _dobj2raise ;# maps dataobj => raise flag 46 52 private variable _actors "" ;# list of actors in renderer 47 53 private variable _label2atom ;# maps 2D text actor => underlying atom … … 201 207 202 208 image delete $_download 209 } 210 211 # ---------------------------------------------------------------------- 212 # USAGE: add <dataobj> ?<settings>? 213 # 214 # Clients use this to add a data object to the plot. The optional 215 # <settings> are used to configure the plot. Allowed settings are 216 # -color, -brightness, -width, -linestyle, and -raise. Only 217 # -brightness and -raise do anything. 218 # ---------------------------------------------------------------------- 219 itcl::body Rappture::MoleculeViewer::add {dataobj {settings ""}} { 220 array set params { 221 -color auto 222 -brightness 0 223 -width 1 224 -raise 0 225 -linestyle solid 226 -description "" 227 } 228 foreach {opt val} $settings { 229 if {![info exists params($opt)]} { 230 error "bad settings \"$opt\": should be [join [lsort [array names params]] {, }]" 231 } 232 set params($opt) $val 233 } 234 235 set pos [lsearch -exact $dataobj $_dlist] 236 237 if {$pos < 0} { 238 if {![Rappture::library isvalid $dataobj]} { 239 error "bad value \"$dataobj\": should be Rappture::library object" 240 } 241 242 set emblem [$dataobj get components.molecule.about.emblems] 243 if {$emblem == "" || ![string is boolean $emblem] || !$emblem} { 244 emblems off 245 } else { 246 emblems on 247 } 248 249 lappend _dlist $dataobj 250 set _dobj2raise($dataobj) $params(-raise) 251 252 $_dispatcher event -idle !redraw 253 } 254 } 255 256 # ---------------------------------------------------------------------- 257 # USAGE: get 258 # 259 # Clients use this to query the list of objects being plotted, in 260 # order from bottom to top of this result. 261 # ---------------------------------------------------------------------- 262 itcl::body Rappture::MoleculeViewer::get {} { 263 # put the dataobj list in order according to -raise options 264 set dlist $_dlist 265 foreach obj $dlist { 266 if {[info exists _dobj2raise($obj)] && $_dobj2raise($obj)} { 267 set i [lsearch -exact $dlist $obj] 268 if {$i >= 0} { 269 set dlist [lreplace $dlist $i $i] 270 lappend dlist $obj 271 } 272 } 273 } 274 return $dlist 275 } 276 277 # ---------------------------------------------------------------------- 278 # USAGE: delete ?<dataobj> <dataobj> ...? 279 # 280 # Clients use this to delete a dataobj from the plot. If no dataobjs 281 # are specified, then all dataobjs are deleted. 282 # ---------------------------------------------------------------------- 283 itcl::body Rappture::MoleculeViewer::delete {args} { 284 if {[llength $args] == 0} { 285 set args $_dlist 286 } 287 288 # delete all specified dataobjs 289 set changed 0 290 foreach dataobj $args { 291 set pos [lsearch -exact $_dlist $dataobj] 292 if {$pos >= 0} { 293 set _dlist [lreplace $_dlist $pos $pos] 294 catch {unset _dobj2raise($dataobj)} 295 set changed 1 296 } 297 } 298 299 # if anything changed, then rebuild the plot 300 if {$changed} { 301 $_dispatcher event -idle !redraw 302 } 203 303 } 204 304 … … 278 378 _clear 279 379 280 if {$itk_option(-device) != ""} {281 set dev $itk_option(-device)380 set dev [lindex [get] end] 381 if {"" != $dev} { 282 382 set lib [Rappture::library standard] 283 383 … … 585 685 # ---------------------------------------------------------------------- 586 686 itcl::configbody Rappture::MoleculeViewer::device { 587 if { $itk_option(-device) != ""687 if {"" != $itk_option(-device) 588 688 && ![Rappture::library isvalid $itk_option(-device)]} { 589 689 error "bad value \"$itk_option(-device)\": should be Rappture::library object" 590 690 } 591 _clear 592 593 if {$itk_option(-device) != ""} { 691 delete 692 693 if {"" != $itk_option(-device)} { 694 add $itk_option(-device) 594 695 set state [$itk_option(-device) get components.molecule.about.emblems] 595 696 if {$state == "" || ![string is boolean $state] || !$state} {
Note: See TracChangeset
for help on using the changeset viewer.