diff options
Diffstat (limited to 'ds9')
-rw-r--r-- | ds9/library/plot.tcl | 19 | ||||
-rw-r--r-- | ds9/library/plotbar.tcl | 85 | ||||
-rw-r--r-- | ds9/library/plotconfig.tcl | 2 | ||||
-rw-r--r-- | ds9/library/plotdialog.tcl | 146 | ||||
-rw-r--r-- | ds9/library/plotline.tcl | 89 | ||||
-rw-r--r-- | ds9/library/plotprocess.tcl | 2 | ||||
-rw-r--r-- | ds9/library/plotscatter.tcl | 33 | ||||
-rw-r--r-- | ds9/library/plotstate.tcl | 6 |
8 files changed, 221 insertions, 161 deletions
diff --git a/ds9/library/plot.tcl b/ds9/library/plot.tcl index 6cf6d25..7cbbfeb 100644 --- a/ds9/library/plot.tcl +++ b/ds9/library/plot.tcl @@ -156,10 +156,11 @@ proc PlotAddGraph {varname} { # update menus $var(proc,updateelement) $varname - $var(proc,updategraph) $varname + PlotUpdateGraph $varname $var(proc,updatecanvas) $varname - PlotUpdateDataSetMenu $varname + PlotUpdateGraphMenu $varname + PlotUpdateDataMenu $varname PlotStats $varname PlotList $varname @@ -230,12 +231,13 @@ proc PlotDeleteGraph {varname} { # update menus $var(proc,updateelement) $varname - $var(proc,updategraph) $varname + PlotUpdateGraph $varname $var(proc,updatecanvas) $varname PlotLayoutCanvas $varname - PlotUpdateDataSetMenu $varname + PlotUpdateGraphMenu $varname + PlotUpdateDataMenu $varname PlotStats $varname PlotList $varname @@ -265,7 +267,7 @@ proc PlotAddElement {varname} { # update menus $var(proc,updateelement) $varname - PlotUpdateDataSetMenu $varname + PlotUpdateGraphMenu $varname PlotStats $varname PlotList $varname @@ -342,7 +344,7 @@ proc PlotDeleteDataSet {varname} { # update menus $var(proc,updateelement) $varname - PlotUpdateDataSetMenu $varname + PlotUpdateGraphMenu $varname PlotStats $varname PlotList $varname @@ -358,7 +360,8 @@ proc PlotCurrentGraph {varname} { PlotRestoreState $varname - PlotUpdateDataSetMenu $varname + PlotUpdateGraphMenu $varname + PlotUpdateDataMenu $varname PlotStats $varname PlotList $varname @@ -684,7 +687,7 @@ proc PlotTitle {varname title xaxis yaxis} { set var(graph,axis,x,title) "$xaxis" set var(graph,axis,y,title) "$yaxis" - $var(proc,updategraph) $varname + PlotUpdateGraph $varname } proc PlotBackup {ch dir} { diff --git a/ds9/library/plotbar.tcl b/ds9/library/plotbar.tcl index e1706e7..f1dff93 100644 --- a/ds9/library/plotbar.tcl +++ b/ds9/library/plotbar.tcl @@ -54,97 +54,80 @@ proc PlotBarDialog {varname wtt} { set var(proc,addgraph) PlotBarAddGraph set var(proc,updatecanvas) PlotBarUpdateCanvas - set var(proc,updategraph) PlotUpdateGraph set var(proc,updateelement) PlotBarUpdateElement set var(proc,highlite) PlotHighliteElement set var(proc,button) PlotButton PlotDialog $varname $wtt PlotAddGraph $varname +} - # Graph - $var(mb).graph add separator - $var(mb).graph add cascade -label "[msgcat::mc {Mode}]..." \ - -menu $var(mb).graph.mode - - # Graph Mode - menu $var(mb).graph.mode - $var(mb).graph.mode add radiobutton -label [msgcat::mc {Normal}] \ - -variable ${varname}(bar,mode) -value normal \ - -command [list $var(proc,updatecanvas) $varname] - $var(mb).graph.mode add radiobutton -label [msgcat::mc {Stacked}] \ - -variable ${varname}(bar,mode) -value stacked \ - -command [list $var(proc,updatecanvas) $varname] - $var(mb).graph.mode add radiobutton -label [msgcat::mc {Aligned}] \ - -variable ${varname}(bar,mode) -value aligned \ - -command [list $var(proc,updatecanvas) $varname] - $var(mb).graph.mode add radiobutton -label [msgcat::mc {Overlap}] \ - -variable ${varname}(bar,mode) -value overlap \ - -command [list $var(proc,updatecanvas) $varname] +proc PlotBarMenus {varname} { + upvar #0 $varname var + global $varname # Data - $var(mb).data add checkbutton -label [msgcat::mc {Show}] \ + menu $var(mb).databar + $var(mb).databar add checkbutton -label [msgcat::mc {Show}] \ -variable ${varname}(graph,ds,show) \ -command [list PlotBarUpdateElement $varname] - $var(mb).data add separator - $var(mb).data add cascade -label [msgcat::mc {Color}] \ - -menu $var(mb).data.color - $var(mb).data add cascade -label [msgcat::mc {Relief}] \ - -menu $var(mb).data.relief - $var(mb).data add cascade -label [msgcat::mc {Error}] \ - -menu $var(mb).data.error - $var(mb).data add separator - $var(mb).data add command -label "[msgcat::mc {Name}]..." \ + $var(mb).databar add separator + $var(mb).databar add cascade -label [msgcat::mc {Color}] \ + -menu $var(mb).databar.color + $var(mb).databar add cascade -label [msgcat::mc {Relief}] \ + -menu $var(mb).databar.relief + $var(mb).databar add cascade -label [msgcat::mc {Error}] \ + -menu $var(mb).databar.error + $var(mb).databar add separator + $var(mb).databar add command -label "[msgcat::mc {Name}]..." \ -command [list DatasetNameDialog $varname] - PlotColorMenu $var(mb).data.color $varname graph,color \ + PlotColorMenu $var(mb).databar.color $varname graph,color \ [list PlotBarUpdateElement $varname] # Relief - menu $var(mb).data.relief - $var(mb).data.relief add radiobutton -label [msgcat::mc {Flat}] \ + menu $var(mb).databar.relief + $var(mb).databar.relief add radiobutton -label [msgcat::mc {Flat}] \ -variable ${varname}(graph,ds,bar,relief) -value flat \ -command [list PlotBarUpdateElement $varname] - $var(mb).data.relief add radiobutton -label [msgcat::mc {Sunken}] \ + $var(mb).databar.relief add radiobutton -label [msgcat::mc {Sunken}] \ -variable ${varname}(graph,ds,bar,relief) -value sunken \ -command [list PlotBarUpdateElement $varname] - $var(mb).data.relief add radiobutton -label [msgcat::mc {Raised}] \ + $var(mb).databar.relief add radiobutton -label [msgcat::mc {Raised}] \ -variable ${varname}(graph,ds,bar,relief) -value raised \ -command [list PlotBarUpdateElement $varname] - $var(mb).data.relief add radiobutton -label [msgcat::mc {Solid}] \ + $var(mb).databar.relief add radiobutton -label [msgcat::mc {Solid}] \ -variable ${varname}(graph,ds,bar,relief) -value solid \ -command [list PlotBarUpdateElement $varname] - $var(mb).data.relief add radiobutton -label [msgcat::mc {Groove}] \ + $var(mb).databar.relief add radiobutton -label [msgcat::mc {Groove}] \ -variable ${varname}(graph,ds,bar,relief) -value groove \ -command [list PlotBarUpdateElement $varname] # Error - menu $var(mb).data.error - $var(mb).data.error add checkbutton -label [msgcat::mc {Show}] \ + menu $var(mb).databar.error + $var(mb).databar.error add checkbutton -label [msgcat::mc {Show}] \ -variable ${varname}(graph,ds,error) \ -command [list PlotBarUpdateElement $varname] - $var(mb).data.error add checkbutton -label [msgcat::mc {Cap}] \ + $var(mb).databar.error add checkbutton -label [msgcat::mc {Cap}] \ -variable ${varname}(graph,ds,error,cap) \ -command [list PlotBarUpdateElement $varname] - $var(mb).data.error add separator - $var(mb).data.error add cascade -label [msgcat::mc {Color}] \ - -menu $var(mb).data.error.color - $var(mb).data.error add cascade -label [msgcat::mc {Width}] \ - -menu $var(mb).data.error.width + $var(mb).databar.error add separator + $var(mb).databar.error add cascade -label [msgcat::mc {Color}] \ + -menu $var(mb).databar.error.color + $var(mb).databar.error add cascade -label [msgcat::mc {Width}] \ + -menu $var(mb).databar.error.width - PlotColorMenu $var(mb).data.error.color $varname graph,ds,error,color \ + PlotColorMenu $var(mb).databar.error.color $varname graph,ds,error,color \ [list PlotBarUpdateElement $varname] - WidthDashMenu $var(mb).data.error.width $varname graph,ds,error,width {} \ - [list PlotBarUpdateElement $varname] {} + WidthDashMenu $var(mb).databar.error.width $varname graph,ds,error,width \ + {} [list PlotBarUpdateElement $varname] {} } proc PlotBarAddGraph {varname} { upvar #0 $varname var global $varname - set cc $var(graph,current) - - set var($cc,type) bar + set var(graph,type) bar blt::barchart $var(graph) -width 600 -height 500 -highlightthickness 0 $var(graph) xaxis configure -grid no -stepsize 0 diff --git a/ds9/library/plotconfig.tcl b/ds9/library/plotconfig.tcl index ecaa49f..6ff10bb 100644 --- a/ds9/library/plotconfig.tcl +++ b/ds9/library/plotconfig.tcl @@ -181,7 +181,7 @@ proc PlotLoadConfigFile {varname filename} { } $var(proc,updateelement) $varname - $var(proc,updategraph) $varname + PlotUpdateGraph $varname $var(proc,updatecanvas) $varname } diff --git a/ds9/library/plotdialog.tcl b/ds9/library/plotdialog.tcl index cc7f193..9e146cf 100644 --- a/ds9/library/plotdialog.tcl +++ b/ds9/library/plotdialog.tcl @@ -39,7 +39,7 @@ proc PlotDialog {varname wtt} { $var(mb) add cascade -label [msgcat::mc {Edit}] -menu $var(mb).edit $var(mb) add cascade -label [msgcat::mc {Canvas}] -menu $var(mb).canvas $var(mb) add cascade -label [msgcat::mc {Graph}] -menu $var(mb).graph - $var(mb) add cascade -label [msgcat::mc {Data}] -menu $var(mb).data + $var(mb) add cascade -label [msgcat::mc {Data}] -menu $var(mb).dataline # File menu $var(mb).file @@ -196,7 +196,6 @@ proc PlotDialog {varname wtt} { $var(mb).graph add separator $var(mb).graph add command -label [msgcat::mc {Duplicate Dataset}] \ -command [list PlotDupDataSet $varname] - $var(mb).graph add separator $var(mb).graph add command -label [msgcat::mc {Delete Dataset}] \ -command [list PlotDeleteDataSetCurrent $varname] $var(mb).graph add separator @@ -206,40 +205,59 @@ proc PlotDialog {varname wtt} { -command "set ${varname}(list) 1; PlotList $varname" $var(mb).graph add separator - menu $var(mb).graph.select - $var(mb).graph add cascade -label [msgcat::mc {Axes}] \ -menu $var(mb).graph.axes $var(mb).graph add separator $var(mb).graph add command -label "[msgcat::mc {Titles}]..." \ -command [list PlotGraphTitleDialog $varname] + $var(mb).graph add separator + $var(mb).graph add cascade -label [msgcat::mc {Mode}] \ + -menu $var(mb).graph.barmode + + menu $var(mb).graph.select menu $var(mb).graph.axes $var(mb).graph.axes add checkbutton -label [msgcat::mc {X Grid}] \ -variable ${varname}(graph,axis,x,grid) \ - -command [list $var(proc,updategraph) $varname] + -command [list PlotUpdateGraph $varname] $var(mb).graph.axes add checkbutton -label [msgcat::mc {Log}] \ -variable ${varname}(graph,axis,x,log) \ - -command [list $var(proc,updategraph) $varname] + -command [list PlotUpdateGraph $varname] $var(mb).graph.axes add checkbutton -label [msgcat::mc {Flip}] \ -variable ${varname}(graph,axis,x,flip) \ - -command [list $var(proc,updategraph) $varname] + -command [list PlotUpdateGraph $varname] $var(mb).graph.axes add separator $var(mb).graph.axes add checkbutton -label [msgcat::mc {Y Grid}] \ -variable ${varname}(graph,axis,y,grid) \ - -command [list $var(proc,updategraph) $varname] + -command [list PlotUpdateGraph $varname] $var(mb).graph.axes add checkbutton -label [msgcat::mc {Log}] \ -variable ${varname}(graph,axis,y,log) \ - -command [list $var(proc,updategraph) $varname] + -command [list PlotUpdateGraph $varname] $var(mb).graph.axes add checkbutton -label [msgcat::mc {Flip}] \ -variable ${varname}(graph,axis,y,flip) \ - -command [list $var(proc,updategraph) $varname] + -command [list PlotUpdateGraph $varname] $var(mb).graph.axes add separator $var(mb).graph.axes add command -label "[msgcat::mc {Range}]..." \ -command [list PlotRangeDialog $varname] - # dataset - menu $var(mb).data + # Graph Mode + menu $var(mb).graph.barmode + $var(mb).graph.barmode add radiobutton -label [msgcat::mc {Normal}] \ + -variable ${varname}(bar,mode) -value normal \ + -command [list $var(proc,updatecanvas) $varname] + $var(mb).graph.barmode add radiobutton -label [msgcat::mc {Stacked}] \ + -variable ${varname}(bar,mode) -value stacked \ + -command [list $var(proc,updatecanvas) $varname] + $var(mb).graph.barmode add radiobutton -label [msgcat::mc {Aligned}] \ + -variable ${varname}(bar,mode) -value aligned \ + -command [list $var(proc,updatecanvas) $varname] + $var(mb).graph.barmode add radiobutton -label [msgcat::mc {Overlap}] \ + -variable ${varname}(bar,mode) -value overlap \ + -command [list $var(proc,updatecanvas) $varname] + + PlotLineMenus $varname + PlotBarMenus $varname + PlotScatterMenus $varname } proc PlotDataFormatDialog {xarname} { @@ -371,7 +389,7 @@ proc PlotRangeDialog {varname} { set var(graph,axis,y,max) $ed(graph,axis,y,max) set var(graph,axis,y,format) $ed(graph,axis,y,format) - $var(proc,updategraph) $varname + PlotUpdateGraph $varname } set rr $ed(ok) @@ -435,7 +453,7 @@ proc PlotGraphTitleDialog {varname} { set var(graph,axis,y,title) $ed(graph,axis,y,title) set var(graph,legend,title) $ed(graph,legend,title) - $var(proc,updategraph) $varname + PlotUpdateGraph $varname } set rr $ed(ok) @@ -517,84 +535,84 @@ proc PlotLineShapeMenu {which var} { -variable $var -value arrow } -proc PlotShapeMenu {varname} { +proc PlotShapeMenu {varname which} { upvar #0 $varname var global $varname # Shape - menu $var(mb).data.shape - $var(mb).data.shape add radiobutton \ + menu $var(mb).$which.shape + $var(mb).$which.shape add radiobutton \ -label [msgcat::mc {None}] \ -variable ${varname}(graph,ds,shape,symbol) -value none \ -command [list $var(proc,updateelement) $varname] - $var(mb).data.shape add radiobutton \ + $var(mb).$which.shape add radiobutton \ -label [msgcat::mc {Circle}] \ -variable ${varname}(graph,ds,shape,symbol) -value circle \ -command [list $var(proc,updateelement) $varname] - $var(mb).data.shape add radiobutton \ + $var(mb).$which.shape add radiobutton \ -label [msgcat::mc {Square}] \ -variable ${varname}(graph,ds,shape,symbol) -value square \ -command [list $var(proc,updateelement) $varname] - $var(mb).data.shape add radiobutton \ + $var(mb).$which.shape add radiobutton \ -label [msgcat::mc {Diamond}] \ -variable ${varname}(graph,ds,shape,symbol) -value diamond \ -command [list $var(proc,updateelement) $varname] - $var(mb).data.shape add radiobutton \ + $var(mb).$which.shape add radiobutton \ -label [msgcat::mc {Plus}] \ -variable ${varname}(graph,ds,shape,symbol) -value plus \ -command [list $var(proc,updateelement) $varname] - $var(mb).data.shape add radiobutton \ + $var(mb).$which.shape add radiobutton \ -label [msgcat::mc {Cross}] \ -variable ${varname}(graph,ds,shape,symbol) -value cross \ -command [list $var(proc,updateelement) $varname] - $var(mb).data.shape add radiobutton \ + $var(mb).$which.shape add radiobutton \ -label [msgcat::mc {Simple Plus}] \ -variable ${varname}(graph,ds,shape,symbol) -value splus \ -command [list $var(proc,updateelement) $varname] - $var(mb).data.shape add radiobutton \ + $var(mb).$which.shape add radiobutton \ -label [msgcat::mc {Simple Cross}] \ -variable ${varname}(graph,ds,shape,symbol) -value scross \ -command [list $var(proc,updateelement) $varname] - $var(mb).data.shape add radiobutton \ + $var(mb).$which.shape add radiobutton \ -label [msgcat::mc {Triangle}] \ -variable ${varname}(graph,ds,shape,symbol) -value triangle \ -command [list $var(proc,updateelement) $varname] - $var(mb).data.shape add radiobutton \ + $var(mb).$which.shape add radiobutton \ -label [msgcat::mc {Arrow}] \ -variable ${varname}(graph,ds,shape,symbol) -value arrow \ -command [list $var(proc,updateelement) $varname] - $var(mb).data.shape add separator - $var(mb).data.shape add checkbutton \ + $var(mb).$which.shape add separator + $var(mb).$which.shape add checkbutton \ -label [msgcat::mc {Fill}] \ -variable ${varname}(graph,ds,shape,fill) \ -command [list $var(proc,updateelement) $varname] - $var(mb).data.shape add cascade -label [msgcat::mc {Color}] \ - -menu $var(mb).data.shape.color + $var(mb).$which.shape add cascade -label [msgcat::mc {Color}] \ + -menu $var(mb).$which.shape.color - PlotColorMenu $var(mb).data.shape.color $varname graph,ds,shape,color \ + PlotColorMenu $var(mb).$which.shape.color $varname graph,ds,shape,color \ [list $var(proc,updateelement) $varname] } -proc PlotErrorMenu {varname} { +proc PlotErrorMenu {varname which} { upvar #0 $varname var global $varname - menu $var(mb).data.error - $var(mb).data.error add checkbutton -label [msgcat::mc {Show}] \ + menu $var(mb).$which.error + $var(mb).$which.error add checkbutton -label [msgcat::mc {Show}] \ -variable ${varname}(graph,ds,error) \ -command [list $var(proc,updateelement) $varname] - $var(mb).data.error add checkbutton -label [msgcat::mc {Cap}] \ + $var(mb).$which.error add checkbutton -label [msgcat::mc {Cap}] \ -variable ${varname}(graph,ds,error,cap) \ -command [list $var(proc,updateelement) $varname] - $var(mb).data.error add separator - $var(mb).data.error add cascade -label [msgcat::mc {Color}] \ - -menu $var(mb).data.error.color - $var(mb).data.error add cascade -label [msgcat::mc {Width}] \ - -menu $var(mb).data.error.width + $var(mb).$which.error add separator + $var(mb).$which.error add cascade -label [msgcat::mc {Color}] \ + -menu $var(mb).$which.error.color + $var(mb).$which.error add cascade -label [msgcat::mc {Width}] \ + -menu $var(mb).$which.error.width - PlotColorMenu $var(mb).data.error.color $varname graph,ds,error,color \ + PlotColorMenu $var(mb).$which.error.color $varname graph,ds,error,color \ [list $var(proc,updateelement) $varname] - WidthDashMenu $var(mb).data.error.width $varname graph,ds,error,width {} \ + WidthDashMenu $var(mb).$which.error.width $varname graph,ds,error,width {} \ [list $var(proc,updateelement) $varname] {} } @@ -670,10 +688,30 @@ proc PlotExport {varname fn format} { DarwinPhotoRestore $var(top) $geom } -proc PlotUpdateDataSetMenu {varname} { +proc PlotUpdateGraphMenu {varname} { upvar #0 $varname var global $varname + if {[llength $var(graph,dss)] == 0} { + $var(mb) entryconfig [msgcat::mc {Data}] -state disabled + $var(mb).graph entryconfig [msgcat::mc {Duplicate Dataset}] \ + -state disabled + $var(mb).graph entryconfig [msgcat::mc {Delete Dataset}] \ + -state disabled + } else { + $var(mb) entryconfig [msgcat::mc {Data}] -state normal + $var(mb).graph entryconfig [msgcat::mc {Duplicate Dataset}] \ + -state normal + + if {!$var(graph,ds,manage)} { + $var(mb).graph entryconfig [msgcat::mc {Delete Dataset}] \ + -state disabled + } else { + $var(mb).graph entryconfig [msgcat::mc {Delete Dataset}] \ + -state normal + } + } + # remove menu item $var(mb).graph.select delete 0 end @@ -686,4 +724,26 @@ proc PlotUpdateDataSetMenu {varname} { } } +proc PlotUpdateDataMenu {varname} { + upvar #0 $varname var + global $varname + $var(mb) delete [msgcat::mc {Data}] + switch $var(graph,type) { + line { + $var(mb) add cascade -label [msgcat::mc {Data}] \ + -menu $var(mb).dataline + $var(mb).graph entryconfig Mode -state disabled + } + bar { + $var(mb) add cascade -label [msgcat::mc {Data}] \ + -menu $var(mb).databar + $var(mb).graph entryconfig Mode -state normal + } + scatter { + $var(mb) add cascade -label [msgcat::mc {Data}] \ + -menu $var(mb).datascatter + $var(mb).graph entryconfig Mode -state disabled + } + } +} diff --git a/ds9/library/plotline.tcl b/ds9/library/plotline.tcl index 50b2d75..2135847 100644 --- a/ds9/library/plotline.tcl +++ b/ds9/library/plotline.tcl @@ -54,111 +54,114 @@ proc PlotLineDialog {varname wtt} { set var(proc,addgraph) PlotLineAddGraph set var(proc,updatecanvas) PlotUpdateCanvas - set var(proc,updategraph) PlotUpdateGraph set var(proc,updateelement) PlotLineUpdateElement set var(proc,highlite) PlotHighliteElement set var(proc,button) PlotButton PlotDialog $varname $wtt PlotAddGraph $varname +} + +proc PlotLineMenus {varname} { + upvar #0 $varname var + global $varname # Data - $var(mb).data add checkbutton -label [msgcat::mc {Show}] \ + menu $var(mb).dataline + $var(mb).dataline add checkbutton -label [msgcat::mc {Show}] \ -variable ${varname}(graph,ds,show) \ -command [list PlotLineUpdateElement $varname] - $var(mb).data add separator - $var(mb).data add cascade -label [msgcat::mc {Shape}] \ - -menu $var(mb).data.shape - $var(mb).data add cascade -label [msgcat::mc {Smooth}] \ - -menu $var(mb).data.smooth - $var(mb).data add cascade -label [msgcat::mc {Color}] \ - -menu $var(mb).data.color - $var(mb).data add cascade -label [msgcat::mc {Width}] \ - -menu $var(mb).data.width - $var(mb).data add cascade -label [msgcat::mc {Fill}] \ - -menu $var(mb).data.fill - $var(mb).data add cascade -label [msgcat::mc {Error}] \ - -menu $var(mb).data.error - $var(mb).data add separator - $var(mb).data add command -label "[msgcat::mc {Name}]..." \ + $var(mb).dataline add separator + $var(mb).dataline add cascade -label [msgcat::mc {Shape}] \ + -menu $var(mb).dataline.shape + $var(mb).dataline add cascade -label [msgcat::mc {Smooth}] \ + -menu $var(mb).dataline.smooth + $var(mb).dataline add cascade -label [msgcat::mc {Color}] \ + -menu $var(mb).dataline.color + $var(mb).dataline add cascade -label [msgcat::mc {Width}] \ + -menu $var(mb).dataline.width + $var(mb).dataline add cascade -label [msgcat::mc {Fill}] \ + -menu $var(mb).dataline.fill + $var(mb).dataline add cascade -label [msgcat::mc {Error}] \ + -menu $var(mb).dataline.error + $var(mb).dataline add separator + $var(mb).dataline add command -label "[msgcat::mc {Name}]..." \ -command [list DatasetNameDialog $varname] # Shape - PlotShapeMenu $varname + PlotShapeMenu $varname dataline # Smooth - menu $var(mb).data.smooth - $var(mb).data.smooth add radiobutton \ + menu $var(mb).dataline.smooth + $var(mb).dataline.smooth add radiobutton \ -label [msgcat::mc {Step}] \ -variable ${varname}(graph,ds,smooth) -value step \ -command [list PlotLineUpdateElement $varname] - $var(mb).data.smooth add radiobutton \ + $var(mb).dataline.smooth add radiobutton \ -label [msgcat::mc {Linear}] \ -variable ${varname}(graph,ds,smooth) -value linear \ -command [list PlotLineUpdateElement $varname] - $var(mb).data.smooth add radiobutton \ + $var(mb).dataline.smooth add radiobutton \ -label [msgcat::mc {Cubic}] \ -variable ${varname}(graph,ds,smooth) -value cubic \ -command [list PlotLineUpdateElement $varname] - $var(mb).data.smooth add radiobutton \ + $var(mb).dataline.smooth add radiobutton \ -label [msgcat::mc {Quadratic}] \ -variable ${varname}(graph,ds,smooth) -value quadratic \ -command [list PlotLineUpdateElement $varname] - $var(mb).data.smooth add radiobutton \ + $var(mb).dataline.smooth add radiobutton \ -label [msgcat::mc {Catrom}] \ -variable ${varname}(graph,ds,smooth) -value catrom \ -command [list PlotLineUpdateElement $varname] # Color - PlotColorMenu $var(mb).data.color $varname graph,ds,color \ + PlotColorMenu $var(mb).dataline.color $varname graph,ds,color \ [list PlotLineUpdateElement $varname] # Width - menu $var(mb).data.width - $var(mb).data.width add radiobutton \ + menu $var(mb).dataline.width + $var(mb).dataline.width add radiobutton \ -label {0} -variable ${varname}(graph,ds,width) \ -value 0 -command [list PlotLineUpdateElement $varname] - $var(mb).data.width add radiobutton \ + $var(mb).dataline.width add radiobutton \ -label {1} -variable ${varname}(graph,ds,width) \ -value 1 -command [list PlotLineUpdateElement $varname] - $var(mb).data.width add radiobutton \ + $var(mb).dataline.width add radiobutton \ -label {2} -variable ${varname}(graph,ds,width) \ -value 2 -command [list PlotLineUpdateElement $varname] - $var(mb).data.width add radiobutton \ + $var(mb).dataline.width add radiobutton \ -label {3} -variable ${varname}(graph,ds,width) \ -value 3 -command [list PlotLineUpdateElement $varname] - $var(mb).data.width add radiobutton \ + $var(mb).dataline.width add radiobutton \ -label {4} -variable ${varname}(graph,ds,width) \ -value 4 -command [list PlotLineUpdateElement $varname] - $var(mb).data.width add separator - $var(mb).data.width add checkbutton \ + $var(mb).dataline.width add separator + $var(mb).dataline.width add checkbutton \ -label [msgcat::mc {Dash}] -variable ${varname}(graph,ds,dash) \ -command [list PlotLineUpdateElement $varname] # Fill - menu $var(mb).data.fill - $var(mb).data.fill add checkbutton \ + menu $var(mb).dataline.fill + $var(mb).dataline.fill add checkbutton \ -label [msgcat::mc {Show}] \ -variable ${varname}(graph,ds,fill) \ -command [list PlotLineUpdateElement $varname] - $var(mb).data.fill add separator - $var(mb).data.fill add cascade -label [msgcat::mc {Color}] \ - -menu $var(mb).data.fill.color + $var(mb).dataline.fill add separator + $var(mb).dataline.fill add cascade -label [msgcat::mc {Color}] \ + -menu $var(mb).dataline.fill.color - PlotColorMenu $var(mb).data.fill.color $varname graph,ds,fill,color \ + PlotColorMenu $var(mb).dataline.fill.color $varname graph,ds,fill,color \ [list PlotLineUpdateElement $varname] # Error - PlotErrorMenu $varname + PlotErrorMenu $varname dataline } proc PlotLineAddGraph {varname} { upvar #0 $varname var global $varname - set cc $var(graph,current) - - set var($cc,type) line + set var(graph,type) line blt::graph $var(graph) -width 600 -height 500 -highlightthickness 0 } diff --git a/ds9/library/plotprocess.tcl b/ds9/library/plotprocess.tcl index cccd2b5..4cb4e87 100644 --- a/ds9/library/plotprocess.tcl +++ b/ds9/library/plotprocess.tcl @@ -281,7 +281,7 @@ proc PlotCmdUpdateGraph {which value} { upvar #0 $cvarname cvar set cvar($which) $value - $cvar(proc,updategraph) $cvarname + PlotUpdateGraph $cvarname } proc PlotCmdUpdateElement {which value} { diff --git a/ds9/library/plotscatter.tcl b/ds9/library/plotscatter.tcl index 4cafe1d..fdf583d 100644 --- a/ds9/library/plotscatter.tcl +++ b/ds9/library/plotscatter.tcl @@ -54,41 +54,46 @@ proc PlotScatterDialog {varname wtt} { set var(proc,addgraph) PlotScatterAddGraph set var(proc,updatecanvas) PlotUpdateCanvas - set var(proc,updategraph) PlotUpdateGraph set var(proc,updateelement) PlotScatterUpdateElement set var(proc,highlite) PlotScatterHighliteElement set var(proc,button) PlotScatterButton PlotDialog $varname $wtt PlotAddGraph $varname +} + + +proc PlotScatterMenus {varname} { + upvar #0 $varname var + global $varname # Data - $var(mb).data add checkbutton -label [msgcat::mc {Show}] \ + menu $var(mb).datascatter + $var(mb).datascatter add checkbutton -label [msgcat::mc {Show}] \ -variable ${varname}(graph,ds,show) \ -command [list PlotScatterUpdateElement $varname] - $var(mb).data add separator - $var(mb).data add cascade -label [msgcat::mc {Shape}] \ - -menu $var(mb).data.shape - $var(mb).data add cascade -label [msgcat::mc {Error}] \ - -menu $var(mb).data.error - $var(mb).data add separator - $var(mb).data add command -label "[msgcat::mc {Name}]..." \ + $var(mb).datascatter add separator + $var(mb).datascatter add cascade -label [msgcat::mc {Shape}] \ + -menu $var(mb).datascatter.shape + $var(mb).datascatter add cascade -label [msgcat::mc {Error}] \ + -menu $var(mb).datascatter.error + $var(mb).datascatter add separator + $var(mb).datascatter add command -label "[msgcat::mc {Name}]..." \ -command [list DatasetNameDialog $varname] # Shape - PlotShapeMenu $varname + PlotShapeMenu $varname datascatter # Error - PlotErrorMenu $varname + PlotErrorMenu $varname datascatter } + proc PlotScatterAddGraph {varname} { upvar #0 $varname var global $varname - set cc $var(graph,current) - - set var($cc,type) scatter + set var(graph,type) scatter blt::graph $var(graph) -width 600 -height 500 -highlightthickness 0 } diff --git a/ds9/library/plotstate.tcl b/ds9/library/plotstate.tcl index 9fff7a3..778420f 100644 --- a/ds9/library/plotstate.tcl +++ b/ds9/library/plotstate.tcl @@ -94,6 +94,8 @@ proc PlotInitGraph {varname} { set var(canvas) [ttk::frame $var(top).fr$cc] set var(graph) $var(canvas).gr$cc + + set var(graph,type) {} set var(graph,name) "Graph $var(seq)" set var(graph,format) 1 set var(graph,title) {} @@ -161,6 +163,8 @@ proc PlotSaveState {varname} { set var($cc,canvas) $var(canvas) set var($cc,graph) $var(graph) + + set var($cc,type) $var(graph,type) set var($cc,name) $var(graph,name) set var($cc,format) $var(graph,format) set var($cc,title) $var(graph,title) @@ -228,6 +232,8 @@ proc PlotRestoreState {varname} { set var(canvas) $var($cc,canvas) set var(graph) $var($cc,graph) + + set var(graph,type) $var($cc,type) set var(graph,name) $var($cc,name) set var(graph,format) $var($cc,format) set var(graph,title) $var($cc,title) |