Changeset 2879 for trunk/GSASIIgrid.py


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

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

File:
1 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)
Note: See TracChangeset for help on using the changeset viewer.