Changeset 2918


Ignore:
Timestamp:
Jul 7, 2017 5:30:18 PM (4 years ago)
Author:
toby
Message:

wxID w/extra spaces; start on ClearData/SetSizeData? pwdGUI fixes

Location:
branch/2frame
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branch/2frame/GSASIIdataGUI.py

    r2917 r2918  
    48004800            'wxID_PEAKSCOPY', 'wxID_SEQPEAKFIT',)
    48014801       
    4802         G2G.Define_wxId(' wxID_INDXRELOAD', 'wxID_INDEXPEAKS', 'wxID_REFINECELL', 'wxID_COPYCELL', 'wxID_MAKENEWPHASE',
     4802        G2G.Define_wxId('wxID_INDXRELOAD', 'wxID_INDEXPEAKS', 'wxID_REFINECELL', 'wxID_COPYCELL', 'wxID_MAKENEWPHASE',
    48034803            'wxID_EXPORTCELLS',)
    48044804       
     
    56395639        G2G.Define_wxId('wxID_DRAWATOMSTYLE', 'wxID_DRAWATOMLABEL', 'wxID_DRAWATOMCOLOR', 'wxID_DRAWATOMRESETCOLOR',
    56405640            'wxID_DRAWVIEWPOINT', 'wxID_DRAWTRANSFORM', 'wxID_DRAWDELETE', 'wxID_DRAWFILLCELL',
    5641             'wxID_DRAWADDEQUIV', 'wxID_DRAWFILLCOORD', 'wxID_DRAWDISAGLTOR', ' wxID_DRAWPLANE',
     5641            'wxID_DRAWADDEQUIV', 'wxID_DRAWFILLCOORD', 'wxID_DRAWDISAGLTOR', 'wxID_DRAWPLANE',
    56425642            'wxID_DRAWDISTVP', 'wxID_DRAWADDSPHERE', 'wxID_DRWAEDITRADII',)
    56435643        G2G.Define_wxId('wxID_DRAWRESTRBOND', 'wxID_DRAWRESTRANGLE', 'wxID_DRAWRESTRPLANE', 'wxID_DRAWRESTRCHIRAL',)
  • branch/2frame/GSASIIpwdGUI.py

    r2917 r2918  
    6666        wx.Dialog.__init__(self,parent,-1,'Background radial distribution function',
    6767            pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE)
    68         self.panel = wx.Panel(self)         #just a dummy - gets destroyed in Draw!
     68        self.panel = None
    6969        self.result = {'UseObsCalc':True,'maxR':20.0,'Smooth':'linear'}
    7070       
     
    7979            self.result['Smooth'] = smCombo.GetValue()
    8080                   
    81         self.panel.Destroy()
     81        if self.panel: self.panel.Destroy()
    8282        self.panel = wx.Panel(self)
    8383        mainSizer = wx.BoxSizer(wx.VERTICAL)
     
    895895    '''respond to selection of PWDR background data tree item.
    896896    '''
    897     if len(data) < 2:       #add Debye diffuse & peaks scattering here
    898         data.append({'nDebye':0,'debyeTerms':[],'nPeaks':0,'peaksList':[]})
    899     if 'nPeaks' not in data[1]:
    900         data[1].update({'nPeaks':0,'peaksList':[]})
    901     G2frame.dataWindow.currentGrids = []
    902897   
    903898    def OnBackFlagCopy(event):
     
    12501245            peaksSizer.Add(peaksGrid)       
    12511246        return peaksSizer
    1252                
     1247
     1248    # UpdateBackground execution starts here
     1249    if len(data) < 2:       #add Debye diffuse & peaks scattering here
     1250        data.append({'nDebye':0,'debyeTerms':[],'nPeaks':0,'peaksList':[]})
     1251    if 'nPeaks' not in data[1]:
     1252        data[1].update({'nPeaks':0,'peaksList':[]})
     1253    G2frame.dataWindow.currentGrids = []
    12531254    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.BackMenu)
    12541255    G2frame.Bind(wx.EVT_MENU,OnBackCopy,id=G2G.wxID_BACKCOPY)
     
    12601261    BackId = G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId, 'Background')
    12611262    Choices = ['chebyschev','cosine','Q^2 power series','Q^-2 power series','lin interpolate','inv interpolate','log interpolate']
     1263    G2frame.dataWindow.ClearData()
    12621264    mainSizer = G2frame.dataWindow.GetSizer()
    12631265    mainSizer.Add(BackSizer())
     
    12661268    mainSizer.Add((0,5),0)
    12671269    mainSizer.Add(PeaksSizer())
     1270    G2frame.dataWindow.SetDataSize()
    12681271       
    12691272################################################################################
     
    12841287        labels = ['Tmin','Tmax']
    12851288        for i in [0,1]:
    1286             limits.Add(wx.StaticText(G2frame.dataWindow,label=' Original %s: %.4f'%(labels[0],data[0][i])),0,WACV)
     1289            limits.Add(wx.StaticText(G2frame.dataWindow,
     1290                label=' Original {} {:.4f}'.format(labels[i],data[0][i])),0,WACV)
    12871291            limits.Add(wx.StaticText(G2frame.dataWindow,label=' New: '),0,WACV)
    12881292            limits.Add(G2G.ValidatedTxtCtrl(G2frame.dataWindow,data[1],i,  \
     
    13391343           
    13401344    def Draw():
     1345        G2frame.dataWindow.ClearData()
    13411346        mainSizer = G2frame.dataWindow.GetSizer()
    13421347        mainSizer.Add(LimitSizer())
    13431348        if len(data)>2:
    1344 #            mainSizer.Add((0,5),0)
     1349            mainSizer.Add((0,5),0)
    13451350            mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Excluded regions:'),0,WACV)
    13461351            mainSizer.Add(ExclSizer())
    1347        
     1352        G2frame.dataWindow.SetDataSize()
     1353
    13481354    G2frame.ifGetExclude = False
    13491355    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.LimitMenu)
     
    16881694        #G2frame.SetLabel(G2frame.GetLabel().split('||')[0]+' || '+'Instrument Parameters')
    16891695        G2frame.SetTitle('Instrument Parameters')
     1696        G2frame.dataWindow.ClearData()
    16901697        mainSizer = G2frame.dataWindow.GetSizer()
    16911698        instSizer = wx.FlexGridSizer(0,6,5,5)
     
    19131920
    19141921        mainSizer.Add(instSizer,0)
     1922        G2frame.dataWindow.SetDataSize()
    19151923        # end of MakeParameterWindow
    19161924               
     
    24002408    labelLst,elemKeysLst,dspLst,refFlgElem = [],[],[],[]
    24012409    parms = SetupSampleLabels(histName,data.get('Type'),Inst['Type'][0])
     2410    G2frame.dataWindow.ClearData()
    24022411    mainSizer = G2frame.dataWindow.GetSizer()
    24032412    topSizer = wx.BoxSizer(wx.HORIZONTAL)
     
    24992508        conSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Transmission (calc): %10.3f  '%(np.exp(-mut))),0,WACV)
    25002509        mainSizer.Add(conSizer,0)
     2510    G2frame.dataWindow.SetDataSize()
    25012511   
    25022512################################################################################
Note: See TracChangeset for help on using the changeset viewer.