I'm probably silly to want to do this, but here's what I want to do: When the user clicks once in my text output (in a StyledTextCtrl), I want to select the whole sentence containing the click point (I've got all the code for that), and do stuff with the selected data. If the user double-clicks, I want to reduce the selection to the single word containing the click point (default behavior for a double-click in text).
The __init__ for my subclass for the STC contains these lines:
self.Bind(wx.EVT_LEFT_DOWN, self.OnMouseDown)
self.Bind(wx.EVT_LEFT_DCLICK, self.OnDoubleClick)
In my def OnMouseDown, I have to end with a Skip() or OnDoubleClick won't get called. Unfortunately, when I include the Skip(), the code on OnMouseDown that selects the whole sentence becomes useless; on a single click, the sentence is selected but then the selection is immediately cleared.
Also, the "automatic" select-a-single-word behavior doesn't happen with a double click, no matter whether my OnDoubleClick handler contains a Skip() or not. So there's something I'm not understanding.
Trust me, it makes sense in this app, from a user's point of view . . . Clues to what I'm doing wrong?
Charles Hartman