Changeset 135


Ignore:
Timestamp:
Jul 27, 2010 6:04:03 PM (11 years ago)
Author:
vondreel
Message:

remove "GSASII" and "menu" from all names originally put in by Boaconstructor & not needed!!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r122 r135  
    3838    return GSASII(parent)
    3939
    40 [wxID_GSASII, wxID_GSASIIPATTERNTREE, wxID_GSASIIDATA, wxID_GSASIIPICKGRID,
    41 ] = [wx.NewId() for _init_ctrls in range(4)]
    42 
    43 [wxID_GSASIIFILECLOSE, wxID_GSASIIFILEEXIT, wxID_GSASIIFILEOPEN,
    44  wxID_GSASIIFILESAVE, wxID_GSASIIFILESAVEAS, wxID_GSASIIUNDO,
     40[wxID_PATTERNTREE,
     41] = [wx.NewId() for _init_ctrls in range(1)]
     42
     43[wxID_FILECLOSE, wxID_FILEEXIT, wxID_FILEOPEN,
     44 wxID_FILESAVE, wxID_FILESAVEAS, wxID_UNDO,
    4545] = [wx.NewId() for _init_coll_File_Items in range(6)]
    4646
    47 [wxID_GSASIIPWDRREAD,wxID_GSASIISNGLREAD,wxID_GSASIIADDPHASE,wxID_GSASIIDELETEPHASE,
    48  wxID_GSASIIDATADELETE,wxID_GSASIIREADPEAKS,wxID_GSASIIPWDSUM,wxID_GSASIIIMGREAD,
    49  wxID_GSASIIIMSUM,
    50 ] = [wx.NewId() for _init_coll_Data_Items in range(9)]
    51 
    52 [wxID_GSASIIIMPORT, wxID_GSASIIIMPORTPATTERN, wxID_GSASIIIMPORTHKL, wxID_GSASIIIMPORTPHASE,
    53 wxID_GSASIIIMPORTCIF, wxID_GSASIIIMPORTPDB, 
     47[wxID_PWDRREAD,wxID_SNGLREAD,wxID_ADDPHASE,wxID_DELETEPHASE,
     48 wxID_DATADELETE,wxID_READPEAKS,wxID_PWDSUM,wxID_IMGREAD,
     49 wxID_IMSUM, wxID_DATARENAME,
     50] = [wx.NewId() for _init_coll_Data_Items in range(10)]
     51
     52[wxID_IMPORT, wxID_IMPORTPATTERN, wxID_IMPORTHKL, wxID_IMPORTPHASE,
     53wxID_IMPORTCIF, wxID_IMPORTPDB, 
    5454] = [wx.NewId() for _init_coll_Import_Items in range(6)]
    5555
    56 [wxID_GSAIIEXPORT, wxID_GSASIIEXPORTPATTERN, wxID_GSASIIEXPORTHKL, wxID_GSASIIEXPORTPHASE,
    57 wxID_GSASIIEXPORTCIF, wxID_GSASIIEXPORTPEAKLIST
     56[wxID_EXPORT, wxID_EXPORTPATTERN, wxID_EXPORTHKL, wxID_EXPORTPHASE,
     57wxID_EXPORTCIF, wxID_EXPORTPEAKLIST
    5858] = [wx.NewId() for _init_coll_Export_Items in range(6)]
    5959
    60 [wxID_GSASIIHELPABOUT, wxID_GSASIIHELPHELP,
     60[wxID_HELPABOUT, wxID_HELPHELP,
    6161] = [wx.NewId() for _init_coll_Help_Items in range(2)]
    6262
     
    7272
    7373    def _init_coll_File_Items(self, parent):
    74         parent.Append(help='Open a gsasii project file (*.gpx)', id=wxID_GSASIIFILEOPEN,
     74        parent.Append(help='Open a gsasii project file (*.gpx)', id=wxID_FILEOPEN,
    7575             kind=wx.ITEM_NORMAL,text='Open project...')
    76         parent.Append(help='SAve project to old file', id=wxID_GSASIIFILESAVE,
     76        parent.Append(help='SAve project to old file', id=wxID_FILESAVE,
    7777            kind=wx.ITEM_NORMAL,text='Save project')
    78         parent.Append(help='Save project to new file', id=wxID_GSASIIFILESAVEAS,
     78        parent.Append(help='Save project to new file', id=wxID_FILESAVEAS,
    7979            kind=wx.ITEM_NORMAL,text='Save As...')
    80         parent.Append(help='Close project, saving is optional', id=wxID_GSASIIFILECLOSE,
     80        parent.Append(help='Close project, saving is optional', id=wxID_FILECLOSE,
    8181            kind=wx.ITEM_NORMAL,text='Close project')
    82         parent.Append(help='Exit from gsasii', id=wxID_GSASIIFILEEXIT, kind=wx.ITEM_NORMAL,
     82        parent.Append(help='Exit from gsasii', id=wxID_FILEEXIT, kind=wx.ITEM_NORMAL,
    8383            text='Exit')
    84         self.Bind(wx.EVT_MENU, self.OnFileOpenMenu, id=wxID_GSASIIFILEOPEN)
    85         self.Bind(wx.EVT_MENU, self.OnFileSaveMenu, id=wxID_GSASIIFILESAVE)
    86         self.Bind(wx.EVT_MENU, self.OnFileSaveasMenu, id=wxID_GSASIIFILESAVEAS)
    87         self.Bind(wx.EVT_MENU, self.OnFileCloseMenu, id=wxID_GSASIIFILECLOSE)
    88         self.Bind(wx.EVT_MENU, self.OnFileExitMenu, id=wxID_GSASIIFILEEXIT)
     84        self.Bind(wx.EVT_MENU, self.OnFileOpen, id=wxID_FILEOPEN)
     85        self.Bind(wx.EVT_MENU, self.OnFileSave, id=wxID_FILESAVE)
     86        self.Bind(wx.EVT_MENU, self.OnFileSaveas, id=wxID_FILESAVEAS)
     87        self.Bind(wx.EVT_MENU, self.OnFileClose, id=wxID_FILECLOSE)
     88        self.Bind(wx.EVT_MENU, self.OnFileExit, id=wxID_FILEEXIT)
    8989       
    9090    def _init_coll_Data_Items(self,parent):
    91         parent.Append(help='', id=wxID_GSASIIPWDRREAD, kind=wx.ITEM_NORMAL,
     91        parent.Append(help='', id=wxID_PWDRREAD, kind=wx.ITEM_NORMAL,
    9292            text='Read powder data...')
    93         parent.Append(help='',id=wxID_GSASIIIMGREAD, kind=wx.ITEM_NORMAL,
     93        parent.Append(help='',id=wxID_IMGREAD, kind=wx.ITEM_NORMAL,
    9494            text='Read image data...')
    95         parent.Append(help='',id=wxID_GSASIIREADPEAKS, kind=wx.ITEM_NORMAL,
     95        parent.Append(help='',id=wxID_READPEAKS, kind=wx.ITEM_NORMAL,
    9696            text='Read Powder Pattern Peaks...')
    97         parent.Append(help='', id=wxID_GSASIISNGLREAD, kind=wx.ITEM_NORMAL,
     97        parent.Append(help='', id=wxID_SNGLREAD, kind=wx.ITEM_NORMAL,
    9898            text='Read single crystal data...')
    99         parent.Append(help='', id=wxID_GSASIIPWDSUM, kind=wx.ITEM_NORMAL,
     99        parent.Append(help='', id=wxID_PWDSUM, kind=wx.ITEM_NORMAL,
    100100            text='Sum powder data')
    101         parent.Append(help='',id=wxID_GSASIIIMSUM, kind=wx.ITEM_NORMAL,
     101        parent.Append(help='',id=wxID_IMSUM, kind=wx.ITEM_NORMAL,
    102102            text='Sum image data')
    103         parent.Append(help='', id=wxID_GSASIIADDPHASE, kind=wx.ITEM_NORMAL,
     103        parent.Append(help='', id=wxID_ADDPHASE, kind=wx.ITEM_NORMAL,
    104104            text='Add phase')
    105         parent.Append(help='', id=wxID_GSASIIDELETEPHASE, kind=wx.ITEM_NORMAL,
     105        parent.Append(help='', id=wxID_DELETEPHASE, kind=wx.ITEM_NORMAL,
    106106            text='Delete phase')
    107         parent.Append(help='', id=wxID_GSASIIDATADELETE, kind=wx.ITEM_NORMAL,
     107        parent.Append(help='', id=wxID_DATARENAME, kind=wx.ITEM_NORMAL,
     108            text='Rename data')
     109        parent.Append(help='', id=wxID_DATADELETE, kind=wx.ITEM_NORMAL,
    108110            text='Delete data')
    109         self.Bind(wx.EVT_MENU, self.OnPwdrReadMenu, id=wxID_GSASIIPWDRREAD)
    110         self.Bind(wx.EVT_MENU, self.OnPwdrSumMenu, id=wxID_GSASIIPWDSUM)
    111         self.Bind(wx.EVT_MENU, self.OnReadPowderPeaks, id=wxID_GSASIIREADPEAKS)
    112         self.Bind(wx.EVT_MENU, self.OnImageRead, id=wxID_GSASIIIMGREAD)
    113         self.Bind(wx.EVT_MENU, self.OnImageSum, id=wxID_GSASIIIMSUM)
    114         self.Bind(wx.EVT_MENU, self.OnSnglReadMenu, id=wxID_GSASIISNGLREAD)
    115         self.Bind(wx.EVT_MENU, self.OnAddPhase, id=wxID_GSASIIADDPHASE)
    116         self.Bind(wx.EVT_MENU, self.OnDeletePhase, id=wxID_GSASIIDELETEPHASE)
    117         self.Bind(wx.EVT_MENU, self.OnDataDeleteMenu, id=wxID_GSASIIDATADELETE)
     111        self.Bind(wx.EVT_MENU, self.OnPwdrRead, id=wxID_PWDRREAD)
     112        self.Bind(wx.EVT_MENU, self.OnPwdrSum, id=wxID_PWDSUM)
     113        self.Bind(wx.EVT_MENU, self.OnReadPowderPeaks, id=wxID_READPEAKS)
     114        self.Bind(wx.EVT_MENU, self.OnImageRead, id=wxID_IMGREAD)
     115        self.Bind(wx.EVT_MENU, self.OnImageSum, id=wxID_IMSUM)
     116        self.Bind(wx.EVT_MENU, self.OnSnglRead, id=wxID_SNGLREAD)
     117        self.Bind(wx.EVT_MENU, self.OnAddPhase, id=wxID_ADDPHASE)
     118        self.Bind(wx.EVT_MENU, self.OnDeletePhase, id=wxID_DELETEPHASE)
     119        self.Bind(wx.EVT_MENU, self.OnRenameData, id=wxID_DATARENAME)
     120        self.Bind(wx.EVT_MENU, self.OnDataDelete, id=wxID_DATADELETE)
    118121               
    119122    def _init_coll_Calculate_Items(self,parent):
    120         self.UnDo = parent.Append(help='', id=wxID_GSASIIUNDO, kind=wx.ITEM_NORMAL,
     123        self.UnDo = parent.Append(help='', id=wxID_UNDO, kind=wx.ITEM_NORMAL,
    121124            text='UnDo')
    122125        self.UnDo.Enable(False)
    123         self.Bind(wx.EVT_MENU, self.OnUnDo, id=wxID_GSASIIUNDO)
     126        self.Bind(wx.EVT_MENU, self.OnUnDo, id=wxID_UNDO)
    124127       
    125128    def _init_coll_Import_Items(self,parent):
    126129        self.ImportPhase = parent.Append(help='Import phase data from GSAS EXP file',
    127             id=wxID_GSASIIIMPORTPHASE, kind=wx.ITEM_NORMAL,text='Import GSAS EXP Phase...')
     130            id=wxID_IMPORTPHASE, kind=wx.ITEM_NORMAL,text='Import GSAS EXP Phase...')
    128131        self.ImportPDB = parent.Append(help='Import phase data from PDB file',
    129             id=wxID_GSASIIIMPORTPDB, kind=wx.ITEM_NORMAL,text='Import PDB Phase...')
    130         self.ImportPattern = parent.Append(help='',id=wxID_GSASIIIMPORTPATTERN, kind=wx.ITEM_NORMAL,
     132            id=wxID_IMPORTPDB, kind=wx.ITEM_NORMAL,text='Import PDB Phase...')
     133        self.ImportPattern = parent.Append(help='',id=wxID_IMPORTPATTERN, kind=wx.ITEM_NORMAL,
    131134            text='Import Powder Pattern...')
    132         self.ImportHKL = parent.Append(help='',id=wxID_GSASIIIMPORTHKL, kind=wx.ITEM_NORMAL,
     135        self.ImportHKL = parent.Append(help='',id=wxID_IMPORTHKL, kind=wx.ITEM_NORMAL,
    133136            text='Import HKLs...')
    134         self.ImportCIF = parent.Append(help='',id=wxID_GSASIIIMPORTCIF, kind=wx.ITEM_NORMAL,
     137        self.ImportCIF = parent.Append(help='',id=wxID_IMPORTCIF, kind=wx.ITEM_NORMAL,
    135138            text='Import CIF...')
    136         self.Bind(wx.EVT_MENU, self.OnImportPhase, id=wxID_GSASIIIMPORTPHASE)
    137         self.Bind(wx.EVT_MENU, self.OnImportPDB, id=wxID_GSASIIIMPORTPDB)
    138         self.Bind(wx.EVT_MENU, self.OnImportPattern, id=wxID_GSASIIIMPORTPATTERN)
    139         self.Bind(wx.EVT_MENU, self.OnImportHKL, id=wxID_GSASIIIMPORTHKL)
    140         self.Bind(wx.EVT_MENU, self.OnImportCIF, id=wxID_GSASIIIMPORTCIF)
     139        self.Bind(wx.EVT_MENU, self.OnImportPhase, id=wxID_IMPORTPHASE)
     140        self.Bind(wx.EVT_MENU, self.OnImportPDB, id=wxID_IMPORTPDB)
     141        self.Bind(wx.EVT_MENU, self.OnImportPattern, id=wxID_IMPORTPATTERN)
     142        self.Bind(wx.EVT_MENU, self.OnImportHKL, id=wxID_IMPORTHKL)
     143        self.Bind(wx.EVT_MENU, self.OnImportCIF, id=wxID_IMPORTCIF)
    141144
    142145    def _init_coll_Export_Items(self,parent):
    143         self.ExportPattern = parent.Append(help='Select PWDR item to enable',id=wxID_GSASIIEXPORTPATTERN, kind=wx.ITEM_NORMAL,
     146        self.ExportPattern = parent.Append(help='Select PWDR item to enable',id=wxID_EXPORTPATTERN, kind=wx.ITEM_NORMAL,
    144147            text='Export Powder Pattern...')
    145         self.ExportPeakList = parent.Append(help='',id=wxID_GSASIIEXPORTPEAKLIST, kind=wx.ITEM_NORMAL,
     148        self.ExportPeakList = parent.Append(help='',id=wxID_EXPORTPEAKLIST, kind=wx.ITEM_NORMAL,
    146149            text='Export All Peak Lists...')
    147         self.ExportHKL = parent.Append(help='',id=wxID_GSASIIEXPORTHKL, kind=wx.ITEM_NORMAL,
     150        self.ExportHKL = parent.Append(help='',id=wxID_EXPORTHKL, kind=wx.ITEM_NORMAL,
    148151            text='Export HKLs...')
    149         self.ExportPhase = parent.Append(help='',id=wxID_GSASIIEXPORTPHASE, kind=wx.ITEM_NORMAL,
     152        self.ExportPhase = parent.Append(help='',id=wxID_EXPORTPHASE, kind=wx.ITEM_NORMAL,
    150153            text='Export Phase...')
    151         self.ExportCIF = parent.Append(help='',id=wxID_GSASIIEXPORTCIF, kind=wx.ITEM_NORMAL,
     154        self.ExportCIF = parent.Append(help='',id=wxID_EXPORTCIF, kind=wx.ITEM_NORMAL,
    152155            text='Export CIF...')
    153156        self.ExportPattern.Enable(False)
     
    156159        self.ExportPhase.Enable(False)
    157160        self.ExportCIF.Enable(False)
    158         self.Bind(wx.EVT_MENU, self.OnExportPattern, id=wxID_GSASIIEXPORTPATTERN)
    159         self.Bind(wx.EVT_MENU, self.OnExportPeakList, id=wxID_GSASIIEXPORTPEAKLIST)
    160         self.Bind(wx.EVT_MENU, self.OnExportHKL, id=wxID_GSASIIEXPORTHKL)
    161         self.Bind(wx.EVT_MENU, self.OnExportPhase, id=wxID_GSASIIEXPORTPHASE)
    162         self.Bind(wx.EVT_MENU, self.OnExportCIF, id=wxID_GSASIIEXPORTCIF)
     161        self.Bind(wx.EVT_MENU, self.OnExportPattern, id=wxID_EXPORTPATTERN)
     162        self.Bind(wx.EVT_MENU, self.OnExportPeakList, id=wxID_EXPORTPEAKLIST)
     163        self.Bind(wx.EVT_MENU, self.OnExportHKL, id=wxID_EXPORTHKL)
     164        self.Bind(wx.EVT_MENU, self.OnExportPhase, id=wxID_EXPORTPHASE)
     165        self.Bind(wx.EVT_MENU, self.OnExportCIF, id=wxID_EXPORTCIF)
    163166               
    164167    def _init_coll_Help_Items(self, parent):
    165         parent.Append(help='', id=wxID_GSASIIHELPHELP, kind=wx.ITEM_NORMAL,
     168        parent.Append(help='', id=wxID_HELPHELP, kind=wx.ITEM_NORMAL,
    166169            text='Help')
    167         parent.Append(help='', id=wxID_GSASIIHELPABOUT, kind=wx.ITEM_NORMAL,
     170        parent.Append(help='', id=wxID_HELPABOUT, kind=wx.ITEM_NORMAL,
    168171            text='About')
    169         self.Bind(wx.EVT_MENU, self.OnHelpHelpMenu, id=wxID_GSASIIHELPHELP)
    170         self.Bind(wx.EVT_MENU, self.OnHelpAboutMenu, id=wxID_GSASIIHELPABOUT)
     172        self.Bind(wx.EVT_MENU, self.OnHelpHelp, id=wxID_HELPHELP)
     173        self.Bind(wx.EVT_MENU, self.OnHelpAbout, id=wxID_HELPABOUT)
    171174
    172175    def _init_utils(self):
     
    188191       
    189192    def _init_ctrls(self, parent):
    190         wx.Frame.__init__(self, id=wxID_GSASII, name='GSASII', parent=parent,
     193        wx.Frame.__init__(self, name='GSASII', parent=parent,
    191194            size=wx.Size(300, 250),style=wx.DEFAULT_FRAME_STYLE, title='GSAS-II')
    192195        screenSize = wx.DisplaySize()
     
    200203        self.mainPanel = wx.Panel(self,-1)
    201204       
    202         self.PatternTree = wx.TreeCtrl(id=wxID_GSASIIPATTERNTREE,
     205        self.PatternTree = wx.TreeCtrl(id=wxID_PATTERNTREE,
    203206            parent=self.mainPanel, pos=wx.Point(0, 0),style=wx.TR_DEFAULT_STYLE )
    204207        self.PatternTree.Bind(wx.EVT_TREE_SEL_CHANGED,
    205             self.OnPatternTreeSelChanged, id=wxID_GSASIIPATTERNTREE)
     208            self.OnPatternTreeSelChanged, id=wxID_PATTERNTREE)
    206209        self.PatternTree.Bind(wx.EVT_TREE_ITEM_COLLAPSED,
    207             self.OnPatternTreeItemCollapsed, id=wxID_GSASIIPATTERNTREE)
     210            self.OnPatternTreeItemCollapsed, id=wxID_PATTERNTREE)
    208211        self.PatternTree.Bind(wx.EVT_TREE_ITEM_EXPANDED,
    209             self.OnPatternTreeItemExpanded, id=wxID_GSASIIPATTERNTREE)
     212            self.OnPatternTreeItemExpanded, id=wxID_PATTERNTREE)
    210213        self.root = self.PatternTree.AddRoot("Loaded Data")
    211214       
     
    277280        event.Skip()
    278281       
    279     def OnPwdrReadMenu(self, event):
     282    def OnPwdrRead(self, event):
    280283        self.CheckNotebook()
    281284        dlg = wx.FileDialog(self, 'Choose files', '.', '',
     
    432435            dlg.Destroy()
    433436       
    434     def OnSnglReadMenu(self,event):
     437    def OnSnglRead(self,event):
    435438        self.CheckNotebook()
    436439        dlg = wx.FileDialog(self, 'Choose file', '.', '',
     
    447450                    names = ['Type','Lam']
    448451                    HKLref,HKLmin,HKLmax,FoMax,ifFc = G2IO.GetHKLData(filename)
    449                     Id = self.PatternTree.AppendItem(parent=self.root,text='SXTL '+ospath.basename(filename))
     452                    Id = self.PatternTree.AppendItem(parent=self.root,text='HKLF '+ospath.basename(filename))
    450453                    self.PatternTree.SetItemPyData(Id,HKLref)
    451454                    Sub = self.PatternTree.AppendItem(Id,text='Instrument Parameters')
     
    532535       
    533536    class SumDialog(wx.Dialog):
    534         def __init__(self,parent,title,text,type,data):
     537        def __init__(self,parent,title,text,dataType,data):
    535538            wx.Dialog.__init__(self,parent,-1,title,
    536539                pos=wx.DefaultPosition,style=wx.DEFAULT_DIALOG_STYLE)
     
    550553                dataGridSizer.Add(scale,0,wx.LEFT,10)
    551554                dataGridSizer.Add(name,0,wx.RIGHT,10)
    552             dataGridSizer.Add(wx.StaticText(panel,-1,'Sum result name: '+type),0, \
     555            dataGridSizer.Add(wx.StaticText(panel,-1,'Sum result name: '+dataType),0, \
    553556                wx.LEFT|wx.TOP|wx.ALIGN_CENTER_VERTICAL,10)
    554557            self.name = wx.TextCtrl(panel,-1,self.data[-1],size=wx.Size(200,20),style=wx.TE_PROCESS_ENTER)
     
    603606                return self.data
    604607           
    605     def OnPwdrSumMenu(self,event):
     608    def OnPwdrSum(self,event):
    606609        TextList = []
    607610        DataList = []
     
    839842                        self.PatternTree.Delete(item)
    840843            finally:
    841                 dlg.Destroy()       
    842        
    843     def OnDataDeleteMenu(self, event):
     844                dlg.Destroy()
     845               
     846    def OnRenameData(self,event):
     847        name = self.PatternTree.GetItemText(self.PickId)     
     848        if 'PWDR' in name or 'HKLF' in name or 'IMG' in name:
     849            dataType = name[:name.index(' ')+1]                 #includes the ' '
     850            dlg = wx.TextEntryDialog(self,'Data name: '+dataType,'Change data name',
     851                defaultValue=name[name.index(' ')+1:])
     852            try:
     853                if dlg.ShowModal() == wx.ID_OK:
     854                    self.PatternTree.SetItemText(self.PickId,dataType+dlg.GetValue())
     855            finally:
     856                dlg.Destroy()
     857       
     858    def OnDataDelete(self, event):
    844859        TextList = []
    845860        DelList = []
     
    849864            while item:
    850865                name = self.PatternTree.GetItemText(item)
    851                 if 'PWDR' in name or 'SXTL' in name or 'IMG' in name:
     866                if 'PWDR' in name or 'HKLF' in name or 'IMG' in name:
    852867                    TextList.append(name)
    853868                item, cookie = self.PatternTree.GetNextChild(self.root, cookie)               
     
    867882                dlg.Destroy()
    868883
    869     def OnFileOpenMenu(self, event):
     884    def OnFileOpen(self, event):
    870885        result = ''
    871886        Id = 0
     
    878893                if result == wx.ID_OK:
    879894                    self.PatternTree.DeleteChildren(self.root)
    880                     print 'children deleted'
     895                    self.GSASprojectfile = ''
     896                    self.PatternTree.DeleteChildren(self.root)
     897                    if self.HKL: self.HKL = []
     898                    if self.G2plotNB.plotList:
     899                        self.G2plotNB.clear()
    881900            finally:
    882901                dlg.Destroy()
     
    896915                    while item and not Id:
    897916                        name = self.PatternTree.GetItemText(item)
    898                         if 'PWDR' in name or 'SXTL' in name or 'IMG' in name:
     917                        if 'PWDR' in name or 'HKLF' in name or 'IMG' in name:
    899918                            Id = item
    900919                        item, cookie = self.PatternTree.GetNextChild(self.root, cookie)               
     
    904923                dlg.Destroy()
    905924
    906     def OnFileCloseMenu(self, event):
     925    def OnFileClose(self, event):
    907926        if self.dataFrame:
    908927            self.dataFrame.Clear()
     
    917936                self.PatternTree.DeleteChildren(self.root)
    918937                if self.HKL: self.HKL = []
     938                if self.G2plotNB.plotList:
     939                    self.G2plotNB.clear()
    919940        finally:
    920941            dlg.Destroy()
    921942
    922     def OnFileSaveMenu(self, event):
     943    def OnFileSave(self, event):
    923944        if self.GSASprojectfile:
    924945            G2IO.ProjFileSave(self)
    925946        else:
    926             self.OnFileSaveasMenu(event)
    927 
    928     def OnFileSaveasMenu(self, event):
     947            self.OnFileSaveas(event)
     948
     949    def OnFileSaveas(self, event):
    929950        dlg = wx.FileDialog(self, 'Choose GSAS-II project file name', '.', '',
    930951            'GSAS-II project file (*.gpx)|*.gpx',wx.FD_SAVE|wx.FD_OVERWRITE_PROMPT)
     
    942963        sys.exit()
    943964       
    944     def OnFileExitMenu(self, event):
     965    def OnFileExit(self, event):
    945966        if self.dataFrame:
    946967            self.dataFrame.Clear()
     
    11171138            dlg.Destroy()
    11181139
    1119     def OnHelpHelpMenu(self, event):
     1140    def OnHelpHelp(self, event):
    11201141        event.Skip()
    11211142       
    1122     def OnHelpAboutMenu(self, event):
     1143    def OnHelpAbout(self, event):
    11231144        info = wx.AboutDialogInfo()
    11241145        info.Name = 'GSAS-II'
Note: See TracChangeset for help on using the changeset viewer.