Changeset 2911 for branch/2frame


Ignore:
Timestamp:
Jul 5, 2017 6:57:25 PM (4 years ago)
Author:
toby
Message:

fix menu binds to dataWindow; fix Help menu for non-mac; dataFrame removal done

Location:
branch/2frame
Files:
8 edited

Legend:

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

    r2909 r2911  
    11311131    G2frame.Bind(wx.EVT_MENU, OnAddHold, id=G2gd.wxID_HOLDADD)
    11321132    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)
    11341134    # tab commands
    11351135    for id in (G2gd.wxID_CONSPHASE,
     
    11371137               G2gd.wxID_CONSHIST,
    11381138               G2gd.wxID_CONSGLOBAL):
    1139         G2frame.dataWindow.Bind(wx.EVT_MENU, RaisePage,id=id)
     1139        G2frame.Bind(wx.EVT_MENU, RaisePage,id=id)
    11401140
    11411141    #G2frame.constr = G2G.GSNoteBook(parent=G2frame.dataWindow,size=G2frame.dataWindow.GetClientSize())
     
    13241324        if text == 'Vector rigid bodies':
    13251325            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)
    13271327            G2frame.Page = [page,'vrb']
    13281328            UpdateVectorRB()
    13291329        elif text == 'Residue rigid bodies':
    13301330            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?
    13341334            G2frame.Page = [page,'rrb']
    13351335            UpdateResidueRB()
  • branch/2frame/GSASIIctrlGUI.py

    r2909 r2911  
    35113511        self.HelpById
    35123512
    3513         Note that self may be child of the main window (G2frame) or of the dataWindow
     3513        Note that self should now (2frame) be child of the main window (G2frame)
    35143514        '''
    3515         #TODO: !
    3516         if hasattr(self.frame,'dataFrame'):  # find the dataFrame
     3515        if hasattr(self.frame,'dataWindow'):  # Debug code: check this is called from menu in G2frame
     3516            # should always be true in 2 Frame version
    35173517            dW = self.frame.dataWindow
    35183518        else:
    35193519            print('help error: not called from standard menu?')
    35203520            print self
    3521             return
    3522            
     3521            return           
    35233522        try:
    3524             helpKey = dW.helpKey # BHT: look up help from helpKey in data window
    3525             #if GSASIIpath.GetConfigValue('debug'): print 'dataFrame help: key=',helpKey
     3523            helpKey = dW.helpKey # look up help from helpKey in data window
     3524            #if GSASIIpath.GetConfigValue('debug'): print 'dataWindow help: key=',helpKey
    35263525        except AttributeError:
    35273526            helpKey = ''
    3528             if GSASIIpath.GetConfigValue('debug'):
    3529                 print('No helpKey for current dataFrame!')
     3527            if GSASIIpath.GetConfigValue('debug'): print('No helpKey for current dataWindow!')
    35303528        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
    35333530        if helpType == 'Tutorials':
    35343531            dlg = OpenTutorial(self.frame)
  • branch/2frame/GSASIIdataGUI.py

    r2910 r2911  
    6565# Define short names for convenience
    6666WACV = wx.ALIGN_CENTER_VERTICAL
    67 VERY_LIGHT_GREY = wx.Colour(235,235,235)
     67VERY_LIGHT_GREY = wx.Colour(240,240,240)
     68DULL_YELLOW = (230,230,190)
    6869
    6970# define Ids for wx menu items
     
    438439
    439440    #application.main.OnRefine(None)
    440     application.SetAppDisplayName('GSAS-II')
     441    try:
     442        application.SetAppDisplayName('GSAS-II')
     443    except:
     444        pass
    441445    #application.GetTopWindow().dataWindow.SendSizeEvent()
    442446    #application.GetTopWindow().treePanel.SendSizeEvent()
     
    29422946        self.treeTitle = wx.StaticText(self.treePanel, wx.ID_ANY, "GSAS-II data tree",
    29432947                                       )
    2944         self.treeTitle.SetBackgroundColour(wx.Colour(230,230,150)) # add some yellow to the title
     2948        self.treeTitle.SetBackgroundColour(DULL_YELLOW) # add some yellow to the title
    29452949        treeSizer.Add(self.treeTitle,0,wx.EXPAND|wx.ALL,0)
    29462950        treeSizer.Add(self.GPXtree,1,wx.EXPAND|wx.ALL,0)
     
    29712975       
    29722976        self.dataWindow.SetupScrolling()
    2973         self.dataFrame = self.dataWindow        #kluge!!
    29742977       
    29752978        plotFrame = wx.Frame(None,-1,'GSASII Plots',size=wx.Size(700,600), \
     
    47394742    where the functions to be called are defined.
    47404743    '''
     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)
    47414752#    def Bind(self,eventtype,handler,*args,**kwargs):
    47424753#        '''Override the Bind() function: on the Mac the binding is to
     
    47754786       
    47764787    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.
    47824789        '''
    47834790        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')
    47934797
    47944798    def _initMenus_(self):
     
    57395743        '''
    57405744        #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, but
     5745        self.SetBackgroundColour(VERY_LIGHT_GREY)  # BHT: I prefer a gray background. Makes TextCtrls stand out, but
    57425746        # a bit lighter than the splitter bar
    57435747
     
    69736977    G2frame.SetTitle('Sequential refinement results')
    69746978    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)
    69936997
    69946998    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)
    69967000
    69977001    EnablePseudoVarMenus()
  • branch/2frame/GSASIIddataGUI.py

    r2908 r2911  
    770770       
    771771    def OnSelect(event):
    772         G2frame.hist = G2frame.dataFrame.HistsInPhase[select.GetSelection()]
     772        G2frame.hist = G2frame.dataWindow.HistsInPhase[select.GetSelection()]
    773773        oldFocus = wx.Window.FindFocus()
    774774        G2plt.PlotSizeStrainPO(G2frame,data,G2frame.hist)
     
    782782        mainSizer.Add(G2frame.bottomSizer)
    783783        mainSizer.Layout()
    784         G2frame.dataFrame.Refresh()
     784        G2frame.dataWindow.Refresh()
    785785        DData.SetVirtualSize(mainSizer.GetMinSize())
    786786        DData.Scroll(0,Scroll)
    787         G2frame.dataFrame.SendSizeEvent()
     787        G2frame.dataWindow.SendSizeEvent()
    788788       
    789789    def ShowHistogramInfo():
     
    965965    UseList = data['Histograms']
    966966    if UseList:
    967         G2frame.dataFrame.DataMenu.Enable(G2gd.wxID_DATADELETE,True)
     967        G2frame.dataWindow.DataMenu.Enable(G2gd.wxID_DATADELETE,True)
    968968        for item in G2frame.Refine: item.Enable(True)
    969969    else:
    970         G2frame.dataFrame.DataMenu.Enable(G2gd.wxID_DATADELETE,False)
     970        G2frame.dataWindow.DataMenu.Enable(G2gd.wxID_DATADELETE,False)
    971971        for item in G2frame.Refine: item.Enable(False)
    972972    # make a list of histograms (any type) used in this phase, ordered as in tree
    973     G2frame.dataFrame.HistsInPhase = [name for name in keyList if name in UseList]
     973    G2frame.dataWindow.HistsInPhase = [name for name in keyList if name in UseList]
    974974    generalData = data['General']
    975975    PhaseName = generalData['Name']       
    976976    SGData = generalData['SGData']
    977     if len(G2frame.dataFrame.HistsInPhase) == 0: # no associated histograms, nothing to display here
     977    if len(G2frame.dataWindow.HistsInPhase) == 0: # no associated histograms, nothing to display here
    978978        G2frame.hist = ''
    979     elif hist and hist in G2frame.dataFrame.HistsInPhase: # something was input as a selection as an argument
     979    elif hist and hist in G2frame.dataWindow.HistsInPhase: # something was input as a selection as an argument
    980980        G2frame.hist = hist
    981     elif (not G2frame.hist) or (G2frame.hist not in G2frame.dataFrame.HistsInPhase): # no or bad selection but have data, take the first
    982         G2frame.hist = G2frame.dataFrame.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]
    983983    Indx = {}
    984984   
     
    989989    if G2frame.hist:
    990990        topSizer = wx.FlexGridSizer(1,2,5,5)
    991         select = wx.ListBox(DData,choices=G2frame.dataFrame.HistsInPhase,
     991        select = wx.ListBox(DData,choices=G2frame.dataWindow.HistsInPhase,
    992992                            style=wx.LB_SINGLE,size=(-1,120))
    993         select.SetSelection(G2frame.dataFrame.HistsInPhase.index(G2frame.hist))
    994         select.SetFirstItem(G2frame.dataFrame.HistsInPhase.index(G2frame.hist))
     993        select.SetSelection(G2frame.dataWindow.HistsInPhase.index(G2frame.hist))
     994        select.SetFirstItem(G2frame.dataWindow.HistsInPhase.index(G2frame.hist))
    995995        select.Bind(wx.EVT_LISTBOX,OnSelect)
    996996        topSizer.Add(select,0,WACV|wx.LEFT,5)
     
    10031003        mainSizer.Add(wx.StaticText(DData,wx.ID_ANY,'  (This project has no data; use Import to read it)'),
    10041004                      0,WACV|wx.TOP,10)
    1005     elif not UseList in G2frame.dataFrame.HistsInPhase:
     1005    elif not UseList in G2frame.dataWindow.HistsInPhase:
    10061006        mainSizer.Add(wx.StaticText(DData,wx.ID_ANY,'  (This phase has no associated data; use appropriate Edit/Add... menu item)'),
    10071007                      0,WACV|wx.TOP,10)
  • branch/2frame/GSASIIimgGUI.py

    r2905 r2911  
    105105        G2plt.PlotExposedImage(G2frame,newPlot=True,event=tc.event)
    106106       
    107     G2frame.dataWindow.ClearData()
     107    #G2frame.dataWindow.ClearData()
    108108    G2frame.ImageZ = GetImageZ(G2frame,data)
    109     mainSizer = wx.BoxSizer(wx.VERTICAL)
     109    mainSizer = G2frame.dataWindow.GetSizer()
    110110    mainSizer.Add(wx.StaticText(G2frame.dataWindow,
    111111        label='Do not change anything here unless you are absolutely sure!'),0,WACV)
     
    131131        min=0.,max=1.,typeHint=float),0,WACV)
    132132    mainSizer.Add(distSizer,0)
    133     mainSizer.Layout()   
    134     G2frame.dataWindow.SetSizer(mainSizer)
    135     mainSizer.Fit(G2frame.dataFrame)
    136     G2frame.SetDataSize()
    137133
    138134################################################################################
     
    166162
    167163# Menu items
    168            
     164
    169165    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')
    171167        G2frame.ifGetRing = True
    172168               
     
    335331        # sort both lists together, ordered by keyText
    336332        selectedKeys = []
    337         dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame,'Select which image controls\nto copy',
     333        dlg = G2G.G2MultiChoiceDialog(G2frame,'Select which image controls\nto copy',
    338334            'Select image controls', keyText)
    339335        try:
     
    346342        for parm in selectedKeys:
    347343            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...',
    349345            'Copy image controls', Names)
    350346        try:
     
    10341030            data['calibrant'] = calSel.GetValue().strip()
    10351031            if data['calibrant']:
    1036                 G2frame.dataFrame.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBRATE,enable=True)
    1037                 G2frame.dataFrame.ImageEdit.Enable(id=G2gd.wxID_IMCALIBRATE,enable=True)
    1038                 G2frame.dataFrame.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)
    10391035                data['calibskip'] = calFile.Calibrants[data['calibrant']][3]
    10401036                limits = calFile.Calibrants[data['calibrant']][4]
     
    10451041                G2frame.calibDmin.SetValue(limits[0])
    10461042            else:
    1047                 G2frame.dataFrame.ImageEdit.Enable(id=G2gd.wxID_IMRECALIBRATE,enable=False)
    1048                 G2frame.dataFrame.ImageEdit.Enable(id=G2gd.wxID_IMCALIBRATE,enable=False)
    1049                 G2frame.dataFrame.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)
    10501046               
    10511047        def OnCalibSkip(event):
     
    12071203        G2frame.autoIntFrame = AutoIntFrame(G2frame,PollTime=PollTime)
    12081204        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()
    12121208    mainSizer.Add((5,10),0)   
    12131209    mainSizer.Add(ComboSizer(),0,wx.ALIGN_LEFT)
     
    12291225    mainSizer.Add((5,5),0)
    12301226    mainSizer.Add(GonioSizer(),0,WACV)   
    1231        
    1232     mainSizer.Layout()   
    1233     G2frame.dataWindow.SetSizer(mainSizer)
    1234     mainSizer.Fit(G2frame.dataFrame)
    1235     G2frame.SetDataSize()
    12361227   
    12371228################################################################################
     
    15611552        CleanupMasks(data) # posting page for 1st time; clean out anything unfinished
    15621553    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)
    15741565    if G2frame.MaskKey == 'f':
    15751566        G2frame.GetStatusBar().SetStatusText('Frame mask active - LB pick next point, RB close polygon')
     
    15821573    else:
    15831574        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()
    15851576    mainSizer.Add((5,10),0)
    15861577
     
    17231714        littleSizer.Add(frameDelete,0,WACV)
    17241715        mainSizer.Add(littleSizer,0,)
    1725     mainSizer.Layout()   
    1726     G2frame.dataWindow.SetSizer(mainSizer)
    1727     mainSizer.Fit(G2frame.dataFrame)
    17281716    G2frame.SetDataSize()
    17291717    if startScroll: # reset scroll to saved position
     
    19581946        CopyForward = False
    19591947        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)
    19611949        if dlg.ShowModal() == wx.ID_OK:
    19621950            for sel in dlg.GetSelections():
     
    21442132        G2gd.GetGPXtreeItemId(G2frame,G2frame.Image, 'Image Controls'))       
    21452133    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)       
    21562144    if G2frame.StrainKey == 'a':    #probably doesn't happen
    21572145        G2frame.GetStatusBar().SetStatusText('Add strain ring active - LB pick d-zero value')
     
    21592147        G2frame.GetStatusBar().SetStatusText("To add strain data: On 2D Powder Image, key a:add ring")
    21602148       
    2161     mainSizer = wx.BoxSizer(wx.VERTICAL)
     2149    mainSizer = G2frame.dataWindow.GetSizer()
    21622150    mainSizer.Add((5,10),0)
    21632151    mainSizer.Add(SamSizer())
     
    21652153    mainSizer.Add(DzeroSizer())
    21662154   
    2167     mainSizer.Layout()   
    2168     G2frame.dataWindow.SetSizer(mainSizer)
    2169     G2frame.dataWindow.SetAutoLayout(1)
    2170     mainSizer.Fit(G2frame.dataFrame)
    2171     G2frame.SetDataSize()
    2172 
    21732155###########################################################################
    21742156# Autointegration
     
    31713153                wx.CallAfter(self.EndModal,wx.ID_CANCEL)
    31723154                return
    3173         mainSizer = wx.BoxSizer(wx.VERTICAL)
     3155        mainSizer = G2frame.dataWindow.GetSizer()
    31743156        self.list = ImgIntLstCtrl(self, wx.ID_ANY,
    31753157                      style=wx.LC_REPORT
     
    31903172        self.SetSizer(mainSizer)
    31913173        self.list.FillList(self.parms)
    3192         mainSizer.Layout()
    3193         mainSizer.Fit(self)
    31943174       
    31953175    def ReadFiles(self,files):
  • branch/2frame/GSASIIlog.py

    r2905 r2911  
    163163        tabname = self.tablabel
    164164        LogInfo['LastPaintAction'] = self
    165         if LogInfo['Tree'].G2frame.dataFrame.GetTitle() != wintitle:
    166             print LogInfo['Tree'].G2frame.dataFrame.GetTitle(),' != ',wintitle
     165        if LogInfo['Tree'].G2frame.GetTitle() != wintitle:
     166            print LogInfo['Tree'].G2frame.GetTitle(),' != ',wintitle
    167167            raise Exception('tab in wrong window')
    168168        for PageNum in range(LogInfo['Tree'].G2frame.dataDisplay.GetPageCount()):
  • branch/2frame/GSASIIobj.py

    r2907 r2911  
    26222622        return repr(self.msg)
    26232623
    2624 def HowDidIgetHere():
     2624def HowDidIgetHere(wherecalledonly=False):
    26252625    '''Show a traceback with calls that brought us to the current location.
    26262626    Used for debugging.
    26272627    '''
    26282628    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               
    26332637def CreatePDFitems(G2frame,PWDRtree,ElList,Qlimits,numAtm=1,FltBkg=0,PDFnames=[]):
    26342638    '''Create and initialize a new set of PDF tree entries
  • branch/2frame/GSASIIplot.py

    r2908 r2911  
    259259        # One example is GSASII.SumDialog, where a test plot is created. Are there others?
    260260        try:
    261             Page.helpKey = self.G2frame.dataFrame.helpKey
     261            Page.helpKey = self.G2frame.dataWindow.helpKey
    262262        except AttributeError:
    263263            Page.helpKey = 'Data tree'
     
    13361336        elif event.key == 'f' and not G2frame.SinglePlot:
    13371337            choices = G2gd.GetGPXtreeDataNames(G2frame,plotType)
    1338             dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame,'Select dataset to plot',
     1338            dlg = G2G.G2MultiChoiceDialog(G2frame,'Select dataset to plot',
    13391339                'Multidata plot selection',choices)
    13401340            if dlg.ShowModal() == wx.ID_OK:
     
    16661666        elif G2frame.GPXtree.GetItemText(PickId) == 'Background':
    16671667            # selected a fixed background point. Can move it or delete it.
    1668             for mode,id in G2frame.dataFrame.wxID_BackPts.iteritems(): # what menu is selected?
    1669                 if G2frame.dataFrame.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():
    16701670                    break
    16711671            # mode will be 'Add' or 'Move' or 'Del'
     
    17281728            if G2frame.plotStyle['sqrtPlot']:
    17291729                xy[1] = xy[1]**2
    1730             for mode,id in G2frame.dataFrame.wxID_BackPts.iteritems(): # what menu item is selected?
    1731                 if G2frame.dataFrame.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():
    17321732                    break
    17331733            if mode == 'Add':
     
    18461846        Phases = G2frame.GPXtree.GetItemPyData(G2gd.GetGPXtreeItemId(G2frame,G2frame.PatternId,'Reflection Lists'))
    18471847        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())
    18511851        G2frame.dataWindow.moveDiffCurve.Enable(False)
    18521852        G2frame.dataWindow.moveTickLoc.Enable(False)
    18531853        G2frame.dataWindow.moveTickSpc.Enable(False)
    18541854    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())
    18561856    # save information needed to reload from tree and redraw
    18571857    kwargs={'PatternName':G2frame.GPXtree.GetItemText(G2frame.PatternId)}
     
    24472447        elif event.key == 'f' and not G2frame.SinglePlot:
    24482448            choices = G2gd.GetGPXtreeDataNames(G2frame,'PDF ')
    2449             dlg = G2G.G2MultiChoiceDialog(G2frame.dataFrame,'Select dataset to plot',
     2449            dlg = G2G.G2MultiChoiceDialog(G2frame,'Select dataset to plot',
    24502450                'Multidata plot selection',choices)
    24512451            if dlg.ShowModal() == wx.ID_OK:
Note: See TracChangeset for help on using the changeset viewer.