mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-01 23:00:27 +02:00
limited position of source editor completion box
git-svn-id: trunk@8587 -
This commit is contained in:
parent
248fa55c77
commit
21d1e7c016
@ -41,9 +41,9 @@ uses
|
|||||||
{$IFDEF IDE_MEM_CHECK}
|
{$IFDEF IDE_MEM_CHECK}
|
||||||
MemCheck,
|
MemCheck,
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
Classes, SysUtils, Controls, LCLProc, LCLType, LResources, LCLIntf, FileUtil,
|
Classes, SysUtils, Math, Controls, LCLProc, LCLType, LResources, LCLIntf,
|
||||||
Forms, Buttons, ComCtrls, Dialogs, StdCtrls, GraphType, Graphics, TypInfo,
|
FileUtil, Forms, Buttons, ComCtrls, Dialogs, StdCtrls, GraphType, Graphics,
|
||||||
Extctrls, Menus,
|
TypInfo, Extctrls, Menus,
|
||||||
// codetools
|
// codetools
|
||||||
CodeToolManager, CodeCache, SourceLog,
|
CodeToolManager, CodeCache, SourceLog,
|
||||||
// synedit
|
// synedit
|
||||||
@ -1257,9 +1257,11 @@ Begin
|
|||||||
dec(i);
|
dec(i);
|
||||||
TextS2 := Trim(copy(TextS, i + 1, FEditor.CaretX - i - 1));
|
TextS2 := Trim(copy(TextS, i + 1, FEditor.CaretX - i - 1));
|
||||||
end;
|
end;
|
||||||
with TCustomSynEdit(Sender) do
|
with TCustomSynEdit(Sender) do begin
|
||||||
P := ClientToScreen(Point(CaretXPix - length(TextS2)*CharWidth
|
P := Point(CaretXPix - length(TextS2)*CharWidth,CaretYPix + LineHeight);
|
||||||
,CaretYPix + LineHeight));
|
P.X:=Max(0,Min(P.X,ClientWidth-aCompletion.Width));
|
||||||
|
P := ClientToScreen(p);
|
||||||
|
end;
|
||||||
aCompletion.Editor:=TCustomSynEdit(Sender);
|
aCompletion.Editor:=TCustomSynEdit(Sender);
|
||||||
aCompletion.Execute(TextS2,P.X,P.Y);
|
aCompletion.Execute(TextS2,P.X,P.Y);
|
||||||
end;
|
end;
|
||||||
@ -2042,9 +2044,11 @@ begin
|
|||||||
dec(i);
|
dec(i);
|
||||||
TextS2 := Trim(copy(TextS, i + 1, LogCaret.X - i - 1));
|
TextS2 := Trim(copy(TextS, i + 1, LogCaret.X - i - 1));
|
||||||
end;
|
end;
|
||||||
with FEditor do
|
with FEditor do begin
|
||||||
P := ClientToScreen(Point(CaretXPix - length(TextS2)*CharWidth
|
P := Point(CaretXPix - length(TextS2)*CharWidth,CaretYPix + LineHeight);
|
||||||
,CaretYPix + LineHeight));
|
P.X:=Max(0,Min(P.X,ClientWidth-aCompletion.Width));
|
||||||
|
P := ClientToScreen(p);
|
||||||
|
end;
|
||||||
aCompletion.Editor:=FEditor;
|
aCompletion.Editor:=FEditor;
|
||||||
aCompletion.Execute(TextS2,P.X,P.Y);
|
aCompletion.Execute(TextS2,P.X,P.Y);
|
||||||
end;
|
end;
|
||||||
@ -2869,8 +2873,11 @@ begin
|
|||||||
//writeln('TSourceNotebook.OnCodeTemplateTokenNotFound ',AToken,',',AnEditor.ReadOnly,',',CurrentCompletionType=ctNone);
|
//writeln('TSourceNotebook.OnCodeTemplateTokenNotFound ',AToken,',',AnEditor.ReadOnly,',',CurrentCompletionType=ctNone);
|
||||||
if (AnEditor.ReadOnly=false) and (CurrentCompletionType=ctNone) then begin
|
if (AnEditor.ReadOnly=false) and (CurrentCompletionType=ctNone) then begin
|
||||||
CurrentCompletionType:=ctTemplateCompletion;
|
CurrentCompletionType:=ctTemplateCompletion;
|
||||||
with AnEditor do
|
with AnEditor do begin
|
||||||
P := ClientToScreen(Point(CaretXPix,CaretYPix+LineHeight));
|
P := Point(CaretXPix - length(AToken)*CharWidth,CaretYPix + LineHeight);
|
||||||
|
P.X:=Max(0,Min(P.X,ClientWidth-aCompletion.Width));
|
||||||
|
P := ClientToScreen(p);
|
||||||
|
end;
|
||||||
aCompletion.Editor:=AnEditor;
|
aCompletion.Editor:=AnEditor;
|
||||||
aCompletion.Execute(AToken,P.X,P.Y);
|
aCompletion.Execute(AToken,P.X,P.Y);
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user