mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-09 19:16:12 +02:00
IDE: using TIdleTimer for editor hint timer, bug #14382
git-svn-id: trunk@21309 -
This commit is contained in:
parent
5522d6012c
commit
00ee0b8f3b
@ -578,7 +578,7 @@ type
|
|||||||
States: TSourceNotebookStates;
|
States: TSourceNotebookStates;
|
||||||
// hintwindow stuff
|
// hintwindow stuff
|
||||||
FHintWindow: THintWindow;
|
FHintWindow: THintWindow;
|
||||||
FHintTimer: TTimer;
|
FHintTimer: TIdleTimer;
|
||||||
|
|
||||||
|
|
||||||
function CreateNotebook: Boolean;
|
function CreateNotebook: Boolean;
|
||||||
@ -3408,11 +3408,12 @@ begin
|
|||||||
BuildPopupMenu;
|
BuildPopupMenu;
|
||||||
|
|
||||||
// HintTimer
|
// HintTimer
|
||||||
FHintTimer := TTimer.Create(Self);
|
FHintTimer := TIdleTimer.Create(Self);
|
||||||
with FHintTimer do begin
|
with FHintTimer do begin
|
||||||
Name:=Self.Name+'_HintTimer';
|
Name:=Self.Name+'_HintTimer';
|
||||||
Interval := EditorOpts.AutoDelayInMSec;
|
Interval := EditorOpts.AutoDelayInMSec;
|
||||||
Enabled := False;
|
Enabled := False;
|
||||||
|
AutoEnabled := False;
|
||||||
OnTimer := @HintTimer;
|
OnTimer := @HintTimer;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -5512,7 +5513,12 @@ procedure TSourceNotebook.HideHint;
|
|||||||
begin
|
begin
|
||||||
//DebugLn(['TSourceNotebook.HideHint ']);
|
//DebugLn(['TSourceNotebook.HideHint ']);
|
||||||
if FHintTimer<>nil then
|
if FHintTimer<>nil then
|
||||||
|
begin
|
||||||
|
FHintTimer.AutoEnabled := (EditorOpts.AutoToolTipSymbTools or
|
||||||
|
EditorOpts.AutoToolTipExprEval)
|
||||||
|
and Visible;
|
||||||
FHintTimer.Enabled:=false;
|
FHintTimer.Enabled:=false;
|
||||||
|
end;
|
||||||
if SourceCompletionTimer<>nil then
|
if SourceCompletionTimer<>nil then
|
||||||
SourceCompletionTimer.Enabled:=false;
|
SourceCompletionTimer.Enabled:=false;
|
||||||
if FHintWindow<>nil then
|
if FHintWindow<>nil then
|
||||||
@ -6645,23 +6651,14 @@ end;
|
|||||||
Procedure TSourceNotebook.EditorMouseMove(Sender: TObject; Shift: TShiftstate;
|
Procedure TSourceNotebook.EditorMouseMove(Sender: TObject; Shift: TShiftstate;
|
||||||
X,Y: Integer);
|
X,Y: Integer);
|
||||||
begin
|
begin
|
||||||
// restart hint timer
|
HideHint;
|
||||||
//DebugLn(['TSourceNotebook.EditorMouseMove ']);
|
|
||||||
FHintTimer.Enabled := False;
|
|
||||||
FHintTimer.Enabled := (EditorOpts.AutoToolTipSymbTools or
|
|
||||||
EditorOpts.AutoToolTipExprEval)
|
|
||||||
and Visible;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceNotebook.EditorMouseWheel(Sender: TObject; Shift: TShiftState;
|
procedure TSourceNotebook.EditorMouseWheel(Sender: TObject; Shift: TShiftState;
|
||||||
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
|
WheelDelta: Integer; MousePos: TPoint; var Handled: Boolean);
|
||||||
begin
|
begin
|
||||||
// restart hint timer
|
|
||||||
//DebugLn(['TSourceNotebook.EditorMouseWheel ']);
|
|
||||||
HideHint;
|
HideHint;
|
||||||
FHintTimer.Enabled := (EditorOpts.AutoToolTipSymbTools or
|
//handled:=true; //The scrolling is not done: it's not handled! See TWinControl.DoMouseWheel
|
||||||
EditorOpts.AutoToolTipExprEval) and Visible;
|
|
||||||
//handled:=true; //The scrooling is not done: it's not handled! See TWinControl.DoMouseWheel
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TSourceNotebook.EditorMouseDown(Sender: TObject;
|
procedure TSourceNotebook.EditorMouseDown(Sender: TObject;
|
||||||
@ -6693,6 +6690,7 @@ var
|
|||||||
begin
|
begin
|
||||||
//DebugLn(['TSourceNotebook.HintTimer ']);
|
//DebugLn(['TSourceNotebook.HintTimer ']);
|
||||||
FHintTimer.Enabled := False;
|
FHintTimer.Enabled := False;
|
||||||
|
FHintTimer.AutoEnabled := False;
|
||||||
MousePos := Mouse.CursorPos;
|
MousePos := Mouse.CursorPos;
|
||||||
AControl:=FindLCLControl(MousePos);
|
AControl:=FindLCLControl(MousePos);
|
||||||
if (AControl=nil) or (GetParentForm(AControl)<>Self) then exit;
|
if (AControl=nil) or (GetParentForm(AControl)<>Self) then exit;
|
||||||
|
Loading…
Reference in New Issue
Block a user