Changeset 3279


Ignore:
Timestamp:
Feb 12, 2018 3:45:08 PM (4 years ago)
Author:
toby
Message:

make sure new phases get selected in tree; call critical bits (what exactly is not clear) in UpdateGeneral?

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIdataGUI.py

    r3277 r3279  
    896896            self.GPXtree.Expand(sub)
    897897            self.GPXtree.Expand(psub)
    898             wx.CallAfter(SelectDataTreeItem,self,psub) #bring up new phase General tab
     898            self.PickIdText = None
     899            wx.CallAfter(self.GPXtree.SelectItem,psub) # should call SelectDataTreeItem
     900            #wx.CallAfter(SelectDataTreeItem,self,psub) #bring up new phase General tab
    899901
    900902            if rd.Constraints:
  • trunk/GSASIIphsGUI.py

    r3278 r3279  
    12681268################################################################################
    12691269
    1270     def UpdateGeneral(Scroll=0):
     1270    def UpdateGeneral(Scroll=0,SkipDraw=False):
    12711271        '''Draw the controls for the General phase data subpage
    12721272        '''
     
    12841284        'Atoms':[]
    12851285        'Drawing':{}
    1286         """       
    1287         # UpdateGeneral execution starts here
    1288         if General.GetSizer(): General.GetSizer().Clear(True)
    1289         phaseTypes = ['nuclear','magnetic','macromolecular','faulted']
    1290         SetupGeneral()
    1291         generalData = data['General']
    1292         Map = generalData['Map']
    1293         Flip = generalData['Flip']
    1294         MCSAdata = generalData['MCSA controls'] 
    1295         PWDR = any(['PWDR' in item for item in data['Histograms'].keys()])
    1296         # UpdateGeneral execution continues below
    1297        
     1286        """
    12981287        def NameSizer():   
    12991288           
     
    22322221
    22332222        # UpdateGeneral execution starts here
     2223        phaseTypes = ['nuclear','magnetic','macromolecular','faulted']
     2224        SetupGeneral()
     2225        generalData = data['General']
     2226        Map = generalData['Map']
     2227        Flip = generalData['Flip']
     2228        MCSAdata = generalData['MCSA controls'] 
     2229        PWDR = any(['PWDR' in item for item in data['Histograms'].keys()])
    22342230#patches       
    22352231        if 'Pawley dmax' not in data['General']:
     
    22392235        if 'SGGray' not in data['General']['SGData']:
    22402236            data['General']['SGData']['SGGray'] = False
    2241 #end patches       
     2237#end patches
     2238        if SkipDraw: return
    22422239        if General.GetSizer():
    22432240            General.GetSizer().Clear(True)
     
    89238920        on a Phase data item window
    89248921        '''
    8925         for page in G2frame.phaseDisplay.gridList: # clear out all grids, forcing edits in progress to complete
    8926             page.ClearGrid()
    89278922        page = event.GetSelection()
    89288923        G2frame.phaseDisplay.SetSize(G2frame.dataWindow.GetClientSize())    #TODO -almost right
     
    89308925       
    89318926    def ChangePage(page):
     8927        for p in G2frame.phaseDisplay.gridList: # clear out all grids, forcing edits in progress to complete
     8928            p.ClearGrid()
    89328929        text = G2frame.phaseDisplay.GetPageText(page)
    89338930        G2frame.lastSelectedPhaseTab = text
     
    91929189    if G2frame.lastSelectedPhaseTab in Pages:
    91939190        ind = Pages.index(G2frame.lastSelectedPhaseTab)
    9194         ChangePage(0)
     9191        if ind != 0:
     9192            UpdateGeneral(SkipDraw=True)
    91959193        G2frame.phaseDisplay.SetSelection(ind)
    91969194    else:
Note: See TracChangeset for help on using the changeset viewer.