calltips in scintilla
-
in my program i'm creating an scintilla based editor... i can display the calltips... but if anyone knows the logic of displaying the variables types in calltips such that... if i keep mouse on a variable 'i' which is an integer...,in calltip it should show "int i"... how to implement this?any help thanx n advance...
-
in my program i'm creating an scintilla based editor... i can display the calltips... but if anyone knows the logic of displaying the variables types in calltips such that... if i keep mouse on a variable 'i' which is an integer...,in calltip it should show "int i"... how to implement this?any help thanx n advance...
Simple tooltip[^] Advanced Tooltip[^] To know how plot it you have to know what the mouse is pointing! To do this you can plot the text storing the border of any useful word displayed and test if the mouse position is on it (if yes then plot the tooltip). nother way is create a custom class that display a single word of the text, it can bes mouse sensitive and you can display its tooltip (if needed).
Russell
-
Simple tooltip[^] Advanced Tooltip[^] To know how plot it you have to know what the mouse is pointing! To do this you can plot the text storing the border of any useful word displayed and test if the mouse position is on it (if yes then plot the tooltip). nother way is create a custom class that display a single word of the text, it can bes mouse sensitive and you can display its tooltip (if needed).
Russell
i didn't understand clearly the meaning of "plot the text storing the border of any useful word "...that is how to store the border of text...first how 'll get the text over which the mouse is pointing... since i'm totally confused cud u explain me somewhat eloborately if possible with an example code of 4 or 5 lines.... thanx 4 ur reply...
-
i didn't understand clearly the meaning of "plot the text storing the border of any useful word "...that is how to store the border of text...first how 'll get the text over which the mouse is pointing... since i'm totally confused cud u explain me somewhat eloborately if possible with an example code of 4 or 5 lines.... thanx 4 ur reply...
When you draw the text on your DC you can use
CDC::GetTextExtent(...)
/CDC::GetOutputTextExtent(...)
to know the size of the label [heigh and width]. :-D Of course, to do this you have to draw yourself the text on the screen, so you have to create a derived class of CView. In this way it will be very simple also to color the words with different colors: I think that this can be useful to your project.:rolleyes:
Russell
-
When you draw the text on your DC you can use
CDC::GetTextExtent(...)
/CDC::GetOutputTextExtent(...)
to know the size of the label [heigh and width]. :-D Of course, to do this you have to draw yourself the text on the screen, so you have to create a derived class of CView. In this way it will be very simple also to color the words with different colors: I think that this can be useful to your project.:rolleyes:
Russell
_Russell_ wrote:
color the words with different colors
Probally 2 useful articles: http://www.codeproject.com/editctrl/crysedit.asp[^] http://www.codeproject.com/editctrl/scintillawnd.asp[^] :)
Russell
-
When you draw the text on your DC you can use
CDC::GetTextExtent(...)
/CDC::GetOutputTextExtent(...)
to know the size of the label [heigh and width]. :-D Of course, to do this you have to draw yourself the text on the screen, so you have to create a derived class of CView. In this way it will be very simple also to color the words with different colors: I think that this can be useful to your project.:rolleyes:
Russell
i think i didn't explain u my problem in a correct way... the 2 functions u have given returns the height and width of the string... but my question is how will i get the string over which mouse is thr... that is if u keep the mouse over a variable name "var name" which is of integer type my tooltip should show "int var name".:(( i think i've explained u clearly now... thanx 4 ur reply ...:laugh:
-
i think i didn't explain u my problem in a correct way... the 2 functions u have given returns the height and width of the string... but my question is how will i get the string over which mouse is thr... that is if u keep the mouse over a variable name "var name" which is of integer type my tooltip should show "int var name".:(( i think i've explained u clearly now... thanx 4 ur reply ...:laugh:
:doh: I think that I understand your ploblem. 1) Plot the data storing somewhere (in a member of the Plot-class) the position and size of the single words 2) Get the mouse position and then, if it is inside one of the region that you store at the step 1, create the tooltip and display addictional information. To know the mouse position (x,y) use
CWnd::OnMouseMove(UINT nFlags, CPoint **point**);
Is it enough clear?:confused: Do you need other information about something?:)
Russell