Changeset 456 for trunk/GSASII.py


Ignore:
Timestamp:
Jan 24, 2012 2:31:27 PM (10 years ago)
Author:
toby
Message:

determine path to GSAS files from file; trap & reset focus for tree traversal with arrow keys; move wxinspector to after app creation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASII.py

    r453 r456  
    3636
    3737#wx inspector - use as needed
    38 #wxeye.InspectionTool().Show()
     38wxInspector = False
    3939
    4040# print versions
     
    324324            item = event.GetItem()
    325325            G2gd.MovePatternTreeToGrid(self,item)
     326            if self.oldFocus:
     327                self.oldFocus.SetFocus()
    326328       
    327329    def OnPatternTreeItemCollapsed(self, event):
     
    340342        key = event.GetKeyCode()
    341343        item = self.PickId
     344        if type(item) is int: return # is this the toplevel in tree?
    342345        if key == wx.WXK_UP:
    343             self.oldFocus = self.mainPanel
     346            self.oldFocus = wx.Window.FindFocus()
    344347            next = self.PatternTree.GetPrevSibling(item)
     348            if next.IsOk(): # test if there is a previous item
     349                self.PatternTree.SelectItem(next)
    345350        elif key == wx.WXK_DOWN:
    346             self.oldFocus = self.mainPanel
    347             self.PatternTree.SelectItem(item)
     351            self.oldFocus = wx.Window.FindFocus()
     352            next = self.PatternTree.GetNextSibling(item)
     353            if next.IsOk(): # test if there is a next item
     354                self.PatternTree.SelectItem(next)
    348355               
    349356    def OnPwdrRead(self, event):
     
    16171624def main():
    16181625    application = GSASIImain(0)
     1626    if wxInspector: wxeye.InspectionTool().Show()
     1627
    16191628    #application.main.OnRefine(None)
    16201629    application.MainLoop()
Note: See TracChangeset for help on using the changeset viewer.