tags:

views:

37

answers:

1

I have sub classed a tab control to give it a background. I have used the clipping functions to clip the drawing area to the update region. This works, except for when I move the window of the screen and back again.

When it does this, it occasionally sets the clipping region to the whole screen. This is fine except that none of the controls redraw and end up hidden behind the background. How do I know whether or not to redraw the background when I get this update region. It would be 100x easier to develop this if I saw the source code for the tab control, but that isn't going to happen.

All help or suggestions welcome, but I really do need a straight-forward answer.

+1  A: 

By "clipping region" I assume you mean the area that has to be redrawn that windows passes to you.

Try this: The paint message handler should bitblit the area of the background image that corresponds to the part of the window that needs to be refreshed (so you don't draw over things that don't need updating). Then let the base class handle the rest.

If it's setting the repaint region to the entire window the tab control code should redraw everything after you've painted the background.

Having code to look at would help

Jay
Thanks for the reply. I have managed to solve this problem by myself though.
Alexander Rafferty