Sign in Join

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

Mailing lists / lazarus / 2020-05

Repainting of TWinControl children

4 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Martin Grajcar

In a large project I found out that after on resizing of the form, some components get properly resized but don't receive an Invalidate call. I guess, it's caused by the test in lcl/include/control.inc

  if not ((csLoading in ComponentState) or (Self is TWinControl)) then
    InvalidateControl(IsControlVisible, False, true);

Our component extends TCustomControl, so it doesn't get invalidated. I guess, such components are supposed to use a different mechanism, but I can't see how? Can someone point me to the right doc. -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200504/c2ca71a6/attachment.html>

Reply by email

Martin Frb
to Vojtěch Čihák
Vojtěch Čihák wrote 7 lines
AFAIK with TCustomControl you obtain just Resize and then Paint. Paint is preceded by WMPaint. You should move your code to one of these methods.

Probably done by the OS.

Example
https://docs.microsoft.com/en-gb/windows/win32/api/winuser/nf-winuser-movewindow?redirectedfrom=MSDN If called to change the size and called with bRepaint then invalidation is taken care of.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20200506/1a86212d/attachment.html>

Reply by email

gabor
to Martin Grajcar: In a large project I found out that after on resizing of the form, some components get…

W dniu 2020-05-04 o 17:33, Martin Grajcar via lazarus pisze:

Show quoted text 6 lines
  if not ((csLoading in ComponentState) or (Self is TWinControl)) then     InvalidateControl(IsControlVisible, False, true); Our component extends TCustomControl, so it doesn't get invalidated. I guess, such components are supposed to use a different mechanism, but I can't see how? Can someone point me to the right doc.

The TCustomControl class inherits from TWinControl class so problem must be somewhere else.

Michał.

Reply by email