void eWidget::invalidate(eRect area, int force) { if ( (!(state & stateVisible)) && (!force)) return; if (area.isNull()) area=eRect(0, 0, size.width(), size.height()); eWidget *w=this; // problem: überlappende, nicht transparente fenster while (force || (((int)w->getBackgroundColor())==-1)) // while (1) { force=0; if (!w->parent) // spaetestens fuers TLW sollte backgroundcolor aber non-transparent sein break; area.moveBy(w->position.x(), w->position.y()); w=w->parent; area.moveBy(w->clientrect.x(), w->clientrect.y()); area&=w->clientrect; } w->redraw(area); }
gPainter::gPainter(gDC &dc, eRect rect): dc(dc), rc(gRC::getInstance()), foregroundColor(0), backgroundColor(0), cornerRound(0) { if (rect.isNull()) rect=eRect(ePoint(0, 0), dc.getSize()); // ASSERT(!gPainter_instances); gPainter_instances++; begin(rect); }
void eWidget::redraw(eRect area) // area bezieht sich nicht auf die clientarea { if (getTLW()->just_showing) return; if (state & stateVisible ) { if (area.isNull()) area=eRect(0, 0, size.width(), size.height()); if (area.width()>0) { gPainter *p=getPainter(area); if (p) { eraseBackground(p, area); redrawWidget(p, area); delete p; } } if(!childlist.empty()) { area.moveBy(-clientrect.x(), -clientrect.y()); // ab hier jetzt schon. ePtrList<eWidget>::iterator It(childlist); while (It != childlist.end()) { eRect cr=area&eRect((*It)->position, (*It)->size); if (!cr.isEmpty()) { cr.moveBy(-It->position.x(), -It->position.y()); It->redraw(cr); } ++It; } } } }