window title="PBS Assessment" #onClose=".workingDirQuit"

menu nitems=1 label=File
  menuitem label="Save As..." function=calcAssess action=save
  #menuitem label=Exit function=".workingDirQuit"
menu nitems=3 label=View
  menu nitems=1 label=Docs     
    menuitem label="Background" function=openFile action=PopSimDoc.pdf
  menuitem label="R Code" function=openFile action=PopSim.r
  menuitem label=Window   function=openFile action=PopSimWin.txt

grid 1 4
  label text=View: font=bold
  button text=Docs     function=openFile action=PopSimDoc.pdf
  button text="R Code" function=openFile action=PopSim.r
  button text=Window   function=openFile action=PopSimWin.txt

grid 1 4 padx=20 pady=20
  grid 3 1 sticky=NW
    grid 29 2 sticky=NW
      label text="Maturity parameters" font=bold sticky=W
      null
  
      label text="Age class at 50% maturity" sticky=W
      entry name=am50 action=am50 value=2       function=calcAssess mode=numeric width=7 sticky=W
      
      label text="Age class at 95% maturity" sticky=W
      entry name=am95 action=am95 value=5       function=calcAssess mode=numeric width=7 sticky=W
      
      label text="Selectivity parameters" font=bold sticky=W
      null
      
      label text="Age class at 50% selectivity" sticky=W
      entry name=as50 action=as50 value=4       function=calcAssess mode=numeric width=7 sticky=W
      
      label text="Age class at 95% selectivity" sticky=W
      entry name=as95 action=as95 value=5       function=calcAssess mode=numeric width=7 sticky=W
      
      label text="Weight parameters" font=bold sticky=W
      null
      
      label text="w infinity (kg)" sticky=W
      entry name=winf action=winf value="1.5"   function=calcAssess mode=numeric width=7 sticky=W
      
      label text="L infinity (mm)" sticky=W
      entry name=linf action=linf value="500"   function=calcAssess mode=numeric width=7 sticky=W
        
      label text="VonBertalanffy b" sticky=W
      entry name=b action=b value="2.8"         function=calcAssess mode=numeric width=7 sticky=W
      
      label text="VonBertalanffy t0" sticky=W
      entry name=t0 action=t0 value="-0.2"      function=calcAssess mode=numeric width=7 sticky=W
      
      label text="VonBertalanffy K" sticky=W
      entry name=k action=k value="0.2"         function=calcAssess mode=numeric width=7 sticky=W
      
      label text="Fishing rates" font=bold sticky=W
      null
  
      label text=h1 sticky=W
      entry name=h1 action=h1 value=3           function=calcAssess mode=numeric width=7 sticky=W
  
      label text=h2 sticky=W
      entry name=h2 action=h2 value=1           function=calcAssess mode=numeric width=7 sticky=W
  
      label text="Time span" font=bold sticky=W
      null
  
      label text="Number of age classes" sticky=W
      entry name=A action=A value=30            function=calcAssess mode=numeric width=7 sticky=W
  
      label text="Number of years" sticky=W
      entry name=T action=T value=40            function=calcAssess mode=numeric width=7 sticky=W
      
      label text="Other parameters" font=bold sticky=W
      null
  
      label text="Natural mortality rate" sticky=W
      entry name=M action=M value=0.05          function=calcAssess mode=numeric width=7 sticky=W
  
      label text="Mean recruitment (units)" sticky=W
      entry name=R action=R value=1             function=calcAssess mode=numeric width=7 sticky=W
  
      label text=Catchability sticky=W
      entry name=q action=q value=1             function=calcAssess mode=numeric width=7 sticky=W
      
      label text="Standard errors" font=bold sticky=W
      null
      
      label text="Recruitment process error" sticky=W
      entry name=sigma1 action=sigma1 value=1   function=calcAssess mode=numeric width=7 sticky=W
  
      label text="Survival process error" sticky=W
      entry name=sigma2 action=sigma2 value=0.9 function=calcAssess mode=numeric width=7 sticky=W
  
      label text="Index measurement error" sticky=W
      entry name=tau1 action=tau1 value=1       function=calcAssess mode=numeric width=7 sticky=W
  
      label text="Age measurement error" sticky=W
      entry name=tau2 action=tau2 value=0.9     function=calcAssess mode=numeric width=7 sticky=W
  
      label text="Recruitment autocorrelation"  sticky=W
      entry name=gamma1 action=gamma1 value=0.5 function=calcAssess mode=numeric width=7 sticky=W
  
      check name=chk checked=T text="Enable constraints" mode=logical sticky=W
      null  

    null
        
    text name=msg value="Notes:" height=3 width=34 edit=T 
    
  null
  
  null
 
  grid 23 1 sticky=NE
    label text="Display properties" font=bold sticky=W
    grid 5 2 sticky=W
      label text="Max bubble size     " sticky=W
      grid 1 1 sticky=W
        entry name=maxB value=0.1 action=disp function=calcAssess mode=numeric width=5 sticky=W

      label text="Bubble power" sticky=W
      grid 1 1 sticky=W
        entry name=powr value=0.5 action=disp function=calcAssess mode=numeric width=5 sticky=W
      
      label text="Highlight top" sticky=W
      grid 1 2
        entry name=percent value=10 action=disp function=calcAssess mode=numeric width=5 sticky=E
        label text="%" sticky=W
      
      label text="Display numbers" sticky=W
      radio name=unitType value=numbers action=disp function=calcAssess mode=character
        
      label text="Display biomass" sticky=W
      radio name=unitType value=biomass action=disp function=calcAssess mode=character
      
    null
    label text="Choose a display" font=bold sticky=W
    label text="Hidden states" font="11" sticky=W
    radio name=plotType value=recruit   text="Recruits"                action=disp function=calcAssess mode=character sticky=W
    radio name=plotType value=total     text="Total population"        action=disp function=calcAssess mode=character sticky=W
    radio name=plotType value=spawner   text="Spawners"                action=disp function=calcAssess mode=character sticky=W
    radio name=plotType value=select    text="Selected population"     action=disp function=calcAssess mode=character sticky=W
    radio name=plotType value=compare   text="Comparison chart"        action=disp function=calcAssess mode=character sticky=W
    radio name=plotType value=spawnVSrt text="Recruitment vs spawners" action=disp function=calcAssess mode=character sticky=W
    radio name=plotType value=dbubble   text="Theoretical ages"        action=disp function=calcAssess mode=character sticky=W
    radio name=plotType value=sbubble   text="True ages"               action=disp function=calcAssess mode=character sticky=W
    radio name=plotType value=fish      text="Fishing mortality"       action=disp function=calcAssess mode=character sticky=W
    label text="Measurements" font="11" sticky=W
    radio name=plotType value=catch     text="Catch"                   action=disp function=calcAssess mode=character sticky=W
    radio name=plotType value=index     text="Observed index"          action=disp function=calcAssess mode=character sticky=W
    radio name=plotType value=pbubble   text="Observed ages"           action=disp function=calcAssess mode=character sticky=W
    null
    grid 1 5 sticky=W
      button text="Recalculate" action="recalc" function=calcAssess sticky=W
      null
      button text="Save As..." action=save function=calcAssess sticky=W   
      null
      button text="Interact" action=interact function=calcAssess sticky=W
    null
    label text="History" font=bold sticky=W
    history
