ScintillaNet - detect mouse over

121 views Asked by At

is it possible to react when the mouse is over a word ? Suppose I want to show a bubble with a description of the thing I'm currently hovering. Seems strangely difficult to do.

2

There are 2 answers

2
Filipe On

I think it is possible but might be a little hard.

You have the MouseHover event however you don't know what word you hovered so it might be a little hard.

You can get the mouse localization with this:

Point mouseLocation = new Point(e.X, e.Y)

Then if you use a fixed-width type font you know the size of each line/character then you can calculate it.

Some code that helps with position/line transition:

var line = scintilla.LineFromPosition(startPos);
startPos = scintilla.Lines[line].Position;

scintilla -> Control Name

For a better view try seeing this:

https://github.com/jacobslusser/ScintillaNET/wiki/Custom-Syntax-Highlighting https://github.com/jacobslusser/ScintillaNET/wiki/Basic-Text-Retrieval-and-Modification

Edit: Not really a good answer soo 2nd try

[scintilla name].CurrentPosition -> you can get the word you selected if I'm not mistaken but I don't know if you can do it by hovering.

Then do the interpretation of the word and it might work.

Try reading this: https://github.com/jacobslusser/ScintillaNET/issues/149

0
Filipe On

3rt Try. Let's hope it's the best one.

https://github.com/Ahmad45123/AutoCompleteMenu-ScintillaNET

There is AutoCompleteMenu for Scintilla that has a hover property. I'm not sure how it works but might be what you're searching for.