Changeset 1822


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

Location:
trunk
Files:
2 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()
  • trunk/GSASIIgrid.py

    r1820 r1822  
    37533753    '''Called from GSASII.OnPatternTreeSelChanged when a item is selected on the tree
    37543754    '''
    3755 #    if G2frame.PickId:
    3756 #        print G2frame.PatternTree.GetItemText(G2frame.PickId)
    3757 #        parent = G2frame.PatternTree.GetItemParent(G2frame.PickId)
    3758 #        if parent:
    3759 #            print G2frame.PatternTree.GetItemText(parent)
    37603755    pickName = G2frame.PatternTree.GetItemText(item)
    37613756    if G2frame.PickIdText == pickName:
     
    40374032
    40384033    if G2frame.PickId:
    4039         G2frame.PickIdText = G2frame.PatternTree.GetItemText(G2frame.PickId)
     4034        G2frame.PickIdText = G2frame.GetTreeItemsList(G2frame.PickId)
    40404035    G2frame.dataFrame.Raise()
    40414036
Note: See TracChangeset for help on using the changeset viewer.