Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does the Delphi 2010 TRibbon control "flicker" on Windows XP, but not Vista/7?

alt text

I've noticed that when I use TRibbon control that comes with Delphi 2010, it works flawlessly on my Windows 7 system. However, the application has some weird painting issues on a Windows XP system with the "classic theme" (I haven't tried the playschool theme).

I know there are other Ribbon components available from DevExpress and TMS Software, however purchasing a 3rd party control is not an option for this project.

Has anyone had this issue, or know of a solution?

like image 901
Mick Avatar asked Oct 14 '22 23:10

Mick


1 Answers

Most likely because Windows 7 uses "Desktop Compositing", which essentially means that a component is drawn to an off-screen bitmap and then copied onto the display. In XP, a component typically draws directly onto the display (which can cause flicker if the component first erases what's there and draws over the "clean slate").

Delphi supports double-buffering, which accomplishes the same thing. If you set the ribbon's DoubleBuffered property to True (in code, since it's not published) then that should avoid the flicker (at the cost of extra memory allocated and moved around when drawing)--I should say, however, that I haven't actually tried it with TRibbon.

Note that there is no additional overhead when running on Windows 7 (or Vista, for that matter) if you set DoubleBuffered to True. The VCL has code the skips the off-screen bitmap business when running on a version of Windows that does desktop compositing.

like image 177
davidmw Avatar answered Oct 18 '22 09:10

davidmw