Changeset 1822 for trunk/GSASII.py


Ignore:
Timestamp:
Apr 30, 2015 11:27:28 AM (7 years ago)
Author:
vondreele
Message:

selections on tree now update properly
Refine now returns to whatever tree item was selected & which phase tab was selected

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r1821 r1822  
    21822182        if GSASIIpath.GetConfigValue('Import_directory'):
    21832183            self.ImportDir = GSASIIpath.GetConfigValue('Import_directory')
     2184           
     2185    def GetTreeItemsList(self,item):
     2186        return self.PatternTree._getTreeItemsList(item)
    21842187
    21852188    def OnSize(self,event):
     
    24022405                        self.PatternTree.SetItemPyData(Id,[Npix,imagefile])
    24032406                        self.PickId = Id
    2404                         self.PickIdText = self.PatternTree.GetItemText(self.PickId)
     2407                        self.PickIdText = self.GetTreeItemsList(self.PickId)
    24052408                        self.Image = Id
    24062409                os.chdir(dlg.GetDirectory())           # to get Mac/Linux to change directory!               
     
    34973500                             '\nRefinement not possible')
    34983501            return
    3499         #works - but it'd be better if it could restore plots
    35003502        dlg = wx.ProgressDialog('Residual','All data Rw =',101.0,
    35013503            style = wx.PD_ELAPSED_TIME|wx.PD_AUTO_HIDE|wx.PD_CAN_ABORT,
     
    35073509        Rw = 100.00
    35083510        oldId =  self.PatternTree.GetSelection()        #retain current selection
     3511        oldPath = self.GetTreeItemsList(oldId)
    35093512        parentName = ''
    35103513        oldName = self.PatternTree.GetItemText(oldId)
     
    35123515        if parentId:
    35133516            parentName = self.PatternTree.GetItemText(parentId)     #find the current data tree name
     3517            if 'Phases' in parentName:
     3518                tabId = self.dataDisplay.GetSelection()
    35143519        try:
    35153520            OK,Msg = G2stMn.Refine(self.GSASprojectfile,dlg)
     
    35453550                            itemId = G2gd.GetPatternTreeItemId(self, self.root, oldName)
    35463551                        self.PatternTree.SelectItem(itemId)
     3552                    if 'Phases' in parentName:
     3553                        self.dataDisplay.SetSelection(tabId)
    35473554            finally:
    35483555                dlg2.Destroy()
Note: See TracChangeset for help on using the changeset viewer.