-/* eDebug("decoStr = %s, text=%s, name=%s, %p left = %d, top = %d, width=%d, height = %d", strDeco?strDeco.c_str():"no", text?text.c_str():"no" , name?name.c_str():"no", this, this->getPosition().x(), this->getPosition().y(), this->getSize().width(), this->getSize().height() );
- eDebug("renderContext left = %d, top = %d, width = %d, height = %d", rc.left(), rc.top(), rc.width(), rc.height() );*/
-
- target->clip( gRegion(rc) );
- eRect area=eRect(ePoint(0, 0), ePoint(width(), height()));
-/* eDebug("area left = %d, top = %d, width = %d, height = %d",
- area.left(), area.top(),
- area.width(), area.height() );*/
-
- if (deco_selected && have_focus)
- {
- deco_selected.drawDecoration(target, ePoint(width(), height()));
- area=crect_selected;
- } else if (deco)
- {
- deco.drawDecoration(target, ePoint(width(), height()));
- area=crect;
- }
-/* eDebug("area left = %d, top = %d, width = %d, height = %d",
- area.left(), area.top(),
- area.width(), area.height() );*/
-
- if (shortcutPixmap)
- {
- //area.setWidth(area.width()-area.height());
- area.setX(area.height());
- }
-
- if (text.length())
- {
- if ( area.size().height() < size.height() ||
- area.size().width() < size.width() )
- {
- // then deco is drawed
- eSize s=area.size();
- validate( &s );
- } else
- validate();
-
- if (flags & flagVCenter)
- yOffs = ( (area.height() - para->getBoundBox().height() ) / 2 + 0) - para->getBoundBox().top();
- else
- yOffs = 0;
-
- eWidget *w;
- if ((blitFlags & BF_ALPHATEST) && (transparentBackgroundColor >= 0))
- {
- w=this;
- target->setBackgroundColor(transparentBackgroundColor);
- } else
- {
- w=getNonTransparentBackground();
- target->setBackgroundColor(w->getBackgroundColor());
- }
- target->setFont(font);
- target->renderPara(para, ePoint( area.left(), area.top()+yOffs) );
- }
- if (pixmap)
- {
-// eDebug("blit pixmap area left=%d, top=%d, right=%d, bottom=%d", rc.left(), rc.top(), rc.right(), rc.bottom() );
-// eDebug("pixmap_pos x = %d, y = %d, xsize=%d, ysize=%d", pixmap_position.x(), pixmap_position.y(), pixmap->x, pixmap->y );
- target->blit(pixmap, shortcutPixmap?pixmap_position+ePoint( area.left(), 0):pixmap_position, area, (blitFlags & BF_ALPHATEST) ? gPixmap::blitAlphaTest : 0);
- }
- if (shortcutPixmap)
- target->blit(shortcutPixmap,
- ePoint((area.height()-shortcutPixmap->getSize().width())/2, area.top()+(area.height()-shortcutPixmap->getSize().height())/2),
- eRect(),
- gPixmap::blitAlphaTest);
- target->clippop();
-}
-
-int eLabel::eventHandler(const eWidgetEvent &event)
-{
- switch (event.type)
- {
- case eWidgetEvent::changedFont:
- case eWidgetEvent::changedText:
- if (para)
- {
- para->destroy();
- para=0;
- }
- if ( have_focus && deco_selected )
- eDecoWidget::invalidate( crect_selected );
- else if ( deco )
- eDecoWidget::invalidate( crect );
- else
- eDecoWidget::invalidate();
- break;
-
- case eWidgetEvent::changedSize:
- invalidate();
- break;
-
- default:
- return eDecoWidget::eventHandler(event);
- break;
- }
- return 1;