Changeset 166 for trunk/GSASII.py


Ignore:
Timestamp:
Oct 26, 2010 3:09:48 PM (12 years ago)
Author:
vondreele
Message:

fixups of atom editing/atom drawing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r164 r166  
    11#GSASII
    22
     3import os
    34import os.path as ospath
    45import sys
     
    214215        self.PatternTree.Bind(wx.EVT_TREE_ITEM_EXPANDED,
    215216            self.OnPatternTreeItemExpanded, id=wxID_PATTERNTREE)
    216         self.root = self.PatternTree.AddRoot("Loaded Data")
     217        self.root = self.PatternTree.AddRoot('Loaded Data: ')
    217218       
    218219        plotFrame = wx.Frame(None,-1,'GSASII Plots',size=wx.Size(700,600), \
     
    228229        self.GSASprojectfile = ''
    229230        self.dirname = ''
     231        self.undofile = ''
    230232        self.Offset = 0.0
    231233        self.Weight = False
     
    918920                    self.dirname = dlg.GetDirectory()
    919921                    G2IO.ProjFileOpen(self)
     922                    self.PatternTree.SetItemText(self.root,'Loaded Data: '+self.GSASprojectfile)
    920923                    self.PatternTree.Expand(self.root)
    921924                    self.HKL = []
     
    942945            if result != wx.ID_CANCEL:
    943946                self.GSASprojectfile = ''
     947                self.PatternTree.SetItemText(self.root,'Loaded Data: ')
    944948                self.PatternTree.DeleteChildren(self.root)
    945949                if self.HKL: self.HKL = []
     
    951955    def OnFileSave(self, event):
    952956        if self.GSASprojectfile:
     957            self.PatternTree.SetItemText(self.root,'Loaded Data: '+self.GSASprojectfile)
    953958            G2IO.ProjFileSave(self)
    954959        else:
     
    963968            if dlg.ShowModal() == wx.ID_OK:
    964969                self.GSASprojectfile = dlg.GetPath()
     970                self.PatternTree.SetItemText(self.root,'Loaded Data: '+self.GSASprojectfile)
    965971                G2IO.ProjFileSave(self)
    966972                self.dirname = dlg.GetDirectory()
     
    969975
    970976    def ExitMain(self, event):
     977        if self.undofile:
     978            os.remove(self.undofile)
    971979        sys.exit()
    972980       
     
    11171125    def DoUnDo(self):
    11181126        print 'Undo last refinement'
    1119         file = open('GSASII.save','rb')
     1127        file = open(self.undofile,'rb')
    11201128        PatternId = self.PatternId
    11211129        for item in ['Background','Instrument Parameters','Peak List']:
     
    11321140       
    11331141    def SaveState(self):
    1134         file = open('GSASII.save','wb')
     1142        self.undofile = self.dirname+'\\GSASII.save'
     1143        file = open(self.undofile,'wb')
    11351144        PatternId = self.PatternId
    11361145        for item in ['Background','Instrument Parameters','Peak List']:
Note: See TracChangeset for help on using the changeset viewer.