Changeset 4805 for trunk


Ignore:
Timestamp:
Feb 8, 2021 2:37:16 PM (8 months ago)
Author:
toby
Message:

start replacing dataWindow.GetSizer? with .SetSizer? since Sizer could be horizontal or vertical

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/G2compare.py

    r4801 r4805  
    888888    Frame = main(application) # start the GUI
    889889    loadall = False
     890    loadbak = False
    890891    argLoadlist = sys.argv[1:]
    891892    for arg in argLoadlist:
     893        if '-d' in arg:
     894            loadall = True
     895            break
     896        elif '-b' in arg:
     897            loadbak = True
     898            continue
     899        elif '.bak' in os.path.splitext(arg)[0] and not loadbak:
     900            continue
    892901        fil = os.path.splitext(arg)[0] + '.gpx'
    893902        if os.path.exists(fil):
     903            if [fil,'GPX'] in Frame.fileList:
     904                print('Skipping over {}: previously read'.format(fil))
     905                continue
    894906            Frame.fileList.append([fil,'GPX'])
    895907            Frame.loadFile(fil)
    896         elif '-d' in arg:
    897             loadall = True
     908            continue
    898909        else:
    899910            print('File {} not found. Skipping'.format(fil))
  • trunk/GSASIIconstrGUI.py

    r4782 r4805  
    17591759    '''Called when Rigid bodies tree item is selected.
    17601760    Displays the rigid bodies in the data window
    1761     '''
    1762     if not data.get('RBIds') or not data:
    1763         data.update({'Vector':{'AtInfo':{}},'Residue':{'AtInfo':{}},
    1764             'RBIds':{'Vector':[],'Residue':[]}})       #empty/bad dict - fill it
    1765            
    1766     global resList,resRBsel
    1767     Indx = {}
    1768     resList = []
    1769     plotDefaults = {'oldxy':[0.,0.],'Quaternion':[0.,0.,0.,1.],'cameraPos':30.,'viewDir':[0,0,1],}
    1770 
    1771     G2frame.rbBook = G2G.GSNoteBook(parent=G2frame.dataWindow)
    1772     G2frame.dataWindow.GetSizer().Add(G2frame.rbBook,1,wx.ALL|wx.EXPAND)
    1773     VectorRB = wx.ScrolledWindow(G2frame.rbBook)
    1774     VectorRBDisplay = wx.Panel(VectorRB)
    1775     G2frame.rbBook.AddPage(VectorRB,'Vector rigid bodies')
    1776     ResidueRB = wx.ScrolledWindow(G2frame.rbBook)
    1777     ResidueRBDisplay = wx.Panel(ResidueRB)
    1778     G2frame.rbBook.AddPage(ResidueRB,'Residue rigid bodies')
    1779    
     1761    ''' 
    17801762    def OnPageChanged(event):
    17811763        global resList
     
    36453627        G2frame.GetStatusBar().SetStatusText(text,1)                                     
    36463628
     3629    #================== UpdateRigidBodies starts here =========
     3630    global resList,resRBsel           
     3631    if not data.get('RBIds') or not data:
     3632        data.update({'Vector':{'AtInfo':{}},'Residue':{'AtInfo':{}},
     3633            'RBIds':{'Vector':[],'Residue':[]}})       #empty/bad dict - fill it
     3634    Indx = {}
     3635    resList = []
     3636    plotDefaults = {'oldxy':[0.,0.],'Quaternion':[0.,0.,0.,1.],'cameraPos':30.,'viewDir':[0,0,1],}
     3637    G2frame.rbBook = G2G.GSNoteBook(parent=G2frame.dataWindow)
     3638    G2frame.dataWindow.GetSizer().Add(G2frame.rbBook,1,wx.ALL|wx.EXPAND)
     3639    VectorRB = wx.ScrolledWindow(G2frame.rbBook)
     3640    VectorRBDisplay = wx.Panel(VectorRB)
     3641    G2frame.rbBook.AddPage(VectorRB,'Vector rigid bodies')
     3642    ResidueRB = wx.ScrolledWindow(G2frame.rbBook)
     3643    ResidueRBDisplay = wx.Panel(ResidueRB)
     3644    G2frame.rbBook.AddPage(ResidueRB,'Residue rigid bodies')
     3645    # vector RBs are not too common, so select Residue as the default when one is present
     3646    if len(data['RBIds']['Residue']) > 0 and len(data['RBIds']['Vector']) == 0:
     3647        G2frame.rbBook.ChangeSelection(1)
     3648        OnPageChanged(None)
    36473649    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RigidBodyMenu)
    36483650    SetStatusLine('')
  • trunk/GSASIIpwdGUI.py

    r4803 r4805  
    11271127    data['peaks'] = X
    11281128    G2frame.dataWindow.ClearData()
    1129     mainSizer = G2frame.dataWindow.GetSizer()
     1129    mainSizer = wx.BoxSizer(wx.VERTICAL)
    11301130    G2frame.GPXtree.SetItemPyData(G2frame.PickId,data)
    11311131    G2frame.PeakTable = G2G.Table(data['peaks'],rowLabels=rowLabels,colLabels=colLabels,types=Types)
     
    11471147    mainSizer.Add(reflGrid)
    11481148    mainSizer.Add(G2G.HelpButton(G2frame.dataWindow,helpIndex=G2frame.dataWindow.helpKey))
     1149    G2frame.dataWindow.SetSizer(mainSizer)
    11491150    G2frame.dataWindow.SetDataSize()
    11501151
     
    17891790    def Draw():
    17901791        G2frame.dataWindow.ClearData()
    1791         mainSizer = G2frame.dataWindow.GetSizer()
     1792        mainSizer = wx.BoxSizer(wx.VERTICAL)
    17921793        topSizer = wx.BoxSizer(wx.HORIZONTAL)
    17931794        topSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Data used in refinement'),0,WACV)
     
    18021803            mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Excluded regions:'),0,WACV)
    18031804            mainSizer.Add(ExclSizer())
     1805        G2frame.dataWindow.SetSizer(mainSizer)
    18041806        G2frame.dataWindow.SetDataSize()
    18051807
     
    21972199        'Displays the Instrument parameters in the dataWindow frame'
    21982200        G2frame.dataWindow.ClearData()
    2199         mainSizer = G2frame.dataWindow.GetSizer()
     2201        mainSizer = wx.BoxSizer(wx.VERTICAL)
    22002202        instSizer = wx.FlexGridSizer(0,3,5,5)
    22012203        subSizer = wx.BoxSizer(wx.HORIZONTAL)
     
    24312433        mainSizer.Add(instSizer,0)
    24322434        G2frame.dataWindow.SetDataSize()
     2435        G2frame.dataWindow.SetSizer(mainSizer)
    24332436        # end of MakeParameterWindow
    24342437               
     
    29402943    parms = SetupSampleLabels(histName,data.get('Type'),Inst['Type'][0])
    29412944    G2frame.dataWindow.ClearData()
    2942     mainSizer = G2frame.dataWindow.GetSizer()
     2945    mainSizer = wx.BoxSizer(wx.VERTICAL)
    29432946    topSizer = wx.BoxSizer(wx.HORIZONTAL)
    29442947    topSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Sample and Experimental Parameters'))
     
    30443047        conSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Transmission (calc): %10.3f  '%(np.exp(-mut))),0,WACV)
    30453048        mainSizer.Add(conSizer,0)
     3049    G2frame.dataWindow.SetSizer(mainSizer)
    30463050    G2frame.dataWindow.SetDataSize()
    30473051   
     
    32093213        G2plt.PlotCalib(G2frame,Inst,XY,Sigs,newPlot=True)
    32103214    G2frame.dataWindow.ClearData()
    3211     mainSizer = G2frame.dataWindow.GetSizer()
     3215    mainSizer = wx.BoxSizer(wx.VERTICAL)
    32123216    mainSizer.Add(G2frame.indxPeaks,0,wx.ALL|wx.EXPAND,1)
     3217    G2frame.dataWindow.SetSizer(mainSizer)
    32133218    G2frame.dataWindow.SetDataSize()
    32143219
     
    44124417        G2frame.dataWindow.LoadCell.Enable(True)
    44134418    G2frame.dataWindow.ClearData()
    4414     mainSizer = G2frame.dataWindow.GetSizer()
     4419    mainSizer = wx.BoxSizer(wx.VERTICAL)
    44154420    topSizer = wx.BoxSizer(wx.HORIZONTAL)
    44164421    topSizer.Add(wx.StaticText(parent=G2frame.dataWindow,label=' Indexing controls: '),0,WACV)
     
    47234728        mainSizer.Add(magDisplay,0,WACV)
    47244729       
     4730    G2frame.dataWindow.SetSizer(mainSizer)
    47254731    G2frame.dataWindow.SetDataSize()
    47264732   
     
    50085014    G2frame.dataWindow.ClearData()
    50095015    G2frame.refBook = G2G.GSNoteBook(parent=G2frame.dataWindow)
    5010     G2frame.dataWindow.GetSizer().Add(G2frame.refBook,1,wx.ALL|wx.EXPAND,1)
     5016    mainSizer = wx.BoxSizer(wx.HORIZONTAL)
     5017    mainSizer.Add(G2frame.refBook,1,wx.ALL|wx.EXPAND,1)
    50115018    G2frame.refTable = {}
    50125019    G2frame.dataWindow.currentGrids = []
     
    50285035                G2frame.RefList = ''
    50295036                phaseName = ''
    5030     G2frame.dataWindow.GetSizer().Add(G2G.HelpButton(G2frame.dataWindow,helpIndex=G2frame.dataWindow.helpKey))
     5037    mainSizer.Add(G2G.HelpButton(G2frame.dataWindow,helpIndex=G2frame.dataWindow.helpKey))
    50315038    if phaseName: ShowReflTable(phaseName)
    50325039    G2frame.refBook.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, OnPageChanged)
     5040    G2frame.dataWindow.SetSizer(mainSizer)
    50335041    G2frame.dataWindow.SetDataSize()
    50345042   
     
    62426250    Indx = {}
    62436251    G2frame.dataWindow.ClearData()
    6244     mainSizer = G2frame.dataWindow.GetSizer()
     6252    mainSizer = wx.BoxSizer(wx.VERTICAL)
    62456253    topSizer = wx.BoxSizer(wx.HORIZONTAL)
    62466254    models = ['Size dist.','Particle fit','Pair distance',]
     
    62966304    backSizer.Add(backFile)   
    62976305    mainSizer.Add(backSizer)
     6306    G2frame.dataWindow.SetSizer(mainSizer)
    62986307    G2frame.dataWindow.SetDataSize()
    62996308
     
    68256834    G2frame.Bind(wx.EVT_MENU, OnUnDo, id=G2G.wxID_MODELUNDO)
    68266835    G2frame.dataWindow.ClearData()
    6827     mainSizer = G2frame.dataWindow.GetSizer()
     6836    mainSizer = wx.BoxSizer(wx.VERTICAL)
    68286837    mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Reflectometry fitting for: '+Name),0,WACV)
    68296838    mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Controls:'),0,WACV)
     
    68526861    mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' Layers: scatt. densities are 10%scm%s = 10%s%s%s'%(Pwr10,Pwrm2,Pwrm6,Angstr,Pwrm2)),0,WACV)
    68536862    mainSizer.Add(LayerSizer())
     6863    G2frame.dataWindow.SetSizer(mainSizer)
    68546864    G2frame.dataWindow.SetDataSize()
    68556865   
     
    75677577
    75687578    G2frame.dataWindow.ClearData()
    7569     mainSizer = G2frame.dataWindow.GetSizer()
     7579    mainSizer = wx.BoxSizer(wx.VERTICAL)
    75707580    if powId:
    75717581        ElList = data['ElList']
     
    75807590        mainSizer.Add(wx.StaticText(G2frame.dataWindow,wx.ID_ANY,
    75817591                                     powName+' not in Tree'))
     7592    G2frame.dataWindow.SetSizer(mainSizer)
    75827593    G2frame.dataWindow.SetDataSize()
    75837594
     
    77647775    G2frame.Bind(wx.EVT_MENU, OnClearPDFpeaks, id=G2G.wxID_CLEARPDFPEAKS)
    77657776    G2frame.dataWindow.ClearData()
    7766     mainSizer = G2frame.dataWindow.GetSizer()
     7777    mainSizer = wx.BoxSizer(wx.VERTICAL)
    77677778    mainSizer.Add((5,5),0)
    77687779    mainSizer.Add(wx.StaticText(G2frame.dataWindow,label=' PDF peak fit controls:'),0,WACV)
     
    77747785        mainSizer.Add((5,5),0)
    77757786        mainSizer.Add(peakSizer())
     7787    G2frame.dataWindow.SetSizer(mainSizer)
    77767788    G2frame.dataWindow.SetDataSize()
    77777789   
Note: See TracChangeset for help on using the changeset viewer.