[Lazarus] WMPaint

ListMember listmember at letterboxes.org
Sun Apr 30 18:16:06 CEST 2017


Just curious:

What use is altering a local variable (i.e. FControlState) when you are 
calling an inherited code?

I mean, shouldn't you alter ControlState (I am assuming it exist in the 
'inherited')?

On 2017-04-30 19:06, Alexey via Lazarus wrote:
> procedure TCustomControl.WMPaint(var Message: TLMPaint);
> begin
>   if (csDestroying in ComponentState) or (not HandleAllocated) then exit;
>   Include(FControlState, csCustomPaint);
>   inherited WMPaint(Message);
>   Exclude(FControlState, csCustomPaint);
> end;
>
> Maybe use try-finally here for Exclude?
>
>



More information about the Lazarus mailing list