theide: Ctrl+Click onto symbol jumps to definition

git-svn-id: svn://ultimatepp.org/upp/trunk@1189 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-05-15 18:48:42 +00:00
parent 9c2cc3a794
commit c07c50dca7
5 changed files with 34 additions and 8 deletions

View file

@ -549,13 +549,18 @@ bool CodeEditor::GetWordPos(int pos, int& l, int& h) {
return true;
}
String CodeEditor::GetWord()
String CodeEditor::GetWord(int pos)
{
int l, h;
GetWordPos(cursor, l, h);
GetWordPos(pos, l, h);
return Get(l, h - l);
}
String CodeEditor::GetWord()
{
return GetWord(cursor);
}
void CodeEditor::LeftDouble(Point p, dword keyflags) {
int l, h;
int pos = GetMousePos(p);
@ -566,6 +571,10 @@ void CodeEditor::LeftDouble(Point p, dword keyflags) {
}
void CodeEditor::LeftDown(Point p, dword keyflags) {
if((keyflags & K_CTRL) && WhenCtrlClick) {
WhenCtrlClick(GetMousePos(p));
return;
}
LineEdit::LeftDown(p, keyflags);
WhenLeftDown();
}
@ -612,6 +621,8 @@ void CodeEditor::MouseMove(Point p, dword f) {
Image CodeEditor::CursorImage(Point p, dword keyflags)
{
if(WhenCtrlClick && (keyflags & K_CTRL))
return Image::Hand();
if(tip.IsOpen())
return Image::Arrow();
return LineEdit::CursorImage(p, keyflags);

View file

@ -393,6 +393,7 @@ public:
Callback WhenSelection;
Gate1<MouseTip&> WhenTip;
Callback WhenLeftDown;
Callback1<int> WhenCtrlClick;
Callback WhenAnnotationMove;
Callback WhenAnnotationClick;
Callback WhenAnnotationRightClick;
@ -445,6 +446,7 @@ public:
void MoveNextBrk(bool sel);
void MovePrevBrk(bool sel);
String GetWord(int pos);
String GetWord();
bool GetWordPos(int pos, int& l, int& h);