Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2001-12

HintTimer rewritten....

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Jarto Tarpio

Here's another implementation of the hinttimer which doesn't switch the hinttimer on/off all the time. I'm using a FHintCounter instead.

The FHintCounter is increased by one during every call to TSourceNotebook.HintTimer. When that hits 2, a hint is shown. The counter is resetted to 0 at EditorMouseMove and to 3 during a KeyDown. The enabling was also moved away from mousemove to TSourceNotebook.ReloadEditorOptions

Works just fine here for me.

/jarto

cvs -z3 diff uniteditor.pp
Index: uniteditor.pp
=================================================
==================
RCS file: /FPC/CVS/projects/lazarus/uniteditor.pp,v retrieving revision 1.115
diff -r1.115 uniteditor.pp
287a288

FHintCounter: Cardinal;
1656,1657c1657
<   FHintTimer.Interval := 500;
<   FHintTimer.Enabled := False;
---
FHintTimer.Interval := 300;

1658a1659

FHintCounter:=0;

1666d1666
<
2991a2992

FHintTimer.Enabled := EditorOpts.AutoToolTipSymbTools;

3002c3003
< FHintTimer.Enabled := False;
---

FHintCounter:=3;
3024,3027c3025,3026
<   FHintTimer.Enabled := False;
<   FHintTimer.Enabled := EditorOpts.AutoToolTipSymbTools
<          and (not ((ssLeft in Shift) or (ssRight in Shift)
<                                      or (ssMiddle in Shift)));
---
if ((ssLeft in Shift) or (ssRight in Shift) or (ssMiddle in Shift)) then FHintCounter:=3 else FHintCounter:=0;

3042a3042,3043

if FHintCounter<3 then inc(FHintCounter); if FHintCounter2 then exit;

3045,3046d3045
< FHintTimer.Enabled := False;
<
3102c3101
< FHintTimer.Enabled := False;
---

FHintCounter:=0;

Reply by email