Ignore:
Timestamp:
Aug 11, 2017 5:34:54 PM (4 years ago)
Author:
toby
Message:

make the two frame version the trunk as we hit version 3000

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/GSASIIconstrGUI.py

    r2753 r3000  
    3131import GSASIImath as G2mth
    3232import GSASIIlattice as G2lat
    33 import GSASIIgrid as G2gd
    34 import GSASIIctrls as G2G
     33import GSASIIdataGUI as G2gd
     34import GSASIIctrlGUI as G2G
    3535import GSASIIplot as G2plt
    3636import GSASIIobj as G2obj
     
    224224            print str(key) + ': '+str(j)+' variable(s) as strings converted to objects'
    225225    ##################################################################################
    226     rigidbodyDict = G2frame.PatternTree.GetItemPyData(
    227         G2gd.GetPatternTreeItemId(G2frame,G2frame.root,'Rigid bodies'))
     226    rigidbodyDict = G2frame.GPXtree.GetItemPyData(
     227        G2gd.GetGPXtreeItemId(G2frame,G2frame.root,'Rigid bodies'))
    228228    rbIds = rigidbodyDict.get('RBIds',{'Vector':[],'Residue':[]})
    229229    rbVary,rbDict = G2stIO.GetRigidBodyModels(rigidbodyDict,Print=False)
     
    458458            atchoice = [fmt.format(*i1) for i1 in choices]
    459459            dlg = G2G.G2MultiChoiceDialog(
    460                 G2frame.dataFrame,legend,
     460                G2frame,legend,
    461461                'Constrain '+str(FrstVarb)+' with...',atchoice,
    462462                toggle=False,size=(625,400),monoFont=True)
     
    468468            if len(Selections) == 0:
    469469                dlg = wx.MessageDialog(
    470                     G2frame.dataFrame,
     470                    G2frame,
    471471                    'No variables were selected to include with '+str(FrstVarb),
    472472                    'No variables')
     
    477477        else:
    478478            dlg = wx.MessageDialog(
    479                 G2frame.dataFrame,
     479                G2frame,
    480480                'There are no appropriate variables to include with '+str(FrstVarb),
    481481                'No variables')
     
    554554        else:
    555555            dlg = wx.MessageDialog(
    556                 G2frame.dataFrame,
     556                G2frame,
    557557                'There are no selected variables to include with '+str(FrstVarb),
    558558                'No variables')
     
    584584            res = G2frame.ErrorDialog('Constraint Error',
    585585                'Error with newly added constraint:\n'+errmsg+
    586                 '\n\nDiscard newly added constraint?',parent=G2frame.dataFrame,
     586                '\n\nDiscard newly added constraint?',parent=G2frame,
    587587                wtype=wx.YES_NO)
    588588            return res != wx.ID_YES
     
    611611            res = G2frame.ErrorDialog('Constraint Error',
    612612                'Error after editing constraint:\n'+errmsg+
    613                 '\n\nDiscard last constraint edit?',parent=G2frame.dataFrame,
     613                '\n\nDiscard last constraint edit?',parent=G2frame,
    614614                wtype=wx.YES_NO)
    615615            return res != wx.ID_YES
     
    651651        if not varList:
    652652            G2frame.ErrorDialog('No variables','There are no variables of type '+vartype,
    653                 parent=G2frame.dataFrame)
     653                parent=G2frame)
    654654            return
    655655        l2 = l1 = 1
     
    662662        #varListlbl = ["("+i+") "+G2obj.fmtVarDescr(i) for i in varList]
    663663        legend = "Select variables to hold (Will not be varied, even if vary flag is set)"
    664         dlg = G2G.G2MultiChoiceDialog(
    665             G2frame.dataFrame,
     664        dlg = G2G.G2MultiChoiceDialog(G2frame,
    666665            legend,title1,varListlbl,toggle=False,size=(625,400),monoFont=True)
    667666        dlg.CenterOnParent()
     
    684683        if not varList:
    685684            G2frame.ErrorDialog('No variables','There are no variables of type '+vartype,
    686                 parent=G2frame.dataFrame)
     685                parent=G2frame)
    687686            return
    688687#        legend = "Select variables to make equivalent (only one of the variables will be varied when all are set to be varied)"
     
    697696        if not varList:
    698697            G2frame.ErrorDialog('No variables','There are no variables of type '+vartype,
    699                 parent=G2frame.dataFrame)
     698                parent=G2frame)
    700699            return
    701700#        legend = "Select atoms to make equivalent (only one of the atom variables will be varied when all are set to be varied)"
     
    710709        if not varList:
    711710            G2frame.ErrorDialog('No variables','There are no variables of type '+vartype,
    712                 parent=G2frame.dataFrame)
     711                parent=G2frame)
    713712            return
    714713#        legend = "Select atoms to ride (only one of the atom variables will be varied when all are set to be varied)"
     
    723722        if not varList:
    724723            G2frame.ErrorDialog('No variables','There are no variables of type '+vartype,
    725                 parent=G2frame.dataFrame)
     724                parent=G2frame)
    726725            return
    727726#        legend = "Select variables to include in a new variable (the new variable will be varied when all included variables are varied)"
     
    736735        if not varList:
    737736            G2frame.ErrorDialog('No variables','There are no variables of type '+vartype,
    738                 parent=G2frame.dataFrame)
     737                parent=G2frame)
    739738            return
    740739#        legend = "Select variables to include in a constraint equation (the values will be constrainted to equal a specified constant)"
     
    753752        fmt = "{:"+str(l1)+"s} {:"+str(l2)+"s} {:s}"
    754753        varListlbl = [fmt.format(i,*G2obj.VarDescr(i)) for i in varList]       
    755         dlg = G2G.G2SingleChoiceDialog(G2frame.dataFrame,'Select 1st variable:',
     754        dlg = G2G.G2SingleChoiceDialog(G2frame,'Select 1st variable:',
    756755            title1,varListlbl,monoFont=True,size=(625,400))
    757756        dlg.CenterOnParent()
     
    802801        AtNames = Atoms.keys()
    803802        AtNames.sort()
    804         dlg = G2G.G2SingleChoiceDialog(G2frame.dataFrame,'Select 1st atom:',
     803        dlg = G2G.G2SingleChoiceDialog(G2frame,'Select 1st atom:',
    805804            title1,AtNames,monoFont=True,size=(625,400))
    806805        dlg.CenterOnParent()
     
    820819            return
    821820        dlg = G2G.G2MultiChoiceDialog(
    822             G2frame.dataFrame,title2+FrstAtom,
     821            G2frame,title2+FrstAtom,
    823822            'Constrain '+str(FrstAtom)+' with...',AtNames,
    824823            toggle=False,size=(625,400),monoFont=True)
     
    10131012                varname = ""
    10141013            lbl = 'Enter value for each term in constraint; sum = new variable'
    1015             dlg = ConstraintDialog(G2frame.dataFrame,constType,lbl,items,
     1014            dlg = ConstraintDialog(G2frame,constType,lbl,items,
    10161015                                   varname=varname,varyflag=data[name][Id][-2])
    10171016        elif data[name][Id][-1] == 'c':
     
    10201019            constType = 'Constraint'
    10211020            lbl = 'Edit value for each term in constant constraint sum'
    1022             dlg = ConstraintDialog(G2frame.dataFrame,constType,lbl,items)
     1021            dlg = ConstraintDialog(G2frame,constType,lbl,items)
    10231022        elif data[name][Id][-1] == 'e':
    10241023            items = data[name][Id][:-3]
    10251024            constType = 'Equivalence'
    10261025            lbl = 'The following terms are set to be equal:'
    1027             dlg = ConstraintDialog(G2frame.dataFrame,constType,lbl,items,'/')
     1026            dlg = ConstraintDialog(G2frame,constType,lbl,items,'/')
    10281027        else:
    10291028            return
     
    10621061        notebook tab. Called in :func:`OnPageChanged`
    10631062        '''
    1064         if panel.GetSizer(): panel.GetSizer().Clear(True) # N.B. don't use panel.DestroyChildren()
    1065         # because it deletes scrollbars on Mac
     1063        if panel.GetSizer(): panel.GetSizer().Clear(True)
    10661064        Siz = wx.BoxSizer(wx.VERTICAL)
    10671065        Siz.Add((5,5),0)
    1068         Siz.Add(MakeConstraintsSizer(typ,panel))
     1066        Siz.Add(MakeConstraintsSizer(typ,panel),1,wx.EXPAND)
    10691067        panel.SetSizer(Siz,True)
    10701068        Size = Siz.GetMinSize()
     
    10731071        panel.SetSize(Size)
    10741072        panel.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1)
    1075         Size[1] = min(500,Size[1])
    1076         G2frame.dataFrame.setSizePosLeft(Size)
     1073        panel.Show()
    10771074
    10781075    def OnPageChanged(event):
     
    10831080            page = event.GetSelection()
    10841081        else: # called directly, get current page
    1085             page = G2frame.dataDisplay.GetSelection()
    1086         G2frame.dataDisplay.ChangeSelection(page)
    1087         text = G2frame.dataDisplay.GetPageText(page)
    1088         G2frame.dataFrame.ConstraintEdit.Enable(G2gd.wxID_EQUIVALANCEATOMS,False)
    1089 #        G2frame.dataFrame.ConstraintEdit.Enable(G2gd.wxID_ADDRIDING,False)
     1082            page = G2frame.constr.GetSelection()
     1083        #G2frame.constr.SetSize(G2frame.dataWindow.GetClientSize())    #TODO -almost right
     1084        G2frame.constr.ChangeSelection(page)
     1085        text = G2frame.constr.GetPageText(page)
     1086        G2frame.dataWindow.ConstraintEdit.Enable(G2G.wxID_EQUIVALANCEATOMS,False)
     1087#        G2frame.dataWindow.ConstraintEdit.Enable(G2G.wxID_ADDRIDING,False)
    10901088        if text == 'Histogram/Phase':
    10911089            G2frame.Page = [page,'hap']
     
    10961094        elif text == 'Phase':
    10971095            G2frame.Page = [page,'phs']
    1098             G2frame.dataFrame.ConstraintEdit.Enable(G2gd.wxID_EQUIVALANCEATOMS,True)
    1099 #            G2frame.dataFrame.ConstraintEdit.Enable(G2gd.wxID_ADDRIDING,True)
     1096            G2frame.dataWindow.ConstraintEdit.Enable(G2G.wxID_EQUIVALANCEATOMS,True)
     1097#            G2frame.dataWindow.ConstraintEdit.Enable(G2G.wxID_ADDRIDING,True)
    11001098            if 'DELETED' in str(PhaseConstr):   #seems to be no other way to do this (wx bug)
    11011099                if GSASIIpath.GetConfigValue('debug'):
     
    11101108        'Respond to a "select tab" menu button'
    11111109        try:
    1112             i = (G2gd.wxID_CONSPHASE,
    1113                  G2gd.wxID_CONSHAP,
    1114                  G2gd.wxID_CONSHIST,
    1115                  G2gd.wxID_CONSGLOBAL).index(event.GetId())
    1116             G2frame.dataDisplay.SetSelection(i)
     1110            i = (G2G.wxID_CONSPHASE,
     1111                 G2G.wxID_CONSHAP,
     1112                 G2G.wxID_CONSHIST,
     1113                 G2G.wxID_CONSGLOBAL).index(event.GetId())
     1114            G2frame.constr.SetSelection(i)
    11171115            wx.CallAfter(OnPageChanged,None)
    11181116        except ValueError:
     
    11201118
    11211119    def SetStatusLine(text):
    1122         Status.SetStatusText(text)                                     
    1123        
    1124     if G2frame.dataDisplay:
    1125         G2frame.dataDisplay.Destroy()
    1126     G2gd.SetDataMenuBar(G2frame,G2frame.dataFrame.ConstraintMenu)
    1127     G2frame.dataFrame.SetLabel('Constraints')
    1128     if not G2frame.dataFrame.GetStatusBar():
    1129         Status = G2frame.dataFrame.CreateStatusBar()
     1120        G2frame.GetStatusBar().SetStatusText(text,1)                                     
     1121       
     1122    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.ConstraintMenu)
     1123    #G2frame.SetLabel(G2frame.GetLabel().split('||')[0]+' || '+'Constraints')
     1124    G2frame.SetTitle('Constraints')
    11301125    SetStatusLine('')
    11311126   
    1132     G2gd.SetDataMenuBar(G2frame,G2frame.dataFrame.ConstraintMenu)
    1133     G2frame.dataFrame.Bind(wx.EVT_MENU, OnAddConstraint, id=G2gd.wxID_CONSTRAINTADD)
    1134     G2frame.dataFrame.Bind(wx.EVT_MENU, OnAddFunction, id=G2gd.wxID_FUNCTADD)
    1135     G2frame.dataFrame.Bind(wx.EVT_MENU, OnAddEquivalence, id=G2gd.wxID_EQUIVADD)
    1136     G2frame.dataFrame.Bind(wx.EVT_MENU, OnAddHold, id=G2gd.wxID_HOLDADD)
    1137     G2frame.dataFrame.Bind(wx.EVT_MENU, OnAddAtomEquiv, id=G2gd.wxID_EQUIVALANCEATOMS)
    1138 #    G2frame.dataFrame.Bind(wx.EVT_MENU, OnAddRiding, id=G2gd.wxID_ADDRIDING)
     1127    G2frame.Bind(wx.EVT_MENU, OnAddConstraint, id=G2G.wxID_CONSTRAINTADD)
     1128    G2frame.Bind(wx.EVT_MENU, OnAddFunction, id=G2G.wxID_FUNCTADD)
     1129    G2frame.Bind(wx.EVT_MENU, OnAddEquivalence, id=G2G.wxID_EQUIVADD)
     1130    G2frame.Bind(wx.EVT_MENU, OnAddHold, id=G2G.wxID_HOLDADD)
     1131    G2frame.Bind(wx.EVT_MENU, OnAddAtomEquiv, id=G2G.wxID_EQUIVALANCEATOMS)
     1132#    G2frame.Bind(wx.EVT_MENU, OnAddRiding, id=G2G.wxID_ADDRIDING)
    11391133    # tab commands
    1140     for id in (G2gd.wxID_CONSPHASE,
    1141                G2gd.wxID_CONSHAP,
    1142                G2gd.wxID_CONSHIST,
    1143                G2gd.wxID_CONSGLOBAL):
    1144         G2frame.dataFrame.Bind(wx.EVT_MENU, RaisePage,id=id)
    1145 
    1146     G2frame.dataDisplay = G2G.GSNoteBook(parent=G2frame.dataFrame)
     1134    for id in (G2G.wxID_CONSPHASE,
     1135               G2G.wxID_CONSHAP,
     1136               G2G.wxID_CONSHIST,
     1137               G2G.wxID_CONSGLOBAL):
     1138        G2frame.Bind(wx.EVT_MENU, RaisePage,id=id)
     1139
     1140    #G2frame.constr = G2G.GSNoteBook(parent=G2frame.dataWindow,size=G2frame.dataWindow.GetClientSize())
     1141    G2frame.constr = G2G.GSNoteBook(parent=G2frame.dataWindow)
     1142    G2frame.dataWindow.GetSizer().Add(G2frame.constr,1,wx.ALL|wx.EXPAND)
    11471143    # note that order of pages is hard-coded in RaisePage
    1148     PhaseConstr = wx.ScrolledWindow(G2frame.dataDisplay)
    1149     G2frame.dataDisplay.AddPage(PhaseConstr,'Phase')
    1150     HAPConstr = wx.ScrolledWindow(G2frame.dataDisplay)
    1151     G2frame.dataDisplay.AddPage(HAPConstr,'Histogram/Phase')
    1152     HistConstr = wx.ScrolledWindow(G2frame.dataDisplay)
    1153     G2frame.dataDisplay.AddPage(HistConstr,'Histogram')
    1154     GlobalConstr = wx.ScrolledWindow(G2frame.dataDisplay)
    1155     G2frame.dataDisplay.AddPage(GlobalConstr,'Global')
     1144    PhaseConstr = wx.ScrolledWindow(G2frame.constr)
     1145    G2frame.constr.AddPage(PhaseConstr,'Phase')
     1146    HAPConstr = wx.ScrolledWindow(G2frame.constr)
     1147    G2frame.constr.AddPage(HAPConstr,'Histogram/Phase')
     1148    HistConstr = wx.ScrolledWindow(G2frame.constr)
     1149    G2frame.constr.AddPage(HistConstr,'Histogram')
     1150    GlobalConstr = wx.ScrolledWindow(G2frame.constr)
     1151    G2frame.constr.AddPage(GlobalConstr,'Global')
    11561152    wx.CallAfter(OnPageChanged,None)
    1157     G2frame.dataDisplay.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, OnPageChanged)
     1153    G2frame.constr.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, OnPageChanged)
    11581154    # validate all the constrants -- should not see any errors here normally
    11591155    allcons = []
     
    11671163    if errmsg:
    11681164        G2frame.ErrorDialog('Constraint Error','Error in constraints:\n'+errmsg,
    1169             parent=G2frame.dataFrame)
     1165            parent=G2frame)
    11701166    elif warnmsg:
    11711167        print 'Unexpected contraint warning:\n',warnmsg
     
    12121208    oAcof = G2lat.cell2A(oldPhase['General']['Cell'][1:7])
    12131209    nAcof = G2lat.cell2A(newPhase['General']['Cell'][1:7])
    1214     item = G2gd.GetPatternTreeItemId(G2frame,G2frame.root,'Constraints')
    1215     constraints = G2frame.PatternTree.GetItemPyData(item)
     1210    item = G2gd.GetGPXtreeItemId(G2frame,G2frame.root,'Constraints')
     1211    constraints = G2frame.GPXtree.GetItemPyData(item)
    12161212#    GSASIIpath.IPyBreak()
    12171213    parmDict = {}
     
    13141310    resList = []
    13151311    plotDefaults = {'oldxy':[0.,0.],'Quaternion':[0.,0.,0.,1.],'cameraPos':30.,'viewDir':[0,0,1],}
     1312
     1313    G2frame.rbBook = G2G.GSNoteBook(parent=G2frame.dataWindow)
     1314    G2frame.dataWindow.GetSizer().Add(G2frame.rbBook,1,wx.ALL|wx.EXPAND)
     1315    VectorRB = wx.ScrolledWindow(G2frame.rbBook)
     1316    VectorRBDisplay = wx.Panel(VectorRB)
     1317    G2frame.rbBook.AddPage(VectorRB,'Vector rigid bodies')
     1318    ResidueRB = wx.ScrolledWindow(G2frame.rbBook)
     1319    ResidueRBDisplay = wx.Panel(ResidueRB)
     1320    G2frame.rbBook.AddPage(ResidueRB,'Residue rigid bodies')
    13161321   
    13171322    def OnPageChanged(event):
     
    13211326            page = event.GetSelection()
    13221327        else:
    1323             page = G2frame.dataDisplay.GetSelection()
    1324         G2frame.dataDisplay.ChangeSelection(page)
    1325         text = G2frame.dataDisplay.GetPageText(page)
     1328            page = G2frame.rbBook.GetSelection()
     1329        #G2frame.rbBook.SetSize(G2frame.dataWindow.GetClientSize())    #TODO -almost right
     1330        G2frame.rbBook.ChangeSelection(page)
     1331        text = G2frame.rbBook.GetPageText(page)
    13261332        if text == 'Vector rigid bodies':
    1327             G2gd.SetDataMenuBar(G2frame,G2frame.dataFrame.VectorBodyMenu)
    1328             G2frame.dataFrame.Bind(wx.EVT_MENU, AddVectorRB, id=G2gd.wxID_VECTORBODYADD)
     1333            G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.VectorBodyMenu)
     1334            G2frame.Bind(wx.EVT_MENU, AddVectorRB, id=G2G.wxID_VECTORBODYADD)
    13291335            G2frame.Page = [page,'vrb']
    13301336            UpdateVectorRB()
    13311337        elif text == 'Residue rigid bodies':
    1332             G2gd.SetDataMenuBar(G2frame,G2frame.dataFrame.RigidBodyMenu)
    1333             G2frame.dataFrame.Bind(wx.EVT_MENU, AddResidueRB, id=G2gd.wxID_RIGIDBODYADD)
    1334             G2frame.dataFrame.Bind(wx.EVT_MENU, OnImportRigidBody, id=G2gd.wxID_RIGIDBODYIMPORT)
    1335             G2frame.dataFrame.Bind(wx.EVT_MENU, OnDefineTorsSeq, id=G2gd.wxID_RESIDUETORSSEQ) #enable only if residue RBs exist?
     1338            G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RigidBodyMenu)
     1339            G2frame.Bind(wx.EVT_MENU, AddResidueRB, id=G2G.wxID_RIGIDBODYADD)
     1340            G2frame.Bind(wx.EVT_MENU, OnImportRigidBody, id=G2G.wxID_RIGIDBODYIMPORT)
     1341            G2frame.Bind(wx.EVT_MENU, OnDefineTorsSeq, id=G2G.wxID_RESIDUETORSSEQ) #enable only if residue RBs exist?
    13361342            G2frame.Page = [page,'rrb']
    13371343            UpdateResidueRB()
     
    13771383       
    13781384    def OnImportRigidBody(event):
    1379         page = G2frame.dataDisplay.GetSelection()
    1380         if 'Vector' in G2frame.dataDisplay.GetPageText(page):
     1385        page = G2frame.rbBook.GetSelection()
     1386        if 'Vector' in G2frame.rbBook.GetPageText(page):
    13811387            pass
    1382         elif 'Residue' in G2frame.dataDisplay.GetPageText(page):
     1388        elif 'Residue' in G2frame.rbBook.GetPageText(page):
    13831389            ImportResidueRB()
    13841390           
    13851391    def AddVectorRB(event):
    13861392        AtInfo = data['Vector']['AtInfo']
    1387         dlg = MultiIntegerDialog(G2frame.dataDisplay,'New Rigid Body',['No. atoms','No. translations'],[1,1])
     1393        dlg = MultiIntegerDialog(G2frame,'New Rigid Body',['No. atoms','No. translations'],[1,1])
    13881394        if dlg.ShowModal() == wx.ID_OK:
    13891395            nAtoms,nTrans = dlg.GetValues()
     
    15541560            print 'There are no rigid bodies defined'
    15551561            G2frame.ErrorDialog('No rigid bodies','There are no rigid bodies defined',
    1556                                 parent=G2frame.dataFrame)
     1562                                parent=G2frame)
    15571563            return
    15581564        elif len(rbNames) > 1:
     
    15951601        AtInfo = data['Vector']['AtInfo']
    15961602        refChoice = {}
    1597         if 'DELETED' in str(Status):   #seems to be no other way to do this (wx bug)
     1603        if 'DELETED' in str(G2frame.GetStatusBar()):   #seems to be no other way to do this (wx bug)
    15981604            if GSASIIpath.GetConfigValue('debug'):
    15991605                print 'wx error: Rigid Body/Status not cleanly deleted after Refine'
     
    17621768                for col in [4,5,6]:
    17631769                    vecGrid.SetCellStyle(row,col,VERY_LIGHT_GREY,True)
    1764             vecGrid.SetMargins(0,0)
     1770#            vecGrid.SetScrollRate(0,0)
    17651771            vecGrid.AutoSizeColumns(False)
    17661772            vecSizer.Add(vecGrid)
     
    17781784                refChoice[rbId][i].sort()     
    17791785           
    1780         #VectorRB.DestroyChildren() # bad, deletes scrollbars on Mac!
    1781         if VectorRB.GetSizer():
    1782             VectorRB.GetSizer().Clear(True)
    1783         VectorRBDisplay = wx.Panel(VectorRB)
     1786        if VectorRB.GetSizer(): VectorRB.GetSizer().Clear(True)
    17841787        VectorRBSizer = wx.BoxSizer(wx.VERTICAL)
    17851788        for rbId in data['RBIds']['Vector']:
     
    18041807        VectorRB.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1)
    18051808        VectorRB.Scroll(0,Scroll)
    1806         Size[1] = min(Size[1],500)
    1807         G2frame.dataFrame.setSizePosLeft(Size)
    18081809       
    18091810    def UpdateResidueRB():
     
    19291930                for col in range(5):
    19301931                    vecGrid.SetCellStyle(row,col,VERY_LIGHT_GREY,True)
    1931             vecGrid.SetMargins(0,0)
     1932#            vecGrid.SetScrollRate(0,0)
    19321933            vecGrid.AutoSizeColumns(False)
    19331934            vecSizer = wx.BoxSizer()
     
    20582059                refChoice[rbId][i].sort()     
    20592060           
    2060         #ResidueRB.DestroyChildren() # bad, deletes scrollbars on Mac!
    2061         if ResidueRB.GetSizer():
    2062 #            ResidueRB.DestroyChildren()
    2063             ResidueRB.GetSizer().Clear(True)
    2064            
    2065         ResidueRBDisplay = wx.Panel(ResidueRB)
     2061        ResidueRBDisplay.DestroyChildren()
    20662062        ResidueRBSizer = wx.BoxSizer(wx.VERTICAL)
    20672063        for rbId in data['RBIds']['Residue']:
     
    20812077            if rbData['rbSeq']:
    20822078                ResidueRBSizer.Add(slideSizer,)
    2083             ResidueRBSizer.Add(wx.StaticText(ResidueRBDisplay,-1,100*'-'))
     2079            ResidueRBSizer.Add(wx.StaticText(ResidueRBDisplay,-1,70*'-'))
    20842080
    20852081        ResidueRBSizer.Add((5,25),)
     
    20912087        ResidueRBDisplay.SetSize(Size)
    20922088        ResidueRB.SetScrollbars(10,10,Size[0]/10-4,Size[1]/10-1)
    2093         Size[1] = min(500,Size[1])
    2094         G2frame.dataFrame.setSizePosLeft(Size)
    20952089       
    20962090    def SetStatusLine(text):
    2097         Status.SetStatusText(text)                                     
    2098 
    2099     if G2frame.dataDisplay:
    2100         G2frame.dataDisplay.Destroy()
    2101     G2gd.SetDataMenuBar(G2frame,G2frame.dataFrame.RigidBodyMenu)
    2102     G2frame.dataFrame.SetLabel('Rigid bodies')
    2103     if not G2frame.dataFrame.GetStatusBar():
    2104         Status = G2frame.dataFrame.CreateStatusBar()
     2091        G2frame.GetStatusBar().SetStatusText(text,1)                                     
     2092
     2093    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RigidBodyMenu)
     2094    G2frame.SetTitle('Rigid bodies')
    21052095    SetStatusLine('')
    2106 
    2107     G2frame.dataDisplay = G2G.GSNoteBook(parent=G2frame.dataFrame,size=G2frame.dataFrame.GetClientSize())
    2108 
    2109     VectorRB = wx.ScrolledWindow(G2frame.dataDisplay)
    2110     G2frame.dataDisplay.AddPage(VectorRB,'Vector rigid bodies')
    2111     ResidueRB = wx.ScrolledWindow(G2frame.dataDisplay)
    2112     G2frame.dataDisplay.AddPage(ResidueRB,'Residue rigid bodies')
    21132096    UpdateVectorRB()
    2114     G2frame.dataDisplay.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, OnPageChanged)
     2097    G2frame.rbBook.Bind(wx.aui.EVT_AUINOTEBOOK_PAGE_CHANGED, OnPageChanged)
    21152098    wx.CallAfter(OnPageChanged,None)
Note: See TracChangeset for help on using the changeset viewer.