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

massive changes of wxID_ ids & misc to fix undefined vars wanings

File:
1 edited

Legend:

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

    r2914 r2917  
    868868                Bonds.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect)
    869869                Bonds.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange)
    870                 G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE)
    871                 G2frame.Bind(wx.EVT_MENU, OnChangeValue, id=G2gd.wxID_RESRCHANGEVAL)
    872                 G2frame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2gd.wxID_RESTCHANGEESD)
     870                G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2G.wxID_RESTDELETE)
     871                G2frame.Bind(wx.EVT_MENU, OnChangeValue, id=G2G.wxID_RESRCHANGEVAL)
     872                G2frame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2G.wxID_RESTCHANGEESD)
    873873                mainSizer.Add(wx.StaticText(BondRestr,-1,
    874874                    'Bond restraints: sum(wt*(delt/sig)^2) =    %.2f, mean(wt*(delt/sig)^2) =    %.2f'    \
     
    10031003                Angles.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect)
    10041004                Angles.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange)
    1005                 G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE)
    1006                 G2frame.Bind(wx.EVT_MENU, OnChangeValue, id=G2gd.wxID_RESRCHANGEVAL)
    1007                 G2frame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2gd.wxID_RESTCHANGEESD)
     1005                G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2G.wxID_RESTDELETE)
     1006                G2frame.Bind(wx.EVT_MENU, OnChangeValue, id=G2G.wxID_RESRCHANGEVAL)
     1007                G2frame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2G.wxID_RESTCHANGEESD)
    10081008                mainSizer.Add(wx.StaticText(AngleRestr,-1,
    10091009                    'Angle restraints: sum(wt*(delt/sig)^2) =    %.2f, mean(wt*(delt/sig)^2) =    %.2f'    \
     
    11301130                Planes.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect)
    11311131                Planes.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange)
    1132                 G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE)
    1133                 G2frame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2gd.wxID_RESTCHANGEESD)
     1132                G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2G.wxID_RESTDELETE)
     1133                G2frame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2G.wxID_RESTCHANGEESD)
    11341134                mainSizer.Add(wx.StaticText(PlaneRestr,-1,
    11351135                    'Plane restraints: sum(wt*(delt/sig)^2) =    %.2f, mean(wt*(delt/sig)^2) =    %.2f'    \
     
    12581258                Volumes.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect)
    12591259                Volumes.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange)
    1260                 G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE)
    1261                 G2frame.Bind(wx.EVT_MENU, OnChangeValue, id=G2gd.wxID_RESRCHANGEVAL)
    1262                 G2frame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2gd.wxID_RESTCHANGEESD)
     1260                G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2G.wxID_RESTDELETE)
     1261                G2frame.Bind(wx.EVT_MENU, OnChangeValue, id=G2G.wxID_RESRCHANGEVAL)
     1262                G2frame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2G.wxID_RESTCHANGEESD)
    12631263                mainSizer.Add(wx.StaticText(ChiralRestr,-1,
    12641264                    'Chiral volume restraints: sum(wt*(delt/sig)^2) =    %.2f, mean(wt*(delt/sig)^2) =    %.2f'    \
     
    13591359                TorsionRestr.Torsions.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect)
    13601360                TorsionRestr.Torsions.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange)
    1361                 G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE)
    1362                 G2frame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2gd.wxID_RESTCHANGEESD)
     1361                G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2G.wxID_RESTDELETE)
     1362                G2frame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2G.wxID_RESTCHANGEESD)
    13631363                mainSizer.Add(wx.StaticText(TorsionRestr,-1,
    13641364                    'Torsion restraints: sum(wt*(delt/sig)^2) =    %.2f, mean(wt*(delt/sig)^2) =    %.2f'    \
     
    14791479                RamaRestr.Ramas.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect)
    14801480                RamaRestr.Ramas.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange)
    1481                 G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE)
    1482                 G2frame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2gd.wxID_RESTCHANGEESD)
     1481                G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2G.wxID_RESTDELETE)
     1482                G2frame.Bind(wx.EVT_MENU, OnChangeEsd, id=G2G.wxID_RESTCHANGEESD)
    14831483                mainSizer.Add(wx.StaticText(RamaRestr,-1,
    14841484                    'Ramachandran restraints: sum(wt*(delt/sig)^2) =    %.2f, mean(wt*(delt/sig)^2) =    %.2f'    \
     
    16301630                ChemComps.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect)
    16311631                ChemComps.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange)
    1632                 G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE)
    1633                 G2frame.Bind(wx.EVT_MENU, OnChangeValue, id=G2gd.wxID_RESRCHANGEVAL)
     1632                G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2G.wxID_RESTDELETE)
     1633                G2frame.Bind(wx.EVT_MENU, OnChangeValue, id=G2G.wxID_RESRCHANGEVAL)
    16341634                mainSizer.Add(wx.StaticText(ChemCompRestr,-1,
    16351635                    'Chemical composition restraints: sum(wt*(delt/sig)^2) =    %.2f, mean(wt*(delt/sig)^2) =    %.2f'    \
     
    17101710            Textures.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK,OnRowSelect)
    17111711            Textures.Bind(wg.EVT_GRID_CELL_CHANGE, OnCellChange)
    1712             G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2gd.wxID_RESTDELETE)
     1712            G2frame.Bind(wx.EVT_MENU, OnDeleteRestraint, id=G2G.wxID_RESTDELETE)
    17131713            mainSizer.Add(Textures,0,)
    17141714        else:
     
    17251725        #G2frame.restrBook.SetSize(G2frame.dataWindow.GetClientSize())    #TODO -almost right
    17261726        text = G2frame.restrBook.GetPageText(page)
    1727         G2frame.dataWindow.RestraintEdit.SetLabel(G2gd.wxID_RESRCHANGEVAL,'Change value')
     1727        G2frame.dataWindow.RestraintEdit.SetLabel(G2G.wxID_RESRCHANGEVAL,'Change value')
    17281728        if text == 'Bond':
    17291729            G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RestraintMenu)
    1730             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESTRAINTADD,True)
    1731             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESRCHANGEVAL,True)
     1730            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESTRAINTADD,True)
     1731            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESRCHANGEVAL,True)
    17321732            bondRestData = restrData['Bond']
    17331733            UpdateBondRestr(bondRestData)
    17341734        elif text == 'Angle':
    17351735            G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RestraintMenu)
    1736             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESTRAINTADD,True)
    1737             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESRCHANGEVAL,True)
     1736            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESTRAINTADD,True)
     1737            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESRCHANGEVAL,True)
    17381738            angleRestData = restrData['Angle']
    17391739            UpdateAngleRestr(angleRestData)
    17401740        elif text == 'Plane':
    17411741            G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RestraintMenu)
    1742             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESTRAINTADD,True)
    1743             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESRCHANGEVAL,False)
     1742            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESTRAINTADD,True)
     1743            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESRCHANGEVAL,False)
    17441744            planeRestData = restrData['Plane']
    17451745            UpdatePlaneRestr(planeRestData)
    17461746        elif text == 'Chiral':
    17471747            G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RestraintMenu)
    1748             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESTRAINTADD,False)
    1749             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESRCHANGEVAL,True)
     1748            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESTRAINTADD,False)
     1749            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESRCHANGEVAL,True)
    17501750            chiralRestData = restrData['Chiral']
    17511751            UpdateChiralRestr(chiralRestData)
    17521752        elif text == 'Torsion':
    17531753            G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RestraintMenu)
    1754             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESTRAINTADD,False)
    1755             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESRCHANGEVAL,False)
    1756             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_AARESTRAINTPLOT,True)
     1754            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESTRAINTADD,False)
     1755            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESRCHANGEVAL,False)
     1756            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_AARESTRAINTPLOT,True)
    17571757            torsionRestData = restrData['Torsion']
    17581758            UpdateTorsionRestr(torsionRestData)
    17591759        elif text == 'Ramachandran':
    17601760            G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RestraintMenu)
    1761             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESTRAINTADD,False)
    1762             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESRCHANGEVAL,False)
    1763             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_AARESTRAINTPLOT,True)
     1761            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESTRAINTADD,False)
     1762            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESRCHANGEVAL,False)
     1763            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_AARESTRAINTPLOT,True)
    17641764            ramaRestData = restrData['Rama']
    17651765            UpdateRamaRestr(ramaRestData)
     
    17671767        elif text == 'Chem. comp.':
    17681768            G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RestraintMenu)
    1769             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESTRAINTADD,True)
    1770             G2frame.dataWindow.RestraintEdit.SetLabel(G2gd.wxID_RESRCHANGEVAL,'Change factor')
    1771             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESRCHANGEVAL,True)
    1772             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESTCHANGEESD,False)
     1769            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESTRAINTADD,True)
     1770            G2frame.dataWindow.RestraintEdit.SetLabel(G2G.wxID_RESRCHANGEVAL,'Change factor')
     1771            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESRCHANGEVAL,True)
     1772            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESTCHANGEESD,False)
    17731773            chemcompRestData = restrData['ChemComp']
    17741774            UpdateChemcompRestr(chemcompRestData)
    17751775        elif text == 'Texture':
    17761776            G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RestraintMenu)
    1777             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESTRAINTADD,True)
    1778             G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESRCHANGEVAL,True)
     1777            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESTRAINTADD,True)
     1778            G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESRCHANGEVAL,True)
    17791779            textureRestData = restrData['Texture']
    17801780            UpdateTextureRestr(textureRestData)
     
    18611861    ramaName = 'All'
    18621862    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RestraintMenu)   
    1863     G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESTSELPHASE,False)
     1863    G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESTSELPHASE,False)
    18641864    if len(Phases) > 1:
    1865         G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_RESTSELPHASE,True)
    1866         G2frame.Bind(wx.EVT_MENU, OnSelectPhase, id=G2gd.wxID_RESTSELPHASE)
    1867     G2frame.Bind(wx.EVT_MENU, OnAddRestraint, id=G2gd.wxID_RESTRAINTADD)
     1865        G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_RESTSELPHASE,True)
     1866        G2frame.Bind(wx.EVT_MENU, OnSelectPhase, id=G2G.wxID_RESTSELPHASE)
     1867    G2frame.Bind(wx.EVT_MENU, OnAddRestraint, id=G2G.wxID_RESTRAINTADD)
    18681868    if 'macro' in phasedata['General']['Type']:
    1869         G2frame.dataWindow.RestraintEdit.Enable(G2gd.wxID_AARESTRAINTADD,True)
    1870         G2frame.Bind(wx.EVT_MENU, OnAddAARestraint, id=G2gd.wxID_AARESTRAINTADD)
    1871         G2frame.Bind(wx.EVT_MENU, OnPlotAARestraint, id=G2gd.wxID_AARESTRAINTPLOT)
     1869        G2frame.dataWindow.RestraintEdit.Enable(G2G.wxID_AARESTRAINTADD,True)
     1870        G2frame.Bind(wx.EVT_MENU, OnAddAARestraint, id=G2G.wxID_AARESTRAINTADD)
     1871        G2frame.Bind(wx.EVT_MENU, OnPlotAARestraint, id=G2G.wxID_AARESTRAINTPLOT)
    18721872   
    18731873    # GUI defined here
Note: See TracChangeset for help on using the changeset viewer.