Changeset 2607 for trunk/GSASII.py


Ignore:
Timestamp:
Jan 1, 2017 5:08:04 PM (5 years ago)
Author:
toby
Message:

redo help to use DataFrame? helpKey; define .dataFrame.helpKey; rename MovePatternTreeToGrid? to SelectDataTreeItem? & OnPatternTreeSelChanged? to OnDataTreeSelChanged? to make more sense; key on initial string in data tree names, not presence of 'IMG' etc anywhere in name; cleanup Prefill of menus

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r2596 r2607  
    659659            self.PatternTree.Expand(psub)
    660660            self.PatternTree.SelectItem(psub) # show the page to complete the initialization (yuk!)
    661             wx.Yield() # make sure call of GSASII.OnPatternTreeSelChanged happens before we go on
     661            wx.Yield() # make sure call of GSASII.OnDataTreeSelChanged happens before we go on
    662662
    663663            if rd.Constraints:
     
    23212321        self.PatternTree = G2G.G2TreeCtrl(id=wxID_PATTERNTREE,
    23222322            parent=self.mainPanel, pos=wx.Point(0, 0),style=wx.TR_DEFAULT_STYLE )
    2323         self.PatternTree.Bind(wx.EVT_TREE_SEL_CHANGED,self.OnPatternTreeSelChanged)
    2324         self.PatternTree.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK,self.OnPatternTreeSelChanged)
     2323        self.PatternTree.Bind(wx.EVT_TREE_SEL_CHANGED,self.OnDataTreeSelChanged)
     2324        self.PatternTree.Bind(wx.EVT_TREE_ITEM_RIGHT_CLICK,self.OnDataTreeSelChanged)
    23252325        self.PatternTree.Bind(wx.EVT_TREE_ITEM_COLLAPSED,
    23262326            self.OnPatternTreeItemCollapsed, id=wxID_PATTERNTREE)
     
    23392339        plotFrame = wx.Frame(None,-1,'GSASII Plots',size=wx.Size(700,600), \
    23402340            style=wx.DEFAULT_FRAME_STYLE ^ wx.CLOSE_BOX)
    2341         #self.G2plotNB = G2plt.G2PlotNoteBook(plotFrame)
    23422341        self.G2plotNB = G2plt.G2PlotNoteBook(plotFrame,G2frame=self)
    23432342        plotFrame.Show()
     
    24562455        self.PatternTree.SetSize(wx.Size(w,h))
    24572456                       
    2458     def OnPatternTreeSelChanged(self, event):
     2457    def OnDataTreeSelChanged(self, event):
    24592458        '''Called when a data tree item is selected'''
    24602459        if self.TreeItemDelete:
     
    24652464                self.G2plotNB.nb.GetPage(pltNum)
    24662465            item = event.GetItem()
    2467             G2gd.MovePatternTreeToGrid(self,item)
     2466            G2gd.SelectDataTreeItem(self,item)
    24682467            if self.oldFocus:
    24692468                self.oldFocus.SetFocus()
     
    24752474    def OnPatternTreeItemExpanded(self, event):
    24762475        'Called when a tree item is expanded'
    2477         self.OnPatternTreeSelChanged(event)
     2476        self.OnDataTreeSelChanged(event)
    24782477        event.Skip()
    24792478       
     
    25162515                self.PatternTree.SetItemPyData(Id,item)
    25172516            self.PatternTree.Delete(self.BeginDragId)
    2518             G2gd.MovePatternTreeToGrid(self,NewId)
     2517            G2gd.SelectDataTreeItem(self,NewId)
    25192518       
    25202519    def OnPatternTreeKeyDown(self,event): #doesn't exactly work right with Shift key down
     
    30133012        E,SGData = G2spc.SpcGroup('P 1')
    30143013        self.PatternTree.SetItemPyData(sub,G2IO.SetNewPhase(Name=PhaseName,SGData=SGData))
    3015         G2gd.MovePatternTreeToGrid(self,sub) #bring up new phase General tab
     3014        G2gd.SelectDataTreeItem(self,sub) #bring up new phase General tab
    30163015       
    30173016    def OnDeletePhase(self,event):
     
    32383237                    self.EnableSeqRefineMenu()
    32393238            item, cookie = self.PatternTree.GetNextChild(self.root, cookie)
     3239        if phaseId: # show all phases
     3240            self.PatternTree.Expand(phaseId)
    32403241        if Id:
    32413242            self.EnablePlot = True
     
    32443245        elif phaseId:
    32453246            self.PatternTree.SelectItem(phaseId)
    3246         if phaseId:
    3247             self.PatternTree.Expand(phaseId)
    32483247        self.CheckNotebook()
    32493248        if self.dirname: os.chdir(self.dirname)           # to get Mac/Linux to change directory!
     
    39023901            self.PickId = Id
    39033902            self.PatternTree.SelectItem(Id)
    3904             #G2gd.MovePatternTreeToGrid(self,Id) # fails on Mac -- SelectItem already calls MovePatternTreeToGrid; double call fails to complete properly
    39053903        # update other self-updating plots
    39063904        for lbl,frame in zip(self.G2plotNB.plotList,self.G2plotNB.panelList):
     
    39693967                    Id = G2gd.GetPatternTreeItemId(self,self.root,'Sequential results')
    39703968                    self.PatternTree.SelectItem(Id)
    3971                     #G2gd.MovePatternTreeToGrid(self,Id) # fails on Mac -- SelectItem already calls MovePatternTreeToGrid; double call fails to complete properly
    39723969            finally:
    39733970                dlg.Destroy()
Note: See TracChangeset for help on using the changeset viewer.