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/GSASIIimgGUI.py

    r2915 r2917  
    10301030            data['calibrant'] = calSel.GetValue().strip()
    10311031            if data['calibrant']:
    1032                 G2frame.dataWindow.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBRATE,enable=True)
    1033                 G2frame.dataWindow.ImageEdit.Enable(id=G2gd.wxID_IMCALIBRATE,enable=True)
    1034                 G2frame.dataWindow.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBALL,enable=True)
     1032                G2frame.dataWindow.ImageEdit.Enable(id=G2G.wxID_IMRECALIBRATE,enable=True)
     1033                G2frame.dataWindow.ImageEdit.Enable(id=G2G.wxID_IMCALIBRATE,enable=True)
     1034                G2frame.dataWindow.ImageEdit.Enable(id=G2G.wxID_IMRECALIBALL,enable=True)
    10351035                data['calibskip'] = calFile.Calibrants[data['calibrant']][3]
    10361036                limits = calFile.Calibrants[data['calibrant']][4]
     
    10411041                G2frame.calibDmin.SetValue(limits[0])
    10421042            else:
    1043                 G2frame.dataWindow.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBRATE,enable=False)
    1044                 G2frame.dataWindow.ImageEdit.Enable(id=G2gd.wxID_IMCALIBRATE,enable=False)
    1045                 G2frame.dataWindow.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBALL,enable=False)
     1043                G2frame.dataWindow.ImageEdit.Enable(id=G2G.wxID_IMRECALIBRATE,enable=False)
     1044                G2frame.dataWindow.ImageEdit.Enable(id=G2G.wxID_IMCALIBRATE,enable=False)
     1045                G2frame.dataWindow.ImageEdit.Enable(id=G2G.wxID_IMRECALIBALL,enable=False)
    10461046               
    10471047        def OnCalibSkip(event):
     
    11741174    G2frame.dataWindow.ClearData()
    11751175    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.ImageMenu)
    1176     G2frame.Bind(wx.EVT_MENU, OnCalibrate, id=G2gd.wxID_IMCALIBRATE)
    1177     G2frame.Bind(wx.EVT_MENU, OnRecalibrate, id=G2gd.wxID_IMRECALIBRATE)
    1178     G2frame.Bind(wx.EVT_MENU, OnRecalibAll, id=G2gd.wxID_IMRECALIBALL)
    1179     G2frame.Bind(wx.EVT_MENU, OnClearCalib, id=G2gd.wxID_IMCLEARCALIB)
     1176    G2frame.Bind(wx.EVT_MENU, OnCalibrate, id=G2G.wxID_IMCALIBRATE)
     1177    G2frame.Bind(wx.EVT_MENU, OnRecalibrate, id=G2G.wxID_IMRECALIBRATE)
     1178    G2frame.Bind(wx.EVT_MENU, OnRecalibAll, id=G2G.wxID_IMRECALIBALL)
     1179    G2frame.Bind(wx.EVT_MENU, OnClearCalib, id=G2G.wxID_IMCLEARCALIB)
    11801180    if data.get('calibrant'):
    11811181        mode = True
    11821182    else:
    11831183        mode = False
    1184 #    G2frame.Enable(id=G2gd.wxID_IMRECALIBRATE,enable=mode)
    1185 #    G2frame.Enable(id=G2gd.wxID_IMCALIBRATE,enable=mode)
    1186 #    G2frame.Enable(id=G2gd.wxID_IMRECALIBALL,enable=mode)
    1187     G2frame.Bind(wx.EVT_MENU, OnIntegrate, id=G2gd.wxID_IMINTEGRATE)
    1188     G2frame.Bind(wx.EVT_MENU, OnIntegrateAll, id=G2gd.wxID_INTEGRATEALL)
    1189     G2frame.Bind(wx.EVT_MENU, OnCopyControls, id=G2gd.wxID_IMCOPYCONTROLS)
    1190     G2frame.Bind(wx.EVT_MENU, OnCopySelected, id=G2gd.wxID_IMCOPYSELECTED)
    1191     G2frame.Bind(wx.EVT_MENU, OnSaveControls, id=G2gd.wxID_IMSAVECONTROLS)
    1192     G2frame.Bind(wx.EVT_MENU, OnSaveMultiControls, id=G2gd.wxID_SAVESELECTEDCONTROLS)
    1193     G2frame.Bind(wx.EVT_MENU, OnLoadControls, id=G2gd.wxID_IMLOADCONTROLS)
    1194     G2frame.Bind(wx.EVT_MENU, OnTransferAngles, id=G2gd.wxID_IMXFERCONTROLS)
    1195     G2frame.Bind(wx.EVT_MENU, OnResetDist, id=G2gd.wxID_IMRESETDIST)
     1184#    G2frame.Enable(id=G2G.wxID_IMRECALIBRATE,enable=mode)
     1185#    G2frame.Enable(id=G2G.wxID_IMCALIBRATE,enable=mode)
     1186#    G2frame.Enable(id=G2G.wxID_IMRECALIBALL,enable=mode)
     1187    G2frame.Bind(wx.EVT_MENU, OnIntegrate, id=G2G.wxID_IMINTEGRATE)
     1188    G2frame.Bind(wx.EVT_MENU, OnIntegrateAll, id=G2G.wxID_INTEGRATEALL)
     1189    G2frame.Bind(wx.EVT_MENU, OnCopyControls, id=G2G.wxID_IMCOPYCONTROLS)
     1190    G2frame.Bind(wx.EVT_MENU, OnCopySelected, id=G2G.wxID_IMCOPYSELECTED)
     1191    G2frame.Bind(wx.EVT_MENU, OnSaveControls, id=G2G.wxID_IMSAVECONTROLS)
     1192    G2frame.Bind(wx.EVT_MENU, OnSaveMultiControls, id=G2G.wxID_SAVESELECTEDCONTROLS)
     1193    G2frame.Bind(wx.EVT_MENU, OnLoadControls, id=G2G.wxID_IMLOADCONTROLS)
     1194    G2frame.Bind(wx.EVT_MENU, OnTransferAngles, id=G2G.wxID_IMXFERCONTROLS)
     1195    G2frame.Bind(wx.EVT_MENU, OnResetDist, id=G2G.wxID_IMRESETDIST)
    11961196    def OnDestroy(event):
    11971197        G2frame.autoIntFrame = None
     
    12031203        G2frame.autoIntFrame = AutoIntFrame(G2frame,PollTime=PollTime)
    12041204        G2frame.autoIntFrame.Bind(wx.EVT_WINDOW_DESTROY,OnDestroy) # clean up name on window close
    1205     G2frame.Bind(wx.EVT_MENU, OnAutoInt, id=G2gd.wxID_IMAUTOINTEG)
     1205    G2frame.Bind(wx.EVT_MENU, OnAutoInt, id=G2G.wxID_IMAUTOINTEG)
    12061206
    12071207    mainSizer = G2frame.dataWindow.GetSizer()
     
    13121312       
    13131313    def OnLoadMask(event):
    1314         if event.Id == G2gd.wxID_MASKLOADNOT:
     1314        if event.Id == G2G.wxID_MASKLOADNOT:
    13151315            ignoreThreshold = True
    13161316        else:
     
    15521552        CleanupMasks(data) # posting page for 1st time; clean out anything unfinished
    15531553    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.MaskMenu)
    1554     G2frame.Bind(wx.EVT_MENU, OnCopyMask, id=G2gd.wxID_MASKCOPY)
    1555     G2frame.Bind(wx.EVT_MENU, OnLoadMask, id=G2gd.wxID_MASKLOAD)
    1556     G2frame.Bind(wx.EVT_MENU, OnLoadMask, id=G2gd.wxID_MASKLOADNOT)
    1557     G2frame.Bind(wx.EVT_MENU, OnSaveMask, id=G2gd.wxID_MASKSAVE)
    1558     G2frame.Bind(wx.EVT_MENU, OnAutoSpotMask, id=G2gd.wxID_FINDSPOTS)
    1559     G2frame.Bind(wx.EVT_MENU, OnDeleteSpotMask, id=G2gd.wxID_DELETESPOTS)
    1560     G2frame.Bind(wx.EVT_MENU, ToggleSpotMaskMode, id=G2gd.wxID_NEWMASKSPOT)
    1561     G2frame.Bind(wx.EVT_MENU, OnNewArcMask, id=G2gd.wxID_NEWMASKARC)
    1562     G2frame.Bind(wx.EVT_MENU, OnNewRingMask, id=G2gd.wxID_NEWMASKRING)
    1563     G2frame.Bind(wx.EVT_MENU, OnNewPolyMask, id=G2gd.wxID_NEWMASKPOLY)
    1564     G2frame.Bind(wx.EVT_MENU, OnNewFrameMask, id=G2gd.wxID_NEWMASKFRAME)
     1554    G2frame.Bind(wx.EVT_MENU, OnCopyMask, id=G2G.wxID_MASKCOPY)
     1555    G2frame.Bind(wx.EVT_MENU, OnLoadMask, id=G2G.wxID_MASKLOAD)
     1556    G2frame.Bind(wx.EVT_MENU, OnLoadMask, id=G2G.wxID_MASKLOADNOT)
     1557    G2frame.Bind(wx.EVT_MENU, OnSaveMask, id=G2G.wxID_MASKSAVE)
     1558    G2frame.Bind(wx.EVT_MENU, OnAutoSpotMask, id=G2G.wxID_FINDSPOTS)
     1559    G2frame.Bind(wx.EVT_MENU, OnDeleteSpotMask, id=G2G.wxID_DELETESPOTS)
     1560    G2frame.Bind(wx.EVT_MENU, ToggleSpotMaskMode, id=G2G.wxID_NEWMASKSPOT)
     1561    G2frame.Bind(wx.EVT_MENU, OnNewArcMask, id=G2G.wxID_NEWMASKARC)
     1562    G2frame.Bind(wx.EVT_MENU, OnNewRingMask, id=G2G.wxID_NEWMASKRING)
     1563    G2frame.Bind(wx.EVT_MENU, OnNewPolyMask, id=G2G.wxID_NEWMASKPOLY)
     1564    G2frame.Bind(wx.EVT_MENU, OnNewFrameMask, id=G2G.wxID_NEWMASKFRAME)
    15651565    if G2frame.MaskKey == 'f':
    15661566        G2frame.GetStatusBar().SetStatusText('Frame mask active - LB pick next point, RB close polygon',1)
     
    21322132        G2gd.GetGPXtreeItemId(G2frame,G2frame.Image, 'Image Controls'))       
    21332133    G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.StrStaMenu)
    2134     G2frame.Bind(wx.EVT_MENU, OnAppendDzero, id=G2gd.wxID_APPENDDZERO)
    2135     G2frame.Bind(wx.EVT_MENU, OnUpdateDzero, id=G2gd.wxID_UPDATEDZERO)
    2136     G2frame.Bind(wx.EVT_MENU, OnFitStrSta, id=G2gd.wxID_STRSTAFIT)
    2137     G2frame.Bind(wx.EVT_MENU, OnPlotStrSta, id=G2gd.wxID_STRSTAPLOT) 
    2138     G2frame.Bind(wx.EVT_MENU, OnSaveStrRing, id=G2gd.wxID_STRRINGSAVE) 
    2139     G2frame.Bind(wx.EVT_MENU, OnFitAllStrSta, id=G2gd.wxID_STRSTAALLFIT)
    2140     G2frame.Bind(wx.EVT_MENU, OnCopyStrSta, id=G2gd.wxID_STRSTACOPY)
    2141     G2frame.Bind(wx.EVT_MENU, OnLoadStrSta, id=G2gd.wxID_STRSTALOAD)
    2142     G2frame.Bind(wx.EVT_MENU, OnSaveStrSta, id=G2gd.wxID_STRSTASAVE)
    2143     G2frame.Bind(wx.EVT_MENU, OnStrStaSample, id=G2gd.wxID_STRSTSAMPLE)       
     2134    G2frame.Bind(wx.EVT_MENU, OnAppendDzero, id=G2G.wxID_APPENDDZERO)
     2135    G2frame.Bind(wx.EVT_MENU, OnUpdateDzero, id=G2G.wxID_UPDATEDZERO)
     2136    G2frame.Bind(wx.EVT_MENU, OnFitStrSta, id=G2G.wxID_STRSTAFIT)
     2137    G2frame.Bind(wx.EVT_MENU, OnPlotStrSta, id=G2G.wxID_STRSTAPLOT) 
     2138    G2frame.Bind(wx.EVT_MENU, OnSaveStrRing, id=G2G.wxID_STRRINGSAVE) 
     2139    G2frame.Bind(wx.EVT_MENU, OnFitAllStrSta, id=G2G.wxID_STRSTAALLFIT)
     2140    G2frame.Bind(wx.EVT_MENU, OnCopyStrSta, id=G2G.wxID_STRSTACOPY)
     2141    G2frame.Bind(wx.EVT_MENU, OnLoadStrSta, id=G2G.wxID_STRSTALOAD)
     2142    G2frame.Bind(wx.EVT_MENU, OnSaveStrSta, id=G2G.wxID_STRSTASAVE)
     2143    G2frame.Bind(wx.EVT_MENU, OnStrStaSample, id=G2G.wxID_STRSTSAMPLE)       
    21442144    if G2frame.StrainKey == 'a':    #probably doesn't happen
    21452145        G2frame.GetStatusBar().SetStatusText('Add strain ring active - LB pick d-zero value',1)
Note: See TracChangeset for help on using the changeset viewer.