Changeset 2911
- Timestamp:
- Jul 5, 2017 6:57:25 PM (6 years ago)
- Location:
- branch/2frame
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
branch/2frame/GSASIIconstrGUI.py
r2909 r2911 1131 1131 G2frame.Bind(wx.EVT_MENU, OnAddHold, id=G2gd.wxID_HOLDADD) 1132 1132 G2frame.Bind(wx.EVT_MENU, OnAddAtomEquiv, id=G2gd.wxID_EQUIVALANCEATOMS) 1133 # G2frame. dataWindow.Bind(wx.EVT_MENU, OnAddRiding, id=G2gd.wxID_ADDRIDING)1133 # G2frame.Bind(wx.EVT_MENU, OnAddRiding, id=G2gd.wxID_ADDRIDING) 1134 1134 # tab commands 1135 1135 for id in (G2gd.wxID_CONSPHASE, … … 1137 1137 G2gd.wxID_CONSHIST, 1138 1138 G2gd.wxID_CONSGLOBAL): 1139 G2frame. dataWindow.Bind(wx.EVT_MENU, RaisePage,id=id)1139 G2frame.Bind(wx.EVT_MENU, RaisePage,id=id) 1140 1140 1141 1141 #G2frame.constr = G2G.GSNoteBook(parent=G2frame.dataWindow,size=G2frame.dataWindow.GetClientSize()) … … 1324 1324 if text == 'Vector rigid bodies': 1325 1325 G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.VectorBodyMenu) 1326 G2frame. dataWindow.Bind(wx.EVT_MENU, AddVectorRB, id=G2gd.wxID_VECTORBODYADD)1326 G2frame.Bind(wx.EVT_MENU, AddVectorRB, id=G2gd.wxID_VECTORBODYADD) 1327 1327 G2frame.Page = [page,'vrb'] 1328 1328 UpdateVectorRB() 1329 1329 elif text == 'Residue rigid bodies': 1330 1330 G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.RigidBodyMenu) 1331 G2frame. dataWindow.Bind(wx.EVT_MENU, AddResidueRB, id=G2gd.wxID_RIGIDBODYADD)1332 G2frame. dataWindow.Bind(wx.EVT_MENU, OnImportRigidBody, id=G2gd.wxID_RIGIDBODYIMPORT)1333 G2frame. dataWindow.Bind(wx.EVT_MENU, OnDefineTorsSeq, id=G2gd.wxID_RESIDUETORSSEQ) #enable only if residue RBs exist?1331 G2frame.Bind(wx.EVT_MENU, AddResidueRB, id=G2gd.wxID_RIGIDBODYADD) 1332 G2frame.Bind(wx.EVT_MENU, OnImportRigidBody, id=G2gd.wxID_RIGIDBODYIMPORT) 1333 G2frame.Bind(wx.EVT_MENU, OnDefineTorsSeq, id=G2gd.wxID_RESIDUETORSSEQ) #enable only if residue RBs exist? 1334 1334 G2frame.Page = [page,'rrb'] 1335 1335 UpdateResidueRB() -
branch/2frame/GSASIIctrlGUI.py
r2909 r2911 3511 3511 self.HelpById 3512 3512 3513 Note that self may be child of the main window (G2frame) or of the dataWindow3513 Note that self should now (2frame) be child of the main window (G2frame) 3514 3514 ''' 3515 #TODO: !3516 if hasattr(self.frame,'dataFrame'): # find the dataFrame3515 if hasattr(self.frame,'dataWindow'): # Debug code: check this is called from menu in G2frame 3516 # should always be true in 2 Frame version 3517 3517 dW = self.frame.dataWindow 3518 3518 else: 3519 3519 print('help error: not called from standard menu?') 3520 3520 print self 3521 return 3522 3521 return 3523 3522 try: 3524 helpKey = dW.helpKey # BHT:look up help from helpKey in data window3525 #if GSASIIpath.GetConfigValue('debug'): print 'data Framehelp: key=',helpKey3523 helpKey = dW.helpKey # look up help from helpKey in data window 3524 #if GSASIIpath.GetConfigValue('debug'): print 'dataWindow help: key=',helpKey 3526 3525 except AttributeError: 3527 3526 helpKey = '' 3528 if GSASIIpath.GetConfigValue('debug'): 3529 print('No helpKey for current dataFrame!') 3527 if GSASIIpath.GetConfigValue('debug'): print('No helpKey for current dataWindow!') 3530 3528 helpType = self.HelpById.get(event.GetId(),helpKey) # see if there is a special help topic 3531 if GSASIIpath.GetConfigValue('debug'): 3532 print 'helpKey=',helpKey,' helpType=',helpType 3529 #if GSASIIpath.GetConfigValue('debug'): print 'helpKey=',helpKey,' helpType=',helpType 3533 3530 if helpType == 'Tutorials': 3534 3531 dlg = OpenTutorial(self.frame) -
branch/2frame/GSASIIdataGUI.py
r2910 r2911 65 65 # Define short names for convenience 66 66 WACV = wx.ALIGN_CENTER_VERTICAL 67 VERY_LIGHT_GREY = wx.Colour(235,235,235) 67 VERY_LIGHT_GREY = wx.Colour(240,240,240) 68 DULL_YELLOW = (230,230,190) 68 69 69 70 # define Ids for wx menu items … … 438 439 439 440 #application.main.OnRefine(None) 440 application.SetAppDisplayName('GSAS-II') 441 try: 442 application.SetAppDisplayName('GSAS-II') 443 except: 444 pass 441 445 #application.GetTopWindow().dataWindow.SendSizeEvent() 442 446 #application.GetTopWindow().treePanel.SendSizeEvent() … … 2942 2946 self.treeTitle = wx.StaticText(self.treePanel, wx.ID_ANY, "GSAS-II data tree", 2943 2947 ) 2944 self.treeTitle.SetBackgroundColour( wx.Colour(230,230,150)) # add some yellow to the title2948 self.treeTitle.SetBackgroundColour(DULL_YELLOW) # add some yellow to the title 2945 2949 treeSizer.Add(self.treeTitle,0,wx.EXPAND|wx.ALL,0) 2946 2950 treeSizer.Add(self.GPXtree,1,wx.EXPAND|wx.ALL,0) … … 2971 2975 2972 2976 self.dataWindow.SetupScrolling() 2973 self.dataFrame = self.dataWindow #kluge!!2974 2977 2975 2978 plotFrame = wx.Frame(None,-1,'GSASII Plots',size=wx.Size(700,600), \ … … 4739 4742 where the functions to be called are defined. 4740 4743 ''' 4744 def Bind(self,eventtype,handler,*args,**kwargs): # PATCH: debug code: catch when a menu is bind'ed to 4745 # the dataWindow this should not be done in the 2 frame version. Remove this routine eventually. 4746 if eventtype == wx.wx.EVT_MENU: 4747 print 'wx.EVT_MENU Bind to dataWindow' 4748 G2obj.HowDidIgetHere(True) 4749 wx.Frame.Bind(self.GetTopLevelParent(),eventtype,handler,*args,**kwargs) 4750 else: 4751 wxscroll.ScrolledPanel.Bind(self,eventtype,handler,*args,**kwargs) 4741 4752 # def Bind(self,eventtype,handler,*args,**kwargs): 4742 4753 # '''Override the Bind() function: on the Mac the binding is to … … 4775 4786 4776 4787 def PostfillDataMenu(self,empty=False): 4777 '''Add the help menu to the data frame menus. Note that on Linux and 4778 Windows, this is the standard help Menu but without the update commands but adds an extra help 4779 command for the data item. 4780 On Mac, this is the entire help menu including the update commands, a separator and the 4781 extra help command for the data item. 4788 '''Add the help menu to the menus associated with data tree items. 4782 4789 ''' 4783 4790 menu = self.datamenu 4784 if sys.platform == "darwin": # mac 4785 if not empty: 4786 menu.Append(wx.Menu(title=''),title='|') # add another separator 4787 HelpMenu=G2G.MyHelp(self,includeTree=True, 4788 morehelpitems=[('&Tutorials','Tutorials'),]) 4789 menu.Append(menu=HelpMenu,title='&Help') 4790 else: # other 4791 menu.Append(menu=G2G.MyHelp(self),title='&Help') 4792 4791 G2frame = self.GetTopLevelParent() 4792 if not empty: 4793 menu.Append(wx.Menu(title=''),title='|') # add another separator 4794 HelpMenu=G2G.MyHelp(G2frame,includeTree=True, 4795 morehelpitems=[('&Tutorials','Tutorials'),]) 4796 menu.Append(menu=HelpMenu,title='&Help') 4793 4797 4794 4798 def _initMenus_(self): … … 5739 5743 ''' 5740 5744 #self.SetBackgroundColour(wx.WHITE) # BHT: I prefer a gray background. Makes TextCtrls stand out 5741 self.SetBackgroundColour( wx.Colour(248,248,248)) # BHT: I prefer a gray background. Makes TextCtrls stand out, but5745 self.SetBackgroundColour(VERY_LIGHT_GREY) # BHT: I prefer a gray background. Makes TextCtrls stand out, but 5742 5746 # a bit lighter than the splitter bar 5743 5747 … … 6973 6977 G2frame.SetTitle('Sequential refinement results') 6974 6978 G2frame.GetStatusBar().SetStatusText('') 6975 G2frame. dataWindow.Bind(wx.EVT_MENU, OnRenameSelSeq, id=wxID_RENAMESEQSEL)6976 G2frame. dataWindow.Bind(wx.EVT_MENU, OnSaveSelSeq, id=wxID_SAVESEQSEL)6977 G2frame. dataWindow.Bind(wx.EVT_MENU, OnSaveSelSeqCSV, id=wxID_SAVESEQSELCSV)6978 G2frame. dataWindow.Bind(wx.EVT_MENU, OnSaveSeqCSV, id=wxID_SAVESEQCSV)6979 G2frame. dataWindow.Bind(wx.EVT_MENU, OnPlotSelSeq, id=wxID_PLOTSEQSEL)6980 G2frame. dataWindow.Bind(wx.EVT_MENU, OnAveSelSeq, id=wxID_AVESEQSEL)6981 #G2frame. dataWindow.Bind(wx.EVT_MENU, OnReOrgSelSeq, id=wxID_ORGSEQSEL)6982 G2frame. dataWindow.Bind(wx.EVT_MENU, onSelectSeqVars, id=wxID_ORGSEQINC)6983 G2frame. dataWindow.Bind(wx.EVT_MENU, AddNewPseudoVar, id=wxADDSEQVAR)6984 G2frame. dataWindow.Bind(wx.EVT_MENU, AddNewDistPseudoVar, id=wxADDSEQDIST)6985 G2frame. dataWindow.Bind(wx.EVT_MENU, AddNewAnglePseudoVar, id=wxADDSEQANGLE)6986 G2frame. dataWindow.Bind(wx.EVT_MENU, DelPseudoVar, id=wxDELSEQVAR)6987 G2frame. dataWindow.Bind(wx.EVT_MENU, EditPseudoVar, id=wxEDITSEQVAR)6988 G2frame. dataWindow.Bind(wx.EVT_MENU, AddNewParFitEq, id=wxADDPARFIT)6989 G2frame. dataWindow.Bind(wx.EVT_MENU, CopyParFitEq, id=wxCOPYPARFIT)6990 G2frame. dataWindow.Bind(wx.EVT_MENU, DelParFitEq, id=wxDELPARFIT)6991 G2frame. dataWindow.Bind(wx.EVT_MENU, EditParFitEq, id=wxEDITPARFIT)6992 G2frame. dataWindow.Bind(wx.EVT_MENU, DoParEqFit, id=wxDOPARFIT)6979 G2frame.Bind(wx.EVT_MENU, OnRenameSelSeq, id=wxID_RENAMESEQSEL) 6980 G2frame.Bind(wx.EVT_MENU, OnSaveSelSeq, id=wxID_SAVESEQSEL) 6981 G2frame.Bind(wx.EVT_MENU, OnSaveSelSeqCSV, id=wxID_SAVESEQSELCSV) 6982 G2frame.Bind(wx.EVT_MENU, OnSaveSeqCSV, id=wxID_SAVESEQCSV) 6983 G2frame.Bind(wx.EVT_MENU, OnPlotSelSeq, id=wxID_PLOTSEQSEL) 6984 G2frame.Bind(wx.EVT_MENU, OnAveSelSeq, id=wxID_AVESEQSEL) 6985 #G2frame.Bind(wx.EVT_MENU, OnReOrgSelSeq, id=wxID_ORGSEQSEL) 6986 G2frame.Bind(wx.EVT_MENU, onSelectSeqVars, id=wxID_ORGSEQINC) 6987 G2frame.Bind(wx.EVT_MENU, AddNewPseudoVar, id=wxADDSEQVAR) 6988 G2frame.Bind(wx.EVT_MENU, AddNewDistPseudoVar, id=wxADDSEQDIST) 6989 G2frame.Bind(wx.EVT_MENU, AddNewAnglePseudoVar, id=wxADDSEQANGLE) 6990 G2frame.Bind(wx.EVT_MENU, DelPseudoVar, id=wxDELSEQVAR) 6991 G2frame.Bind(wx.EVT_MENU, EditPseudoVar, id=wxEDITSEQVAR) 6992 G2frame.Bind(wx.EVT_MENU, AddNewParFitEq, id=wxADDPARFIT) 6993 G2frame.Bind(wx.EVT_MENU, CopyParFitEq, id=wxCOPYPARFIT) 6994 G2frame.Bind(wx.EVT_MENU, DelParFitEq, id=wxDELPARFIT) 6995 G2frame.Bind(wx.EVT_MENU, EditParFitEq, id=wxEDITPARFIT) 6996 G2frame.Bind(wx.EVT_MENU, DoParEqFit, id=wxDOPARFIT) 6993 6997 6994 6998 for id in G2frame.dataWindow.SeqExportLookup: 6995 G2frame. dataWindow.Bind(wx.EVT_MENU, DoSequentialExport, id=id)6999 G2frame.Bind(wx.EVT_MENU, DoSequentialExport, id=id) 6996 7000 6997 7001 EnablePseudoVarMenus() -
branch/2frame/GSASIIddataGUI.py
r2908 r2911 770 770 771 771 def OnSelect(event): 772 G2frame.hist = G2frame.data Frame.HistsInPhase[select.GetSelection()]772 G2frame.hist = G2frame.dataWindow.HistsInPhase[select.GetSelection()] 773 773 oldFocus = wx.Window.FindFocus() 774 774 G2plt.PlotSizeStrainPO(G2frame,data,G2frame.hist) … … 782 782 mainSizer.Add(G2frame.bottomSizer) 783 783 mainSizer.Layout() 784 G2frame.data Frame.Refresh()784 G2frame.dataWindow.Refresh() 785 785 DData.SetVirtualSize(mainSizer.GetMinSize()) 786 786 DData.Scroll(0,Scroll) 787 G2frame.data Frame.SendSizeEvent()787 G2frame.dataWindow.SendSizeEvent() 788 788 789 789 def ShowHistogramInfo(): … … 965 965 UseList = data['Histograms'] 966 966 if UseList: 967 G2frame.data Frame.DataMenu.Enable(G2gd.wxID_DATADELETE,True)967 G2frame.dataWindow.DataMenu.Enable(G2gd.wxID_DATADELETE,True) 968 968 for item in G2frame.Refine: item.Enable(True) 969 969 else: 970 G2frame.data Frame.DataMenu.Enable(G2gd.wxID_DATADELETE,False)970 G2frame.dataWindow.DataMenu.Enable(G2gd.wxID_DATADELETE,False) 971 971 for item in G2frame.Refine: item.Enable(False) 972 972 # make a list of histograms (any type) used in this phase, ordered as in tree 973 G2frame.data Frame.HistsInPhase = [name for name in keyList if name in UseList]973 G2frame.dataWindow.HistsInPhase = [name for name in keyList if name in UseList] 974 974 generalData = data['General'] 975 975 PhaseName = generalData['Name'] 976 976 SGData = generalData['SGData'] 977 if len(G2frame.data Frame.HistsInPhase) == 0: # no associated histograms, nothing to display here977 if len(G2frame.dataWindow.HistsInPhase) == 0: # no associated histograms, nothing to display here 978 978 G2frame.hist = '' 979 elif hist and hist in G2frame.data Frame.HistsInPhase: # something was input as a selection as an argument979 elif hist and hist in G2frame.dataWindow.HistsInPhase: # something was input as a selection as an argument 980 980 G2frame.hist = hist 981 elif (not G2frame.hist) or (G2frame.hist not in G2frame.data Frame.HistsInPhase): # no or bad selection but have data, take the first982 G2frame.hist = G2frame.data Frame.HistsInPhase[0]981 elif (not G2frame.hist) or (G2frame.hist not in G2frame.dataWindow.HistsInPhase): # no or bad selection but have data, take the first 982 G2frame.hist = G2frame.dataWindow.HistsInPhase[0] 983 983 Indx = {} 984 984 … … 989 989 if G2frame.hist: 990 990 topSizer = wx.FlexGridSizer(1,2,5,5) 991 select = wx.ListBox(DData,choices=G2frame.data Frame.HistsInPhase,991 select = wx.ListBox(DData,choices=G2frame.dataWindow.HistsInPhase, 992 992 style=wx.LB_SINGLE,size=(-1,120)) 993 select.SetSelection(G2frame.data Frame.HistsInPhase.index(G2frame.hist))994 select.SetFirstItem(G2frame.data Frame.HistsInPhase.index(G2frame.hist))993 select.SetSelection(G2frame.dataWindow.HistsInPhase.index(G2frame.hist)) 994 select.SetFirstItem(G2frame.dataWindow.HistsInPhase.index(G2frame.hist)) 995 995 select.Bind(wx.EVT_LISTBOX,OnSelect) 996 996 topSizer.Add(select,0,WACV|wx.LEFT,5) … … 1003 1003 mainSizer.Add(wx.StaticText(DData,wx.ID_ANY,' (This project has no data; use Import to read it)'), 1004 1004 0,WACV|wx.TOP,10) 1005 elif not UseList in G2frame.data Frame.HistsInPhase:1005 elif not UseList in G2frame.dataWindow.HistsInPhase: 1006 1006 mainSizer.Add(wx.StaticText(DData,wx.ID_ANY,' (This phase has no associated data; use appropriate Edit/Add... menu item)'), 1007 1007 0,WACV|wx.TOP,10) -
branch/2frame/GSASIIimgGUI.py
r2905 r2911 105 105 G2plt.PlotExposedImage(G2frame,newPlot=True,event=tc.event) 106 106 107 G2frame.dataWindow.ClearData()107 #G2frame.dataWindow.ClearData() 108 108 G2frame.ImageZ = GetImageZ(G2frame,data) 109 mainSizer = wx.BoxSizer(wx.VERTICAL)109 mainSizer = G2frame.dataWindow.GetSizer() 110 110 mainSizer.Add(wx.StaticText(G2frame.dataWindow, 111 111 label='Do not change anything here unless you are absolutely sure!'),0,WACV) … … 131 131 min=0.,max=1.,typeHint=float),0,WACV) 132 132 mainSizer.Add(distSizer,0) 133 mainSizer.Layout()134 G2frame.dataWindow.SetSizer(mainSizer)135 mainSizer.Fit(G2frame.dataFrame)136 G2frame.SetDataSize()137 133 138 134 ################################################################################ … … 166 162 167 163 # Menu items 168 164 169 165 def OnCalibrate(event): 170 G2frame. dataFrame.GetStatusBar().SetStatusText('Select > 4 points on 1st used ring; LB to pick (shift key to force pick), RB on point to delete else RB to finish')166 G2frame.GetStatusBar().SetStatusText('Select > 4 points on 1st used ring; LB to pick (shift key to force pick), RB on point to delete else RB to finish') 171 167 G2frame.ifGetRing = True 172 168 … … 335 331 # sort both lists together, ordered by keyText 336 332 selectedKeys = [] 337 dlg = G2G.G2MultiChoiceDialog(G2frame .dataFrame,'Select which image controls\nto copy',333 dlg = G2G.G2MultiChoiceDialog(G2frame,'Select which image controls\nto copy', 338 334 'Select image controls', keyText) 339 335 try: … … 346 342 for parm in selectedKeys: 347 343 copyDict[parm] = data[parm] 348 dlg = G2G.G2MultiChoiceDialog(G2frame .dataFrame,'Copy image controls from\n'+Source+' to...',344 dlg = G2G.G2MultiChoiceDialog(G2frame,'Copy image controls from\n'+Source+' to...', 349 345 'Copy image controls', Names) 350 346 try: … … 1034 1030 data['calibrant'] = calSel.GetValue().strip() 1035 1031 if data['calibrant']: 1036 G2frame.data Frame.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBRATE,enable=True)1037 G2frame.data Frame.ImageEdit.Enable(id=G2gd.wxID_IMCALIBRATE,enable=True)1038 G2frame.data Frame.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBALL,enable=True)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) 1039 1035 data['calibskip'] = calFile.Calibrants[data['calibrant']][3] 1040 1036 limits = calFile.Calibrants[data['calibrant']][4] … … 1045 1041 G2frame.calibDmin.SetValue(limits[0]) 1046 1042 else: 1047 G2frame.data Frame.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBRATE,enable=False)1048 G2frame.data Frame.ImageEdit.Enable(id=G2gd.wxID_IMCALIBRATE,enable=False)1049 G2frame.data Frame.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBALL,enable=False)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) 1050 1046 1051 1047 def OnCalibSkip(event): … … 1207 1203 G2frame.autoIntFrame = AutoIntFrame(G2frame,PollTime=PollTime) 1208 1204 G2frame.autoIntFrame.Bind(wx.EVT_WINDOW_DESTROY,OnDestroy) # clean up name on window close 1209 G2frame. dataFrame.Bind(wx.EVT_MENU, OnAutoInt, id=G2gd.wxID_IMAUTOINTEG)1210 1211 mainSizer = wx.BoxSizer(wx.VERTICAL)1205 G2frame.Bind(wx.EVT_MENU, OnAutoInt, id=G2gd.wxID_IMAUTOINTEG) 1206 1207 mainSizer = G2frame.dataWindow.GetSizer() 1212 1208 mainSizer.Add((5,10),0) 1213 1209 mainSizer.Add(ComboSizer(),0,wx.ALIGN_LEFT) … … 1229 1225 mainSizer.Add((5,5),0) 1230 1226 mainSizer.Add(GonioSizer(),0,WACV) 1231 1232 mainSizer.Layout()1233 G2frame.dataWindow.SetSizer(mainSizer)1234 mainSizer.Fit(G2frame.dataFrame)1235 G2frame.SetDataSize()1236 1227 1237 1228 ################################################################################ … … 1561 1552 CleanupMasks(data) # posting page for 1st time; clean out anything unfinished 1562 1553 G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.MaskMenu) 1563 G2frame. dataFrame.Bind(wx.EVT_MENU, OnCopyMask, id=G2gd.wxID_MASKCOPY)1564 G2frame. dataFrame.Bind(wx.EVT_MENU, OnLoadMask, id=G2gd.wxID_MASKLOAD)1565 G2frame. dataFrame.Bind(wx.EVT_MENU, OnLoadMask, id=G2gd.wxID_MASKLOADNOT)1566 G2frame. dataFrame.Bind(wx.EVT_MENU, OnSaveMask, id=G2gd.wxID_MASKSAVE)1567 G2frame. dataFrame.Bind(wx.EVT_MENU, OnAutoSpotMask, id=G2gd.wxID_FINDSPOTS)1568 G2frame. dataFrame.Bind(wx.EVT_MENU, OnDeleteSpotMask, id=G2gd.wxID_DELETESPOTS)1569 G2frame. dataFrame.Bind(wx.EVT_MENU, ToggleSpotMaskMode, id=G2gd.wxID_NEWMASKSPOT)1570 G2frame. dataFrame.Bind(wx.EVT_MENU, OnNewArcMask, id=G2gd.wxID_NEWMASKARC)1571 G2frame. dataFrame.Bind(wx.EVT_MENU, OnNewRingMask, id=G2gd.wxID_NEWMASKRING)1572 G2frame. dataFrame.Bind(wx.EVT_MENU, OnNewPolyMask, id=G2gd.wxID_NEWMASKPOLY)1573 G2frame. dataFrame.Bind(wx.EVT_MENU, OnNewFrameMask, id=G2gd.wxID_NEWMASKFRAME)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) 1574 1565 if G2frame.MaskKey == 'f': 1575 1566 G2frame.GetStatusBar().SetStatusText('Frame mask active - LB pick next point, RB close polygon') … … 1582 1573 else: 1583 1574 G2frame.GetStatusBar().SetStatusText("To add mask: press a,r,s,p or f on 2D image for arc/ring/spot/polygon/frame") 1584 mainSizer = wx.BoxSizer(wx.VERTICAL)1575 mainSizer = G2frame.dataWindow.GetSizer() 1585 1576 mainSizer.Add((5,10),0) 1586 1577 … … 1723 1714 littleSizer.Add(frameDelete,0,WACV) 1724 1715 mainSizer.Add(littleSizer,0,) 1725 mainSizer.Layout()1726 G2frame.dataWindow.SetSizer(mainSizer)1727 mainSizer.Fit(G2frame.dataFrame)1728 1716 G2frame.SetDataSize() 1729 1717 if startScroll: # reset scroll to saved position … … 1958 1946 CopyForward = False 1959 1947 choice = ['Reverse sequence','Copy from prev.',] 1960 dlg = wx.MultiChoiceDialog(G2frame .dataFrame,'Sequential controls','Select controls',choice)1948 dlg = wx.MultiChoiceDialog(G2frame,'Sequential controls','Select controls',choice) 1961 1949 if dlg.ShowModal() == wx.ID_OK: 1962 1950 for sel in dlg.GetSelections(): … … 2144 2132 G2gd.GetGPXtreeItemId(G2frame,G2frame.Image, 'Image Controls')) 2145 2133 G2gd.SetDataMenuBar(G2frame,G2frame.dataWindow.StrStaMenu) 2146 G2frame. dataFrame.Bind(wx.EVT_MENU, OnAppendDzero, id=G2gd.wxID_APPENDDZERO)2147 G2frame. dataFrame.Bind(wx.EVT_MENU, OnUpdateDzero, id=G2gd.wxID_UPDATEDZERO)2148 G2frame. dataFrame.Bind(wx.EVT_MENU, OnFitStrSta, id=G2gd.wxID_STRSTAFIT)2149 G2frame. dataFrame.Bind(wx.EVT_MENU, OnPlotStrSta, id=G2gd.wxID_STRSTAPLOT)2150 G2frame. dataFrame.Bind(wx.EVT_MENU, OnSaveStrRing, id=G2gd.wxID_STRRINGSAVE)2151 G2frame. dataFrame.Bind(wx.EVT_MENU, OnFitAllStrSta, id=G2gd.wxID_STRSTAALLFIT)2152 G2frame. dataFrame.Bind(wx.EVT_MENU, OnCopyStrSta, id=G2gd.wxID_STRSTACOPY)2153 G2frame. dataFrame.Bind(wx.EVT_MENU, OnLoadStrSta, id=G2gd.wxID_STRSTALOAD)2154 G2frame. dataFrame.Bind(wx.EVT_MENU, OnSaveStrSta, id=G2gd.wxID_STRSTASAVE)2155 G2frame. dataFrame.Bind(wx.EVT_MENU, OnStrStaSample, id=G2gd.wxID_STRSTSAMPLE)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) 2156 2144 if G2frame.StrainKey == 'a': #probably doesn't happen 2157 2145 G2frame.GetStatusBar().SetStatusText('Add strain ring active - LB pick d-zero value') … … 2159 2147 G2frame.GetStatusBar().SetStatusText("To add strain data: On 2D Powder Image, key a:add ring") 2160 2148 2161 mainSizer = wx.BoxSizer(wx.VERTICAL)2149 mainSizer = G2frame.dataWindow.GetSizer() 2162 2150 mainSizer.Add((5,10),0) 2163 2151 mainSizer.Add(SamSizer()) … … 2165 2153 mainSizer.Add(DzeroSizer()) 2166 2154 2167 mainSizer.Layout()2168 G2frame.dataWindow.SetSizer(mainSizer)2169 G2frame.dataWindow.SetAutoLayout(1)2170 mainSizer.Fit(G2frame.dataFrame)2171 G2frame.SetDataSize()2172 2173 2155 ########################################################################### 2174 2156 # Autointegration … … 3171 3153 wx.CallAfter(self.EndModal,wx.ID_CANCEL) 3172 3154 return 3173 mainSizer = wx.BoxSizer(wx.VERTICAL)3155 mainSizer = G2frame.dataWindow.GetSizer() 3174 3156 self.list = ImgIntLstCtrl(self, wx.ID_ANY, 3175 3157 style=wx.LC_REPORT … … 3190 3172 self.SetSizer(mainSizer) 3191 3173 self.list.FillList(self.parms) 3192 mainSizer.Layout()3193 mainSizer.Fit(self)3194 3174 3195 3175 def ReadFiles(self,files): -
branch/2frame/GSASIIlog.py
r2905 r2911 163 163 tabname = self.tablabel 164 164 LogInfo['LastPaintAction'] = self 165 if LogInfo['Tree'].G2frame. dataFrame.GetTitle() != wintitle:166 print LogInfo['Tree'].G2frame. dataFrame.GetTitle(),' != ',wintitle165 if LogInfo['Tree'].G2frame.GetTitle() != wintitle: 166 print LogInfo['Tree'].G2frame.GetTitle(),' != ',wintitle 167 167 raise Exception('tab in wrong window') 168 168 for PageNum in range(LogInfo['Tree'].G2frame.dataDisplay.GetPageCount()): -
branch/2frame/GSASIIobj.py
r2907 r2911 2622 2622 return repr(self.msg) 2623 2623 2624 def HowDidIgetHere( ):2624 def HowDidIgetHere(wherecalledonly=False): 2625 2625 '''Show a traceback with calls that brought us to the current location. 2626 2626 Used for debugging. 2627 2627 ''' 2628 2628 import traceback 2629 print 70*'*' 2630 for i in traceback.format_list(traceback.extract_stack()[:-1]): print(i.strip().rstrip()) 2631 print 70*'*' 2632 2629 if wherecalledonly: 2630 i = traceback.format_list(traceback.extract_stack()[:-1])[-2] 2631 print(i.strip().rstrip()) 2632 else: 2633 print 70*'*' 2634 for i in traceback.format_list(traceback.extract_stack()[:-1]): print(i.strip().rstrip()) 2635 print 70*'*' 2636 2633 2637 def CreatePDFitems(G2frame,PWDRtree,ElList,Qlimits,numAtm=1,FltBkg=0,PDFnames=[]): 2634 2638 '''Create and initialize a new set of PDF tree entries -
branch/2frame/GSASIIplot.py
r2908 r2911 259 259 # One example is GSASII.SumDialog, where a test plot is created. Are there others? 260 260 try: 261 Page.helpKey = self.G2frame.data Frame.helpKey261 Page.helpKey = self.G2frame.dataWindow.helpKey 262 262 except AttributeError: 263 263 Page.helpKey = 'Data tree' … … 1336 1336 elif event.key == 'f' and not G2frame.SinglePlot: 1337 1337 choices = G2gd.GetGPXtreeDataNames(G2frame,plotType) 1338 dlg = G2G.G2MultiChoiceDialog(G2frame .dataFrame,'Select dataset to plot',1338 dlg = G2G.G2MultiChoiceDialog(G2frame,'Select dataset to plot', 1339 1339 'Multidata plot selection',choices) 1340 1340 if dlg.ShowModal() == wx.ID_OK: … … 1666 1666 elif G2frame.GPXtree.GetItemText(PickId) == 'Background': 1667 1667 # selected a fixed background point. Can move it or delete it. 1668 for mode,id in G2frame.data Frame.wxID_BackPts.iteritems(): # what menu is selected?1669 if G2frame.data Frame.BackMenu.FindItemById(id).IsChecked():1668 for mode,id in G2frame.dataWindow.wxID_BackPts.iteritems(): # what menu is selected? 1669 if G2frame.dataWindow.BackMenu.FindItemById(id).IsChecked(): 1670 1670 break 1671 1671 # mode will be 'Add' or 'Move' or 'Del' … … 1728 1728 if G2frame.plotStyle['sqrtPlot']: 1729 1729 xy[1] = xy[1]**2 1730 for mode,id in G2frame.data Frame.wxID_BackPts.iteritems(): # what menu item is selected?1731 if G2frame.data Frame.BackMenu.FindItemById(id).IsChecked():1730 for mode,id in G2frame.dataWindow.wxID_BackPts.iteritems(): # what menu item is selected? 1731 if G2frame.dataWindow.BackMenu.FindItemById(id).IsChecked(): 1732 1732 break 1733 1733 if mode == 'Add': … … 1846 1846 Phases = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId,'Reflection Lists')) 1847 1847 Page.phaseList = sorted(Phases.keys()) # define an order for phases (once!) 1848 G2frame. dataWindow.Bind(wx.EVT_MENU, onMoveDiffCurve, id=G2frame.dataWindow.moveDiffCurve.GetId())1849 G2frame. dataWindow.Bind(wx.EVT_MENU, onMoveTopTick, id=G2frame.dataWindow.moveTickLoc.GetId())1850 G2frame. dataWindow.Bind(wx.EVT_MENU, onMoveTickSpace, id=G2frame.dataWindow.moveTickSpc.GetId())1848 G2frame.Bind(wx.EVT_MENU, onMoveDiffCurve, id=G2frame.dataWindow.moveDiffCurve.GetId()) 1849 G2frame.Bind(wx.EVT_MENU, onMoveTopTick, id=G2frame.dataWindow.moveTickLoc.GetId()) 1850 G2frame.Bind(wx.EVT_MENU, onMoveTickSpace, id=G2frame.dataWindow.moveTickSpc.GetId()) 1851 1851 G2frame.dataWindow.moveDiffCurve.Enable(False) 1852 1852 G2frame.dataWindow.moveTickLoc.Enable(False) 1853 1853 G2frame.dataWindow.moveTickSpc.Enable(False) 1854 1854 elif G2frame.GPXtree.GetItemText(G2frame.PickId) == 'Peak List': 1855 G2frame. dataFrame.Bind(wx.EVT_MENU, onMovePeak, id=G2frame.dataWindow.movePeak.GetId())1855 G2frame.Bind(wx.EVT_MENU, onMovePeak, id=G2frame.dataWindow.movePeak.GetId()) 1856 1856 # save information needed to reload from tree and redraw 1857 1857 kwargs={'PatternName':G2frame.GPXtree.GetItemText(G2frame.PatternId)} … … 2447 2447 elif event.key == 'f' and not G2frame.SinglePlot: 2448 2448 choices = G2gd.GetGPXtreeDataNames(G2frame,'PDF ') 2449 dlg = G2G.G2MultiChoiceDialog(G2frame .dataFrame,'Select dataset to plot',2449 dlg = G2G.G2MultiChoiceDialog(G2frame,'Select dataset to plot', 2450 2450 'Multidata plot selection',choices) 2451 2451 if dlg.ShowModal() == wx.ID_OK:
Note: See TracChangeset
for help on using the changeset viewer.