Changeset 2879


Ignore:
Timestamp:
Jun 26, 2017 5:04:06 PM (4 years ago)
Author:
toby
Message:

Seq. Ref.: fix tickmarks on plot; single click on hist in table plots it

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIgrid.py

    r2876 r2879  
    29682968        plotName = plotSpCharFix(plotName)
    29692969        return plotName,G2frame.colList[col],G2frame.colSigs[col]
    2970            
    2971     def PlotSelect(event):
    2972         'Plots a row (covariance) or column on double-click'
     2970
     2971    def PlotSelectedColRow(calltyp=''):
     2972        '''Called to plot a selected column or row. This is called after the event is processed
     2973        so that the column or row gets selected.
     2974        Single click on row: plots histogram
     2975        Double click on row: plots V-C matrix
     2976        Single or double click on column: plots values in column
     2977        '''
    29732978        cols = G2frame.dataDisplay.GetSelectedCols()
    29742979        rows = G2frame.dataDisplay.GetSelectedRows()
    29752980        if cols:
    29762981            G2plt.PlotSelectedSequence(G2frame,cols,GetColumnInfo,SelectXaxis)
     2982        elif rows and calltyp == 'single':
     2983            name = histNames[rows[0]]       #only does 1st one selected
     2984            if not name.startswith('PWDR'): return
     2985            pickId = G2frame.PickId
     2986            G2frame.PickId = G2frame.PatternId = GetPatternTreeItemId(G2frame, G2frame.root, name)
     2987            G2plt.PlotPatterns(G2frame,newPlot=True,plotType='PWDR')
     2988            G2frame.PickId = pickId
    29772989        elif rows:
    29782990            name = histNames[rows[0]]       #only does 1st one selected
     
    29832995                'Nothing selected in table. Click on column or row label(s) to plot. N.B. Grid selection can be a bit funky.'
    29842996                )
     2997       
     2998    def PlotSSelect(event):
     2999        'Called by a single click on a row or column label. '
     3000        event.Skip()
     3001        wx.CallAfter(PlotSelectedColRow,'single')
     3002       
     3003    def PlotSelect(event):
     3004        'Called by a double-click on a row or column label'
     3005        event.Skip()
     3006        wx.CallAfter(PlotSelectedColRow,'double')
    29853007           
    29863008    def OnPlotSelSeq(event):
     
    41094131        for r in range(nRows):
    41104132            G2frame.dataDisplay.SetCellReadOnly(r,c)
     4133    G2frame.dataDisplay.Bind(wg.EVT_GRID_LABEL_LEFT_CLICK, PlotSSelect)
    41114134    G2frame.dataDisplay.Bind(wg.EVT_GRID_LABEL_LEFT_DCLICK, PlotSelect)
    41124135    G2frame.dataDisplay.Bind(wg.EVT_GRID_LABEL_RIGHT_CLICK, SetLabelString)
  • trunk/GSASIIplot.py

    r2878 r2879  
    11881188    :func:`PlotPatterns`
    11891189    '''
    1190     if not histogram.startswith('PWDR'): return
    1191     G2frame.PatternId = G2gd.GetPatternTreeItemId(G2frame, G2frame.root, histogram)
     1190    if not histogram.startswith('PWDR'): return
     1191    pickId = G2frame.PickId
     1192    G2frame.PickId = G2frame.PatternId = G2gd.GetPatternTreeItemId(G2frame, G2frame.root, histogram)
    11921193    treedata = G2frame.PatternTree.GetItemPyData(G2frame.PatternId)
    11931194    PlotPatterns(G2frame,newPlot=True,plotType='PWDR',data=[treedata[0],refdata])
    11941195    wx.Yield() # force a plot update (needed on Windows?)
    1195 
     1196    G2frame.PickId = pickId
     1197   
    11961198def ReplotPattern(G2frame,newPlot,plotType,PatternName=None,PickName=None):
    11971199    '''This does the same as PlotPatterns except that it expects the information
Note: See TracChangeset for help on using the changeset viewer.