Changeset 1215 for SHX


Ignore:
Timestamp:
22.02.2017 16:27:15 (3 years ago)
Author:
klaus
Message:

text drag test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/SeismicHandler/modules/wx_.py

    r1191 r1215  
    9191        self.SetBackgroundColour( "white" ) 
    9292        self.clearWindow() 
     93        tdt = ShxTextDropTarget(self) 
     94        self.SetDropTarget(tdt) 
    9395     
    9496    def OnPaint( self, e ): 
     
    33713373                _sendShCommand( shcmd ) 
    33723374 
     3375class ShxTextDropTarget(wx.TextDropTarget): 
     3376    "React on drag and drop actions into the main drawing window." 
     3377    def __init__(self, window): 
     3378        wx.TextDropTarget.__init__(self) 
     3379        self.window = window 
     3380 
     3381    def OnDropText(self, x, y, data): 
     3382        print "dbg: text '%s' dropped at (%d,%d):\n" % (data, x, y) 
     3383        trace, timestamp = plotter.canvas.ScreenToTraceAndTime( x, y ) 
     3384        if trace == None: 
     3385            set_runtime( "dragdrop_trace", None ) 
     3386        else: 
     3387            set_runtime( "dragdrop_trace", trace.index(True) ) 
     3388        set_runtime( "dragdrop_time", timestamp ) 
     3389 
    33733390 
    33743391def _absToRelTime( trc, abstime ): 
Note: See TracChangeset for help on using the changeset viewer.