Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Do FireMonkey controls have an equivalent to the VCL Invalidate() method?

I'm creating some custom FireMonkey GUI controls. The components need to update in response to user interactions. VCL controls can call Invalidate() to be placed into a queue for repainting. Does FireMonkey have an equivalent method?

FireMonkey controls have a Repaint() method, but AFAICT that forces the control to be repainted immediately. A queue type system would be more appropriate in some circumstances.

like image 333
Shannon Matthews Avatar asked Dec 07 '11 03:12

Shannon Matthews


2 Answers

Control.InvalidateRect(RectF(0,0,width,height));
like image 106
relativ Avatar answered Oct 26 '22 23:10

relativ


FireMonkey's TControl.Repaint ends up calling TPlatformWin.ReleaseWindow. If Form.Transparency is false then this method calls the Windows InvalidateRect function, just like VCL's TControl.Invalidate does.

So Repaint actually does the same thing VCL's Invalidate does, unless Form.Transparency=true.

like image 42
Giel Avatar answered Oct 26 '22 23:10

Giel