mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-10 09:59:17 +02:00
Modifications to the smart hints in the editor window.
Shane git-svn-id: trunk@464 -
This commit is contained in:
parent
3cbe0ff3ae
commit
ad29c3550f
@ -1403,27 +1403,35 @@ begin
|
|||||||
if XLine > Length(EditorLine) then Exit;
|
if XLine > Length(EditorLine) then Exit;
|
||||||
|
|
||||||
//walk backwards to a space or non-standard character.
|
//walk backwards to a space or non-standard character.
|
||||||
while (((ord(upcase(EditorLine[XLine])) >= 65)
|
while (
|
||||||
and (ord(upcase(EditorLine[xLine])) <= 90)) or
|
(upcase(EditorLine[XLine]) in (['A'..'Z'])) or
|
||||||
((ord(EditorLine[XLine]) >= ord('1'))
|
(upcase(EditorLine[XLine]) in (['0'..'9']))
|
||||||
and (ord(EditorLine[XLine]) <= ord('0')))) and (XLine>1) do
|
) and
|
||||||
|
(XLine>1) do
|
||||||
dec(xLine);
|
dec(xLine);
|
||||||
|
|
||||||
if ( (XLine > 1) and (XLine < Length(EditorLine))) then Inc(xLine);
|
if ( (XLine > 1) and (XLine < Length(EditorLine))) then Inc(xLine);
|
||||||
|
|
||||||
Texts := Copy(EditorLine,XLine,length(EditorLine)); //chop off the beginning
|
Texts := Copy(EditorLine,XLine,length(EditorLine)); //chop off the beginning
|
||||||
|
|
||||||
XLine := 1;
|
XLine := 1;
|
||||||
while (((ord(upcase(Texts[xLine])) >= 65) and (ord(upcase(Texts[xLine])) <= 90))
|
|
||||||
or ((ord(EditorLine[XLine]) >= ord('1'))
|
while (
|
||||||
and (ord(EditorLine[XLine]) <= ord('0'))))
|
(upcase(Texts[XLine]) in (['A'..'Z'])) or
|
||||||
and (XLine< length(Texts)) do
|
(upcase(Texts[XLine]) in (['0'..'9']))
|
||||||
inc(xLine);
|
) and
|
||||||
|
(XLine< Length(Texts)) do
|
||||||
|
|
||||||
|
inc(xLine);
|
||||||
|
|
||||||
if (XLine < Length(Texts) ) and (XLine >1) then dec(xLine);
|
if (XLine < Length(Texts) ) and (XLine >1) then dec(xLine);
|
||||||
|
|
||||||
if not((((ord(upcase(Texts[xLine])) >= 65) and (ord(upcase(Texts[xLine])) <= 90)))
|
if not(
|
||||||
or ((ord(EditorLine[XLine]) >= ord('1'))
|
(upcase(Texts[XLine]) in (['A'..'Z'])) or
|
||||||
and (ord(EditorLine[XLine]) <= ord('0')))) then
|
(upcase(Texts[XLine]) in (['0'..'9']))
|
||||||
|
) then
|
||||||
dec(xLine);
|
dec(xLine);
|
||||||
|
|
||||||
Texts := Copy(Texts,1,XLine);
|
Texts := Copy(Texts,1,XLine);
|
||||||
|
|
||||||
Result := Texts;
|
Result := Texts;
|
||||||
@ -1588,9 +1596,9 @@ begin
|
|||||||
FHintWindow := THintWindow.Create(nil);
|
FHintWindow := THintWindow.Create(nil);
|
||||||
|
|
||||||
FHIntWindow.Visible := False;
|
FHIntWindow.Visible := False;
|
||||||
FHintWindow.Caption := 'This is a hint window'#13#10'NEat huh?';
|
FHintWindow.Caption := '';
|
||||||
FHintWindow.HideInterval := 4000;
|
FHintWindow.HideInterval := 4000;
|
||||||
FHintWindow.AutoHide := True;
|
FHintWindow.AutoHide := False;
|
||||||
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2887,9 +2895,17 @@ begin
|
|||||||
TextPosition.Y := cPosition.Y - 28;
|
TextPosition.Y := cPosition.Y - 28;
|
||||||
AHint := SE.GetWordAtPosition(TextPosition);
|
AHint := SE.GetWordAtPosition(TextPosition);
|
||||||
|
|
||||||
|
//defaults for now just to demonstrate
|
||||||
|
if lowercase(AHint) = 'integer' then
|
||||||
|
AHint := 'type System.integer: -2147483648..214748347 system.pas'
|
||||||
|
else
|
||||||
|
if lowercase(AHint) = 'real' then
|
||||||
|
AHint := 'type System.Real: Double -system.pas';
|
||||||
|
|
||||||
|
|
||||||
if AHint = '' then Exit;
|
if AHint = '' then Exit;
|
||||||
|
|
||||||
Writeln('cPosition ius ',cPosition.x,',',cPosition.y);
|
// Writeln('cPosition ius ',cPosition.x,',',cPosition.y);
|
||||||
Rect := FHintWindow.CalcHintRect(0,AHint,nil); //no maxwidth
|
Rect := FHintWindow.CalcHintRect(0,AHint,nil); //no maxwidth
|
||||||
// Position := ClientToScreen(FLastMouseMovePos);
|
// Position := ClientToScreen(FLastMouseMovePos);
|
||||||
Rect.Left := cPosition.X+Left+10;
|
Rect.Left := cPosition.X+Left+10;
|
||||||
|
Loading…
Reference in New Issue
Block a user