Changeset 2537


Ignore:
Timestamp:
Nov 19, 2016 10:12:46 PM (5 years ago)
Author:
toby
Message:

bind only needed on PWDR tree item

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIplot.py

    r2536 r2537  
    17971797    Phases = G2frame.PatternTree.GetItemPyData(G2gd.GetPatternTreeItemId(G2frame,G2frame.PatternId,'Reflection Lists'))
    17981798    Page.phaseList = sorted(Phases.keys()) # define an order for phases (once!)
    1799     G2frame.dataFrame.Bind(wx.EVT_MENU, onMoveDiffCurve, id=G2frame.dataFrame.moveDiffCurve.GetId())
    1800     G2frame.dataFrame.Bind(wx.EVT_MENU, onMoveTopTick, id=G2frame.dataFrame.moveTickLoc.GetId())
    1801     G2frame.dataFrame.Bind(wx.EVT_MENU, onMoveTickSpace, id=G2frame.dataFrame.moveTickSpc.GetId())
    1802     if len(Page.phaseList) == 0:
    1803         G2frame.dataFrame.moveTickLoc.Enable(False)
    1804         G2frame.dataFrame.moveTickSpc.Enable(False)
    1805     elif len(Page.phaseList) == 1:
    1806         G2frame.dataFrame.moveTickLoc.Enable(True)
    1807         G2frame.dataFrame.moveTickSpc.Enable(False)
    1808     else:
    1809         G2frame.dataFrame.moveTickLoc.Enable(True)
    1810         G2frame.dataFrame.moveTickSpc.Enable(True)
    1811    
     1799    if 'PWDR' in G2frame.PatternTree.GetItemText(G2frame.PickId):
     1800        G2frame.dataFrame.Bind(wx.EVT_MENU, onMoveDiffCurve, id=G2frame.dataFrame.moveDiffCurve.GetId())
     1801        G2frame.dataFrame.Bind(wx.EVT_MENU, onMoveTopTick, id=G2frame.dataFrame.moveTickLoc.GetId())
     1802        G2frame.dataFrame.Bind(wx.EVT_MENU, onMoveTickSpace, id=G2frame.dataFrame.moveTickSpc.GetId())
     1803        if len(Page.phaseList) == 0:
     1804            G2frame.dataFrame.moveTickLoc.Enable(False)
     1805            G2frame.dataFrame.moveTickSpc.Enable(False)
     1806        elif len(Page.phaseList) == 1:
     1807            G2frame.dataFrame.moveTickLoc.Enable(True)
     1808            G2frame.dataFrame.moveTickSpc.Enable(False)
     1809        else:
     1810            G2frame.dataFrame.moveTickLoc.Enable(True)
     1811            G2frame.dataFrame.moveTickSpc.Enable(True)
    18121812    # save information needed to reload from tree and redraw
    18131813    kwargs={'PatternName':G2frame.PatternTree.GetItemText(G2frame.PatternId)}
Note: See TracChangeset for help on using the changeset viewer.