verify that we're not painting on hidden window (which is not implemented)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41040 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík 2006-09-07 11:14:52 +00:00
parent 6a613ad625
commit 17dd5538ef

View File

@ -51,6 +51,23 @@ void wxWindowDC::InitForWin(wxWindow *win)
{
wxCHECK_RET( win, _T("invalid window") );
// FIXME: this should be made to work: we need to detect that the window
// is not visible and in that case, a) ignore any drawing actions
// and b) provide dummy surface that can still be used to get
// information (e.g. text extents):
wxWindow *w = win;
for ( wxWindow *w = win; w; w = w->GetParent() )
{
// painting on hidden TLW when non-TLW windows are shown is OK,
// DirectFB manages that:
if ( w->IsTopLevel() )
break;
wxASSERT_MSG( w->IsShown(),
_T("painting on hidden window not implemented yet") );
}
SetFont(win->GetFont());
}
@ -87,6 +104,9 @@ wxClientDC::~wxClientDC()
{
// flip to surface so that the changes become visible
wxIDirectFBSurfacePtr surface(GetDirectFBSurface());
// FIXME: do this only if the surface was modified (as opposed to e.g.
// used only to obtain text metrics)
if ( surface )
surface->Flip(NULL, DSFLIP_NONE);
}