@@ -3227,6 +3227,15 @@ def onSelectX(event):
32273227 plotIndex ['plotX' ] = event .GetEventObject ().rbindex
32283228 onPrmPlot (event )
32293229
3230+ def onCopySelRow (event ):
3231+ row = event .GetEventObject ().row
3232+ for i ,h in enumerate (histnames ):
3233+ if i == 0 :
3234+ val = histdict [h ][row ][2 ]
3235+ else :
3236+ histdict [h ][row ][2 ] = val
3237+ wx .CallAfter (MakeMultiParameterWindow ,selected )
3238+
32303239 def onPrmPlot (event ):
32313240 '''Callback after a change to X or Y plot contents
32323241 plots multiple instrument param values vs selected X value.
@@ -3281,26 +3290,27 @@ def onPrmPlot(event):
32813290 parent = G2frame .dataWindow .topPanel
32823291 topSizer .Add (wx .StaticText (parent ,wx .ID_ANY ,lbl ))
32833292 if hlist :
3284- btn = wx .Button (parent , wx .ID_ANY ,'Select\n Histograms ' )
3293+ btn = wx .Button (parent , wx .ID_ANY ,'Select Histograms ' )
32853294 topSizer .Add (btn ,0 ,wx .LEFT | wx .RIGHT ,15 )
32863295 btn .Bind (wx .EVT_BUTTON ,onSelectHists )
3287- topSizer .Add ((20 ,- 1 ))
3296+ topSizer .Add ((20 ,- 1 ), 1 , wx . EXPAND )
32883297 topSizer .Add (G2G .HelpButton (parent ,helpIndex = G2frame .dataWindow .helpKey ))
32893298 mainSizer = wx .BoxSizer (wx .VERTICAL )
32903299 G2frame .dataWindow .SetSizer (mainSizer )
32913300
32923301 # create table w/headers
32933302 sdlg = G2frame .dataWindow
3294- fgs = wx .FlexGridSizer (0 ,len (histnames )+ 3 ,0 ,0 )
3303+ fgs = wx .FlexGridSizer (0 ,len (histnames )+ 4 ,0 ,0 )
32953304 fgs .Add (wx .StaticText (sdlg ,wx .ID_ANY ,'plot\n as X' ),0 ,wx .LEFT | wx .RIGHT ,1 )
32963305 fgs .Add (wx .StaticText (sdlg ,wx .ID_ANY ,'plot\n as Y' ),0 ,wx .LEFT | wx .RIGHT ,1 )
32973306 fgs .Add (wx .StaticText (sdlg ,wx .ID_ANY ,'Histogram ' ),0 ,WACV | wx .LEFT ,14 )
32983307 for i ,h in enumerate (histnames ):
3299- if len (h [: 5 ].strip ()) > 20 :
3300- fgs .Add (G2G .ScrolledStaticText (sdlg ,label = h [5 :],dots = False ,lbllen = 20 ),
3308+ if len (h [5 : ].strip ()) > 15 :
3309+ fgs .Add (G2G .ScrolledStaticText (sdlg ,label = h [5 :],dots = False ,lbllen = 15 ),
33013310 0 ,WACV | wx .LEFT | wx .RIGHT ,5 )
33023311 else :
33033312 fgs .Add (wx .StaticText (sdlg ,wx .ID_ANY ,h [5 :]),0 ,WACV | wx .LEFT | wx .RIGHT ,5 )
3313+ if i == 0 : fgs .Add (wx .StaticText (sdlg ,wx .ID_ANY ,'copy\n right' ),0 ,wx .LEFT | wx .RIGHT ,1 )
33043314 firstRadio = wx .RB_GROUP
33053315 # put non-editable values at top of table (plot as x but not y)
33063316 keylist = ['num' ]
@@ -3320,14 +3330,15 @@ def onPrmPlot(event):
33203330 fgs .Add ((- 1 ,- 1 )) # skip y checkbutton
33213331 fgs .Add (wx .StaticText (sdlg ,wx .ID_ANY ,lbl ),0 ,WACV | wx .LEFT ,14 )
33223332 plotvals = []
3323- for h in histnames :
3333+ for i , h in enumerate ( histnames ) :
33243334 if key == 'num' :
33253335 val = histnum [h ]
33263336 else :
33273337 val = histdict [h ][key ][1 ]
33283338 fgs .Add (wx .StaticText (sdlg ,wx .ID_ANY ,str (val )),
33293339 0 ,wx .ALIGN_CENTER | WACV ,0 )
33303340 plotvals .append (val )
3341+ if i == 0 : fgs .Add ((- 1 ,- 1 )) # skip copy row button
33313342 plotTbl .append (plotvals )
33323343
33333344 # determine what items will be shown based on histogram type
@@ -3364,14 +3375,24 @@ def onPrmPlot(event):
33643375 plotIndex [k ] = rb .rbindex
33653376 fgs .Add (wx .StaticText (sdlg ,wx .ID_ANY ,l ),0 ,WACV | wx .LEFT ,14 )
33663377 plotvals = []
3367- for h in histnames :
3378+ for i , h in enumerate ( histnames ) :
33683379 miniSizer = wx .BoxSizer (wx .HORIZONTAL )
33693380 itemVal = G2G .ValidatedTxtCtrl (sdlg ,histdict [h ][k ],1 ,nDig = (10 ,4 ),typeHint = float )
33703381 plotvals .append (histdict [h ][k ][1 ])
33713382 miniSizer .Add (itemVal )
33723383 miniSizer .Add ((2 ,- 1 ))
3373- miniSizer .Add (G2G .G2CheckBox (sdlg ,'' ,histdict [h ][k ],2 ),0 ,WACV | wx .RIGHT ,15 )
3374- fgs .Add (miniSizer ,0 ,wx .ALIGN_CENTER )
3384+ if i == 0 :
3385+ miniSizer .Add (G2G .G2CheckBox (sdlg ,'' ,histdict [h ][k ],2 ),0 ,WACV | wx .RIGHT ,3 )
3386+ fgs .Add (miniSizer ,0 ,wx .ALIGN_RIGHT )
3387+ # copy row button
3388+ but = wx .Button (sdlg ,wx .ID_ANY ,'\u2192 ' ,style = wx .BU_EXACTFIT )
3389+ #but.SetBackgroundColour('yellow')
3390+ fgs .Add (but ,0 ,wx .RIGHT ,15 )
3391+ but .Bind (wx .EVT_BUTTON , onCopySelRow )
3392+ but .row = k
3393+ else :
3394+ miniSizer .Add (G2G .G2CheckBox (sdlg ,'' ,histdict [h ][k ],2 ),0 ,WACV | wx .RIGHT ,15 )
3395+ fgs .Add (miniSizer ,0 ,wx .ALIGN_CENTER )
33753396 plotTbl .append (plotvals )
33763397
33773398 mainSizer .Add (fgs )
@@ -5185,15 +5206,15 @@ def _showWebPage(event):
51855206 txt = event .GetEventObject ().page
51865207 tmp = tempfile .NamedTemporaryFile (suffix = '.html' ,delete = False )
51875208 with open (tmp .name ,'w' ) as fp :
5188- fp .write (txt .replace ('<HEAD>' ,'<head><base href="https://stokes .byu.edu/">' ,))
5209+ fp .write (txt .replace ('<HEAD>' ,'<head><base href="https://iso .byu.edu/">' ,))
51895210 fileList .append (tmp .name )
51905211 G2G .ShowWebPage ('file://' + tmp .name ,G2frame )
51915212
51925213 def showWebtext (txt ):
51935214 import tempfile
51945215 tmp = tempfile .NamedTemporaryFile (suffix = '.html' ,delete = False )
51955216 with open (tmp .name ,'w' ) as fp :
5196- fp .write (txt .replace ('<HEAD>' ,'<head><base href="https://stokes .byu.edu/">' ,))
5217+ fp .write (txt .replace ('<HEAD>' ,'<head><base href="https://iso .byu.edu/">' ,))
51975218 fileList .append (tmp .name )
51985219 G2G .ShowWebPage ('file://' + tmp .name ,G2frame )
51995220
0 commit comments