Hi, Sergey!
Please help, how can I detect that caret at the end of line?
Little description: then I click right mouse button at empty space of RVE, caret position itself at end of clicked line, so GetCurrentWord return last word of it, but I want to return empty string. I think that detecting EOL will be enough)
Or may be there is another solution for my problem: I want to get item tag at click point, if no tag then word at click?
Thank you!
Caret at end of line
-
- Site Admin
- Posts: 17559
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Re: Caret at end of line
If you want to check if the specified (X,Y) position is inside some item, you can use GetItemAt() method with the parameter Strict = True.
If the specified position is outside any item, the method returns False.
Then you can get GetWordAt to get a word at the specified coordinates.
Please note that
- GetWords's input parameters (X,Y) are client coordinates (you can use parameters of OnMouseMove/Up/Down).
- GetItemAt's input parameters (X,Y) are document coordinates. Client coordinates can be converted to document coordinates using ClientToDocument method.
If the specified position is outside any item, the method returns False.
Then you can get GetWordAt to get a word at the specified coordinates.
Please note that
- GetWords's input parameters (X,Y) are client coordinates (you can use parameters of OnMouseMove/Up/Down).
- GetItemAt's input parameters (X,Y) are document coordinates. Client coordinates can be converted to document coordinates using ClientToDocument method.