[lazarus] HintTimer rewritten....

Jarto Tarpio jarto at starsoft.fi
Fri Dec 14 11:05:22 EST 2001


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 FHintCounter<>2 then exit;
3045,3046d3045
<   FHintTimer.Enabled := False;
<
3102c3101
<   FHintTimer.Enabled := False;
---
>   FHintCounter:=0;






More information about the Lazarus mailing list