Changeset 2850


Ignore:
Timestamp:
Jun 1, 2017 10:53:13 PM (4 years ago)
Author:
toby
Message:

fix arrow key data tree traversal on Mac

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r2843 r2850  
    26992699                self.G2plotNB.nb.GetPage(pltNum)
    27002700            item = event.GetItem()
    2701             wx.CallAfter(G2gd.SelectDataTreeItem,self,item)
    2702             if self.oldFocus: # Why do this?
    2703                 wx.CallAfter(self.oldFocus.SetFocus)
     2701            wx.CallAfter(G2gd.SelectDataTreeItem,self,item,self.oldFocus)
     2702            #if self.oldFocus: # Why do this?
     2703            #    wx.CallAfter(self.oldFocus.SetFocus)
    27042704       
    27052705    def OnPatternTreeItemCollapsed(self, event):
     
    27742774                    wx.CallAfter(self.PatternTree.SelectItem,item)
    27752775            else:   
    2776                 self.PatternTree.GetPrevSibling(item)
    2777                 self.PatternTree.SelectItem(item)
     2776                item = self.PatternTree.GetPrevSibling(item)
     2777                if item.IsOk(): self.PatternTree.SelectItem(item)
    27782778        elif key == wx.WXK_DOWN:
    27792779            if keyevt.GetModifiers() == wx.MOD_SHIFT and parent != self.root:
     
    27882788                    wx.CallAfter(self.PatternTree.SelectItem,item)
    27892789            else:   
    2790                 self.PatternTree.GetNextSibling(item)
    2791                 self.PatternTree.SelectItem(item)
     2790                item = self.PatternTree.GetNextSibling(item)
     2791                if item.IsOk(): self.PatternTree.SelectItem(item)
    27922792               
    27932793    def OnReadPowderPeaks(self,event):
  • trunk/GSASIIgrid.py

    r2846 r2850  
    45104510    return 0               
    45114511
    4512 def SelectDataTreeItem(G2frame,item):
     4512def SelectDataTreeItem(G2frame,item,oldFocus=None):
    45134513    '''Called from :meth:`GSASII.GSASII.OnDataTreeSelChanged` when a item is selected on the tree.
    45144514    Also called from GSASII.OnPatternTreeEndDrag, OnAddPhase -- might be better to select item, triggering
     
    45584558       
    45594559    SetDataMenuBar(G2frame)
    4560     G2frame.dataFrame.Raise()           
    45614560    G2frame.dataFrame.currentGrids = [] # this will contain pointers to a grid placed in the frame
    45624561    G2frame.PickId = item
     
    45704569        wx.TextCtrl(parent=G2frame.dataFrame,size=G2frame.dataFrame.GetClientSize(),
    45714570                    value='Select an item from the tree to see/edit parameters')       
     4571        G2frame.dataFrame.Raise()           
    45724572        return
    45734573    else:
     
    48324832        G2frame.PickIdText = G2frame.GetTreeItemsList(G2frame.PickId)
    48334833    G2frame.dataFrame.Raise()
    4834 
     4834    if oldFocus:
     4835        oldFocus.GetTopLevelParent().Raise()
     4836        oldFocus.SetFocus()
     4837       
    48354838def SetDataMenuBar(G2frame,menu=None):
    48364839    '''Set the menu for the data frame. On the Mac put this
Note: See TracChangeset for help on using the changeset viewer.