Changeset 2203


Ignore:
Timestamp:
Apr 7, 2016 12:30:16 PM (7 years ago)
Author:
vondreele
Message:

add pydiffax to binwin2.7/pydiffax.pyd
put back SetSelectionNoRefresh?
replace all .status.SetFields? with .status.SetStatusText? (except [,] ones)
reset Field widths after any SetFields?

Location:
trunk
Files:
1 added
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r2201 r2203  
    518518        Page.figure.clf()
    519519        Plot = Page.figure.gca()          #get a fresh plot after clf()
    520         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     520        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    521521    except ValueError:
    522522        Plot = G2frame.G2plotNB.addMpl('Structure Factors').gca()
     
    11201120        plotNum = G2frame.G2plotNB.plotList.index('3D Structure Factors')
    11211121        Page = G2frame.G2plotNB.nb.GetPage(plotNum)       
    1122         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     1122        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    11231123    except ValueError:
    11241124        Plot = G2frame.G2plotNB.addOgl('3D Structure Factors')
     
    16381638        Page.figure.clf()
    16391639        Plot = Page.figure.gca()          #get a fresh plot after clf()
    1640         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     1640        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    16411641    except ValueError:
    16421642        if plottype == 'SASD':
     
    21052105        Page.figure.clf()
    21062106        Plot = Page.figure.gca()          #get a fresh plot after clf()
    2107         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2107        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    21082108    except ValueError:
    21092109        newPlot = True
     
    22522252        Page.figure.clf()
    22532253        Plot = Page.figure.gca()
    2254         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2254        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    22552255    except ValueError:
    22562256        newPlot = True
     
    24082408        Page.figure.clf()
    24092409        Plot = Page.figure.gca()
    2410         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2410        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    24112411    except ValueError:
    24122412        newPlot = True
     
    24892489        Page.figure.clf()
    24902490        Plot = Page.figure.gca()
    2491         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2491        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    24922492    except ValueError:
    24932493        newPlot = True
     
    25972597        Page.figure.clf()
    25982598        Plot = Page.figure.gca()
    2599         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2599        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    26002600    except ValueError:
    26012601        newPlot = True
     
    26682668        Page.figure.clf()
    26692669        Plot = Page.figure.gca()
    2670         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2670        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    26712671    except ValueError:
    26722672        newPlot = True
     
    27262726        Page.figure.clf()
    27272727        Plot = Page.figure.gca()          #get a fresh plot after clf()
    2728         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2728        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    27292729    except ValueError:
    27302730        newPlot = True
     
    27652765        if xpos:                                        #avoid out of frame mouse position
    27662766            Page.canvas.SetCursor(wx.CROSS_CURSOR)
    2767             G2frame.G2plotNB.status.SetFields(['','2-theta =%9.3f '%(xpos,)])
     2767            G2frame.G2plotNB.status.SetStatusText('2-theta =%9.3f '%(xpos,),1)
    27682768            if G2frame.PickId and G2frame.PatternTree.GetItemText(G2frame.PickId) in ['Index Peak List','Unit Cells List']:
    27692769                found = []
     
    27832783        Page.figure.clf()
    27842784        Plot = Page.figure.gca()
    2785         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2785        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    27862786    except ValueError:
    27872787        Plot = G2frame.G2plotNB.addMpl('Powder Lines').gca()
     
    28542854        Page.figure.clf()
    28552855        Plot = Page.figure.gca()
    2856         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     2856        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    28572857    except ValueError:
    28582858        Plot = G2frame.G2plotNB.addMpl('Peak Widths').gca()
     
    31903190                    y,x,z = list(xyz/np.max(np.abs(xyz)))
    31913191                   
    3192                     G2frame.G2plotNB.status.SetFields(['',
    3193                         'psi =%9.3f, beta =%9.3f, MRD =%9.3f hkl=%5.2f,%5.2f,%5.2f'%(r,p,ipf,x,y,z)])
    3194                     #G2frame.G2plotNB.status.SetStatusWidths([150,-1])
     3192                    G2frame.G2plotNB.status.SetStatusText(
     3193                        'psi =%9.3f, beta =%9.3f, MRD =%9.3f hkl=%5.2f,%5.2f,%5.2f'%(r,p,ipf,x,y,z),1)
    31953194               
    31963195            elif 'Axial' in SHData['PlotType']:
     
    32063205                        r,p = 2.*npatand(z),npatan2d(ypos,xpos)
    32073206                    pf = G2lat.polfcal(ODFln,SamSym[textureData['Model']],np.array([r,]),np.array([p,]))
    3208                     G2frame.G2plotNB.status.SetFields(['','phi =%9.3f, gam =%9.3f, MRD =%9.3f'%(r,p,pf)])
    3209                     #G2frame.G2plotNB.status.SetStatusWidths([150,-1])
     3207                    G2frame.G2plotNB.status.SetStatusText('phi =%9.3f, gam =%9.3f, MRD =%9.3f'%(r,p,pf),1)
    32103208
    32113209    try:
     
    32163214        if not Page.IsShown():
    32173215            Page.Show()
    3218         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     3216        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    32193217    except ValueError:
    32203218        if '3D' in SHData['PlotType']:
     
    32293227    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    32303228    G2frame.G2plotNB.status.SetFields(['',''])   
     3229    G2frame.G2plotNB.status.SetStatusWidths([150,-1])
    32313230    PH = np.array(SHData['PFhkl'])
    32323231    phi,beta = G2lat.CrsAng(PH,cell,SGData)
     
    33723371        if not Page.IsShown():
    33733372            Page.Show()
    3374         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     3373        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    33753374    except ValueError:
    33763375        Plot = G2frame.G2plotNB.addMpl('Modulation').gca()
     
    34683467    title = ' for\n'+Data['title']
    34693468    newAtomDict = Data.get('newAtomDict',{})
    3470 #    G2frame.G2plotNB.Delete('Covariance')
    34713469    G2frame.G2plotNB.status.DestroyChildren()
    34723470   
     
    35053503                    msg = '%s - %s: %5.3f'%(varyList[xpos],varyList[ypos],covArray[xpos][ypos])
    35063504                Page.canvas.SetToolTipString(msg)
    3507                 G2frame.G2plotNB.status.SetFields(['',msg])
    3508                 #for some reason this needs to be here - otherwise in later wx's width gets changed
    3509                 #G2frame.G2plotNB.status.SetStatusWidths([150,-1])   
     3505                G2frame.G2plotNB.status.SetStatusText(msg,1)
    35103506               
    35113507    try:
     
    35163512        if not Page.IsShown():
    35173513            Page.Show()
    3518         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     3514        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    35193515    except ValueError:
    35203516        Plot = G2frame.G2plotNB.addMpl('Covariance').gca()
     
    35263522    Page.keyPress = OnPlotKeyPress
    35273523    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    3528     G2frame.G2plotNB.status.SetFields(['',''])   
     3524    G2frame.G2plotNB.status.SetFields(['',''])
     3525    G2frame.G2plotNB.status.SetStatusWidths([150,-1])   #need to reset field widths here   
    35293526    acolor = mpl.cm.get_cmap(G2frame.VcovColor)
    35303527    Img = Plot.imshow(covArray,aspect='equal',cmap=acolor,interpolation='nearest',origin='lower',
     
    35863583        if not Page.IsShown():
    35873584            Page.Show()
    3588         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     3585        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    35893586    except ValueError:
    35903587        Plot = G2frame.G2plotNB.addMpl('Torsion').gca()
     
    35953592   
    35963593    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    3597     G2frame.G2plotNB.status.SetFields(['','Use mouse LB to identify torsion atoms'])
     3594    G2frame.G2plotNB.status.SetStatusText('Use mouse LB to identify torsion atoms',1)
    35983595    Plot.plot(X,torsion,'b+')
    35993596    if len(Coeff):
     
    36703667        if not Page.IsShown():
    36713668            Page.Show()
    3672         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     3669        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    36733670    except ValueError:
    36743671        Plot = G2frame.G2plotNB.addMpl('Ramachandran').gca()
     
    36823679    Page.keyPress = OnPlotKeyPress
    36833680    G2frame.G2plotNB.RaisePageNoRefresh(Page)
    3684     G2frame.G2plotNB.status.SetFields(['','Use mouse LB to identify phi/psi atoms'])
     3681    G2frame.G2plotNB.status.SetStatusText('Use mouse LB to identify phi/psi atoms',1)
    36853682    acolor = mpl.cm.get_cmap(G2frame.RamaColor)
    36863683    if RamaName == 'All' or '-1' in RamaName:
     
    40804077                    polygon.append([x0,y0])
    40814078                    G2frame.MaskKey = ''
    4082                     G2frame.G2plotNB.status.SetFields(['','Polygon closed'])
     4079                    G2frame.G2plotNB.status.SetStatusText('Polygon closed',)
    40834080                else:
    4084                     G2frame.G2plotNB.status.SetFields(['','New polygon point: %.1f,%.1f'%(Xpos,Ypos)])
     4081                    G2frame.G2plotNB.status.SetStatusText('New polygon point: %.1f,%.1f'%(Xpos,Ypos),1)
    40854082                    polygon.append([Xpos,Ypos])
    40864083            elif G2frame.MaskKey =='f':
     
    40904087                    frame.append([x0,y0])
    40914088                    G2frame.MaskKey = ''
    4092                     G2frame.G2plotNB.status.SetFields(['','Frame closed'])
     4089                    G2frame.G2plotNB.status.SetStatusText('Frame closed',1)
    40934090                else:
    4094                     G2frame.G2plotNB.status.SetFields(['','New frame point: %.1f,%.1f'%(Xpos,Ypos)])
     4091                    G2frame.G2plotNB.status.SetStatusText('New frame point: %.1f,%.1f'%(Xpos,Ypos),1)
    40954092                    frame.append([Xpos,Ypos])
    40964093            G2imG.UpdateMasks(G2frame,Masks)
     
    44534450        tth = event.xdata
    44544451        if azm and tth:
    4455             G2frame.G2plotNB.status.SetFields(\
    4456                 ['','Detector 2-th =%9.3fdeg, azm = %7.2fdeg'%(tth,azm)])
     4452            G2frame.G2plotNB.status.SetStatusText(\
     4453                'Detector 2-th =%9.3fdeg, azm = %7.2fdeg'%(tth,azm),1)
    44574454                               
    44584455    try:
     
    45214518        tth = event.ydata
    45224519        if azm and tth:
    4523             G2frame.G2plotNB.status.SetFields(\
    4524                 ['','Detector 2-th =%9.3fdeg, azm = %7.2fdeg'%(tth,azm)])
     4520            G2frame.G2plotNB.status.SetStatusText(\
     4521                'Detector 2-th =%9.3fdeg, azm = %7.2fdeg'%(tth,azm),1)
    45254522                               
    45264523    try:
     
    45324529        Page.figure.clf()
    45334530        Plot = Page.figure.gca()          #get a fresh plot after clf()
    4534         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     4531        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    45354532       
    45364533    except ValueError:
     
    56385635        plotNum = G2frame.G2plotNB.plotList.index(generalData['Name'])
    56395636        Page = G2frame.G2plotNB.nb.GetPage(plotNum)
    5640         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     5637        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    56415638    except ValueError:
    56425639        Plot = G2frame.G2plotNB.addOgl(generalData['Name'])
     
    59415938        plotNum = G2frame.G2plotNB.plotList.index('Rigid body')
    59425939        Page = G2frame.G2plotNB.nb.GetPage(plotNum)       
    5943         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     5940        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    59445941    except ValueError:
    59455942        Plot = G2frame.G2plotNB.addOgl('Rigid body')
     
    63256322        plotNum = G2frame.G2plotNB.plotList.index('Layer')
    63266323        Page = G2frame.G2plotNB.nb.GetPage(plotNum)       
    6327         #G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
     6324        G2frame.G2plotNB.SetSelectionNoRefresh(plotNum) # raises plot tab
    63286325    except ValueError:
    63296326        Plot = G2frame.G2plotNB.addOgl('Layer')
Note: See TracChangeset for help on using the changeset viewer.