Changeset 22 for sans/utils


Ignore:
Timestamp:
Dec 13, 2006 12:05:49 PM (16 years ago)
Author:
ajj
Message:

Moved plot controls to menu - GUI was getting cluttered

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sans/utils/bt5/bt5plot/bt5plot

    r21 r22  
    249249} 
    250250 
    251 # Create menu 
    252 menubutton .mb -text File -menu .mb.fileMenu 
    253 set m [menu .mb.fileMenu -tearoff 0] 
    254 $m add command -label "Set Data Dir" -command selectDirectory 
     251#Create menu frame 
     252set mf [frame .mf] 
     253 
     254# Create File menu 
     255menubutton $mf.filemb -text File -menu $mf.filemb.fileMenu 
     256set fm [menu $mf.filemb.fileMenu -tearoff 0] 
     257$fm add command -label "Set Data Dir" -command selectDirectory 
     258 
     259#Create Plot menu 
     260menubutton $mf.plotmb -text Plot -menu $mf.plotmb.plotMenu 
     261set pm [menu $mf.plotmb.plotMenu -tearoff 0] 
     262$pm add cascade -label "Type" -menu $pm.type 
     263$pm add cascade -label "X-Axis" -menu $pm.xaxis 
     264$pm add cascade -label "Y-Axis" -menu $pm.yaxis 
     265#Create sub menus 
     266set xam [menu $pm.xaxis -tearoff 0] 
     267$xam add radio -label "Lin" -variable loglinX -value "no" -command {changeLogLinX} 
     268$xam add radio -label "Log" -variable loglinX -value "yes" -command {changeLogLinX} 
     269 
     270set yam [menu $pm.yaxis -tearoff 0] 
     271$yam add radio -label "Lin" -variable loglinY -value "no" -command {changeLogLinY} 
     272$yam add radio -label "Log" -variable loglinY -value "yes" -command {changeLogLinY} 
     273 
     274set ptm [menu $pm.type -tearoff 0] 
     275$ptm add radio  -label "Counts" -variable plotType -value "count" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     276$ptm add radio -label "Count Rate" -variable plotType -value "countrate" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     277$ptm add radio -label "Trans" -variable plotType -value "trans" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     278$ptm add radio -label "Mon" -variable plotType -value "mon" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     279 
     280#pack menubuttons into menu 
     281pack $mf.filemb -side left 
     282pack $mf.plotmb -side left 
    255283 
    256284# Create tree 
     
    301329button $pcf.filterReset -text "Clear Plot" -command {resetGraph} 
    302330 
    303 #Frame for radiobutton set to control plot type 
    304 set ptf [frame .filter.pc.pt -borderwidth 1 -relief raised] 
    305 radiobutton $ptf.c -text "Counts" -variable plotType -value "count" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    306 radiobutton $ptf.cr -text "Count Rate" -variable plotType -value "countrate" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    307 radiobutton $ptf.t -text "Trans" -variable plotType -value "trans" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    308 radiobutton $ptf.m -text "Mon" -variable plotType -value "mon" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
    309 $ptf.c select 
    310 pack $ptf.m -side right 
    311 pack $ptf.t -side right 
    312 pack $ptf.cr -side right 
    313 pack $ptf.c -side right  
    314  
    315 #Frame for y-axis log/lin choice 
    316 set logfy [frame .filter.pc.logy -borderwidth 1 -relief raised] 
    317 #Log/lin radiobutton set 
    318 radiobutton $logfy.log -text "Log Y" -variable loglinY -value "yes" -command { changeLogLinY } 
    319 radiobutton $logfy.lin -text "Lin Y" -variable loglinY -value "no" -command { changeLogLinY } 
    320 $logfy.lin select 
    321 pack $logfy.log -side right 
    322 pack $logfy.lin -side right 
    323  
    324 #Frame for y-axis log/lin choice 
    325 set logfx [frame .filter.pc.logx -borderwidth 1 -relief raised] 
    326 #Log/lin radiobutton set 
    327 radiobutton $logfx.log -text "Log X" -variable loglinX -value "yes" -command { changeLogLinX } 
    328 radiobutton $logfx.lin -text "Lin X" -variable loglinX -value "no" -command { changeLogLinX } 
    329 $logfx.lin select 
    330 pack $logfx.log -side right 
    331 pack $logfx.lin -side right 
     331##Frame for radiobutton set to control plot type 
     332#set ptf [frame .filter.pc.pt -borderwidth 1 -relief raised] 
     333#radiobutton $ptf.c -text "Counts" -variable plotType -value "count" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     334#radiobutton $ptf.cr -text "Count Rate" -variable plotType -value "countrate" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     335#radiobutton $ptf.t -text "Trans" -variable plotType -value "trans" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     336#radiobutton $ptf.m -text "Mon" -variable plotType -value "mon" -command {foreach elem [$graph element show] { changePlotType $elem  }} 
     337#$ptf.c select 
     338#pack $ptf.m -side right 
     339#pack $ptf.t -side right 
     340#pack $ptf.cr -side right 
     341#pack $ptf.c -side right  
     342 
     343##Frame for y-axis log/lin choice 
     344#set logfy [frame .filter.pc.logy -borderwidth 1 -relief raised] 
     345##Log/lin radiobutton set 
     346#radiobutton $logfy.log -text "Log Y" -variable loglinY -value "yes" -command { changeLogLinY } 
     347#radiobutton $logfy.lin -text "Lin Y" -variable loglinY -value "no" -command { changeLogLinY } 
     348#$logfy.lin select 
     349#pack $logfy.log -side right 
     350#pack $logfy.lin -side right 
     351 
     352##Frame for y-axis log/lin choice 
     353#set logfx [frame .filter.pc.logx -borderwidth 1 -relief raised] 
     354##Log/lin radiobutton set 
     355#radiobutton $logfx.log -text "Log X" -variable loglinX -value "yes" -command { changeLogLinX } 
     356#radiobutton $logfx.lin -text "Lin X" -variable loglinX -value "no" -command { changeLogLinX } 
     357#$logfx.lin select 
     358#pack $logfx.log -side right 
     359#pack $logfx.lin -side right 
    332360 
    333361pack $pcf.filterReset -side right -padx 25 
    334 pack $logfy -side right 
    335 pack $logfx -side right 
    336 pack $ptf -side right 
     362#pack $logfy -side right 
     363#pack $logfx -side right 
     364#pack $ptf -side right 
    337365pack $pcf -side right 
    338366 
    339367 
    340368# Pack  widgets 
    341 pack .mb -side top -anchor w 
     369pack $mf -side top -anchor w 
    342370pack .vp -fill both -expand true -anchor w 
    343371pack .filter -side bottom -fill x -anchor sw 
Note: See TracChangeset for help on using the changeset viewer.