Changeset 6355 for trunk/gui/scripts/vtkstreamlinesviewer.tcl
- Timestamp:
- May 23, 2016, 12:07:34 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gui/scripts/vtkstreamlinesviewer.tcl
r6338 r6355 105 105 private method Rotate {option x y} 106 106 private method SetCurrentColormap { color } 107 private method SetCurrentFieldName { dataobj } 107 108 private method SetLegendTip { x y } 108 109 private method SetObjectStyle { dataobj comp } … … 978 979 if { [info exists _obj2ovride($dataobj-raise)] && $_first == "" } { 979 980 set _first $dataobj 981 SetCurrentFieldName $dataobj 980 982 } 981 983 foreach comp [$dataobj components] { … … 1023 1025 } 1024 1026 } 1025 $itk_component(field) choices delete 0 end1026 $itk_component(fieldmenu) delete 0 end1027 array unset _fields1028 set _curFldName ""1029 set _curFldLabel ""1030 foreach cname [$_first components] {1031 foreach fname [$_first fieldnames $cname] {1032 if { [info exists _fields($fname)] } {1033 continue1034 }1035 foreach { label units components } \1036 [$_first fieldinfo $fname] break1037 $itk_component(field) choices insert end "$fname" "$label"1038 $itk_component(fieldmenu) add radiobutton -label "$label" \1039 -value $label -variable [itcl::scope _curFldLabel] \1040 -selectcolor red \1041 -activebackground $itk_option(-plotbackground) \1042 -activeforeground $itk_option(-plotforeground) \1043 -font "Arial 8" \1044 -command [itcl::code $this LegendTitleAction save]1045 set _fields($fname) [list $label $units $components]1046 if { $_curFldName == "" && $components == 3 } {1047 set _curFldName $fname1048 set _curFldLabel $label1049 }1050 }1051 }1052 $itk_component(field) value $_curFldLabel1053 1027 } 1054 1028 … … 2434 2408 set _view(-zoom) 1.0 2435 2409 } 2410 2411 itcl::body Rappture::VtkStreamlinesViewer::SetCurrentFieldName { dataobj } { 2412 set _first $dataobj 2413 $itk_component(field) choices delete 0 end 2414 $itk_component(fieldmenu) delete 0 end 2415 array unset _fields 2416 set _curFldName "" 2417 set _curFldLabel "" 2418 foreach cname [$_first components] { 2419 foreach fname [$_first fieldnames $cname] { 2420 if { [info exists _fields($fname)] } { 2421 continue 2422 } 2423 foreach { label units components } \ 2424 [$_first fieldinfo $fname] break 2425 $itk_component(field) choices insert end "$fname" "$label" 2426 $itk_component(fieldmenu) add radiobutton -label "$label" \ 2427 -value $label -variable [itcl::scope _curFldLabel] \ 2428 -selectcolor red \ 2429 -activebackground $itk_option(-plotbackground) \ 2430 -activeforeground $itk_option(-plotforeground) \ 2431 -font "Arial 8" \ 2432 -command [itcl::code $this LegendTitleAction save] 2433 set _fields($fname) [list $label $units $components] 2434 if { $_curFldName == "" && $components == 3 } { 2435 set _curFldName $fname 2436 set _curFldLabel $label 2437 } 2438 } 2439 } 2440 $itk_component(field) value $_curFldLabel 2441 }
Note: See TracChangeset
for help on using the changeset viewer.