In my app under Mac OS 10.3 I'm using a StyledTextCtrl. A double-click appears to do what a user expects: selects a whole word of text. But the GetSelection (etc) methods of the STC return a single position, start and end the same (therefore zero-length text), a position within the word wherever the double-click occurred. I'm getting this in a function bound to wx.EVT_LEFT_DCLICK and _RIGHT_DCLICK (I don't care which button it is).
Is there any way -- in STC or in wx -- to get the same information that appears on the screen, the start and end points of the visible on-screen selection? Is there a better EVT to bind to? (Is ...DCLICK issued before the selection gets fully made?) I can't find a message that says SELECTION_MADE, which would save me having to do all this again for click-drag-release.
Being new to all this, I bet I'm missing something straightforward.
Charles Hartman
Charles Hartman writes:
In my app under Mac OS 10.3 I'm using a StyledTextCtrl.
Cool. How is the performance of it on Mac?
A
double-click appears to do what a user expects: selects a
whole word of text. But the GetSelection (etc) methods of the
STC return a single position, start and end the same
Do you mean that GetSelectionStart() and GetSelectionEnd()
return the same value?
(therefore zero-length text), a position within the word
wherever the double-click occurred. I'm getting this in a
function bound to wx.EVT_LEFT_DCLICK and _RIGHT_DCLICK (I
don't care which button it is).
Ok, actually, I see the same result as you when binding to
EVT_LEFT_DCLICK. However, I found in the doc another event:
stc.EVT_SCT_DOUBLECLICK, and when I bind to that,
GetSelectionStart() and GetSelectionEnd() return the correct
values.
Is there any way -- in STC or in wx -- to get the same
information that appears on the screen, the start and end
points of the visible on-screen selection? Is there a better
EVT to bind to? (Is ...DCLICK issued before the selection
gets fully made?) I can't find a message that says
SELECTION_MADE, which would save me having to do all this
again for click-drag-release.
Being new to all this, I bet I'm missing something
straightforward.
I'm new to this as well. It is all hunt and peck. However, the
doc at yellowbrain is very complete (and how I found the
EVT_STC_DOUBLECLICK:
http://www.yellowbrain.com/stc/index.html
ยทยทยท
--
Paul McNett
Independent Software Consultant
http://www.paulmcnett.com