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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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('')
Note: See TracChangeset for help on using the changeset viewer.