Changeset 3952


Ignore:
Timestamp:
May 3, 2019 2:56:06 PM (2 years ago)
Author:
toby
Message:

PickId? set to zero(?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r3951 r3952  
    22252225        PatternId = G2frame.PatternId
    22262226        PickId = G2frame.PickId
    2227         if G2frame.GPXtree.GetItemText(PickId) == 'Peak List':
     2227        if PickId and G2frame.GPXtree.GetItemText(PickId) == 'Peak List':
    22282228            if ind.all() != [0] and ObsLine[0].get_label() in str(pick):    #picked a data point, add a new peak
    22292229                data = G2frame.GPXtree.GetItemPyData(G2frame.PickId)
     
    22432243                G2frame.cid = Page.canvas.mpl_connect('motion_notify_event', OnDragLine)
    22442244                pick.set_linestyle('--') # back to dashed
    2245         elif G2frame.GPXtree.GetItemText(PickId) == 'Limits':
     2245        elif PickId and G2frame.GPXtree.GetItemText(PickId) == 'Limits':
    22462246            if ind.all() != [0]:                                    #picked a data point
    22472247                LimitId = G2gd.GetGPXtreeItemId(G2frame,PatternId, 'Limits')
     
    22762276                pick.set_linestyle('--') # back to dashed
    22772277               
    2278         elif G2frame.GPXtree.GetItemText(PickId) == 'Models':
     2278        elif PickId and G2frame.GPXtree.GetItemText(PickId) == 'Models':
    22792279            if ind.all() != [0]:                                    #picked a data point
    22802280                LimitId = G2gd.GetGPXtreeItemId(G2frame,PatternId, 'Limits')
     
    22882288            else:                                                   #picked a limit line
    22892289                G2frame.itemPicked = pick
    2290         elif (G2frame.GPXtree.GetItemText(PickId) == 'Reflection Lists' or
     2290        elif PickId and (G2frame.GPXtree.GetItemText(PickId) == 'Reflection Lists' or
    22912291                'PWDR' in G2frame.GPXtree.GetItemText(PickId)
    22922292                ):
     
    23252325                G2frame.cid = Page.canvas.mpl_connect('motion_notify_event', OnDragTickmarks)
    23262326           
    2327         elif G2frame.GPXtree.GetItemText(PickId) == 'Background':
     2327        elif PickId and G2frame.GPXtree.GetItemText(PickId) == 'Background':
    23282328            # selected a fixed background point. Can move it or delete it.
    23292329            backPts = G2frame.dataWindow.wxID_BackPts
     
    27352735    Page.bindings = []
    27362736    Page.bindings.append(Page.canvas.mpl_connect('key_press_event', OnPlotKeyPress))
    2737     if 'PWDR' in G2frame.GPXtree.GetItemText(G2frame.PickId):
     2737    if not G2frame.PickId:
     2738        pass
     2739    elif 'PWDR' in G2frame.GPXtree.GetItemText(G2frame.PickId):
    27382740        Histograms,Phases = G2frame.GetUsedHistogramsAndPhasesfromTree()
    27392741        refColors=['b','r','c','g','m','k']
Note: See TracChangeset for help on using the changeset viewer.