6
votes

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.

2
I haven't used XE2 yet, but I assume there must be something like "scene|object.refresh|redraw"user497849
TControl.Realign fits more because most of the time there is no direct drawing in FMX controls, as they are made of primitive. If you call Realign, primitives will be redrawnaz01

2 Answers

2
votes
Control.InvalidateRect(RectF(0,0,width,height));
2
votes

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.