Is it safe to call TWinControl.Update from TGraphicControl.Paint?
I have a TGraphicControl descendent that draws rather slowly. There is also a descendant of TWinControl, which is quickly colored. Both controls are on the same TPanel.
When scrolling, the TGraphicControl is updated more often than the TWinControl, so they appear out of sync. This update is done by Windows and / or VCL, not by my code.
I can work it out by calling TWinControl.Update from the TGraphicControl.Paint method, but I'm a little concerned that this might cause problems anyway.
Is it safe to do this?
a source to share
It is safe if they are not connected. But this is not a very efficient approach.
TGraphic depends on Painting on its parent control, is it also the parent of TWinControl?
You can experiment a bit with:
a) change the TGraphic based control to be TWinControl (TGraphic is not that useful or efficient anyway). That is, if you have a source.
b) Insert a graphic control into a custom (borderless, etc.) TPanel
a source to share