if ( parent )
parent->AddChild(this);
+ // set the size to something bogus initially, in case some code tries to
+ // create wxWindowDC before SetSize() is called below:
+ m_rect.width = m_rect.height = 1;
+
int x, y, w, h;
x = pos.x, y = pos.y;
if ( x == -1 ) x = 0;
void wxWindowDFB::PaintWindow(const wxRect& rect, bool eraseBackground)
{
- if ( IsFrozen() )
- return; // don't paint anything if the window is frozen
+ wxCHECK_RET( !IsFrozen() && IsShown(), _T("shouldn't be called") );
wxLogTrace(TRACE_PAINT,
- _T("%p ('%s'): paiting region [x=%i,y=%i,w=%i,h=%i]"),
+ _T("%p ('%s'): painting region [x=%i,y=%i,w=%i,h=%i]"),
this, GetName().c_str(),
rect.x, rect.y, rect.width, rect.height);
{
wxWindow *child = *i;
+ if ( child->IsFrozen() || !child->IsShown() )
+ continue; // don't paint anything if the window is frozen or hidden
+
// compute child's area to repaint
wxRect childrect(child->GetRect());
childrect.Offset(origin);