unit xMemo; interface Uses classes, StdCtrls, MMTimer; type tMemo=class(StdCtrls.tMemo) private prInvalidated:boolean; prTimer:tMMTimer; prCurCounter:word; prDelayMultiplicator:word; procedure DoInvalidate(Sender:tObject); procedure SetDelayMultiplicator(n:word); public constructor Create(Owner:tComponent); override; destructor Destroy; override; procedure Invalidate; override; property Timer:tMMTimer read prTimer; // Увеличение интервала перерисовки в указанное число раз property DelayMultiplicator:word read prDelayMultiplicator write SetDelayMultiplicator; end; implementation constructor tMemo.Create(Owner:tComponent); begin inherited; prTimer:=tMMTimer.Create; prTimer.Interval:=133; prTimer.Resolution:=100; prTimer.TimerType:=ttPeriodic; prTimer.OnTimer:=DoInvalidate; prTimer.Enabled:=TRUE; end; destructor tMemo.Destroy; begin prTimer.Free; inherited; end; procedure tMemo.Invalidate; begin prInvalidated:=TRUE; end; procedure tMemo.DoInvalidate(Sender:tObject); begin if prCurCounter>0 then begin Dec(prCurCounter); end else if prInvalidated then begin Inherited Invalidate; prInvalidated:=FALSE; prCurCounter:=prDelayMultiplicator; end; end; procedure tMemo.SetDelayMultiplicator(n:word); begin prDelayMultiplicator:=n; if prCurCounter>n then begin prCurCounter:=n; end; end; end.