Changeset 456


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

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

    r411 r456  
    3535    ElS = El.upper()
    3636    ElS = ElS.rjust(2)
    37     filename = os.path.join(os.path.split(sys.argv[0])[0],'atmdata.dat')
     37    filename = os.path.join(os.path.split(__file__)[0],'atmdata.dat')
    3838    try:
    3939        FFdata = open(filename,'Ur')
     
    8585    else:
    8686        ElS = El.upper()[:1].rjust(2)
    87     filename = os.path.join(os.path.split(sys.argv[0])[0],'atmdata.dat')
     87    filename = os.path.join(os.path.split(__file__)[0],'atmdata.dat')
    8888    try:
    8989        FFdata = open(filename,'Ur')
     
    147147    ElS = El.upper()
    148148    ElS = ElS.ljust(2)
    149     filename = os.path.join(os.path.split(sys.argv[0])[0],'Xsect.dat')
     149    filename = os.path.join(os.path.split(__file__)[0],'Xsect.dat')
    150150    try:
    151151        xsec = open(filename,'Ur')
     
    222222    ElS = El.upper()
    223223    ElS = ElS.rjust(2)
    224     filename = os.path.join(os.path.split(sys.argv[0])[0],'atmdata.dat')
     224    filename = os.path.join(os.path.split(__file__)[0],'atmdata.dat')
    225225    try:
    226226        FFdata = open(filename,'Ur')
  • trunk/GSASIIplot.py

    r453 r456  
    164164        POSITION_OF_CONFIGURE_SUBPLOTS_BTN = 6
    165165        self.DeleteToolByPos(POSITION_OF_CONFIGURE_SUBPLOTS_BTN)
    166         help = os.path.join(os.path.split(sys.argv[0])[0],'help.ico')
     166        help = os.path.join(os.path.split(__file__)[0],'help.ico')
    167167        self.AddSimpleTool(self.ON_MPL_HELP,_load_bitmap(help),'Help on','Show help on')
    168168        wx.EVT_TOOL(self,self.ON_MPL_HELP,self.OnHelp)
     
    747747        Page.canvas.draw()
    748748    self.Pwdr = True
    749     if self.oldFocus:
    750         self.SetFocus()
    751749   
    752750def PlotISFG(self,newPlot=False,type=''):
Note: See TracChangeset for help on using the changeset viewer.