diff options
| author | Felix Domke <tmbinc@elitedvb.net> | 2004-06-02 01:11:59 +0000 |
|---|---|---|
| committer | Felix Domke <tmbinc@elitedvb.net> | 2004-06-02 01:11:59 +0000 |
| commit | 3bad22d5566624804a73b3791980bab2d84c8266 (patch) | |
| tree | eb99b584b542cdc2ab264d8439ba771a117f0cb2 /lib/gui/emessage.cpp | |
| parent | d6f6602d7cea3a7899990fe79216af7d98d05917 (diff) | |
| download | enigma2-3bad22d5566624804a73b3791980bab2d84c8266.tar.gz enigma2-3bad22d5566624804a73b3791980bab2d84c8266.zip | |
- disabled gui for a moment
- beginning of GDI2 work (region/fill/line works)
- fixed smartptr self assignment
- finally replaced "int ref" by something with a constructor
Diffstat (limited to 'lib/gui/emessage.cpp')
| -rw-r--r-- | lib/gui/emessage.cpp | 163 |
1 files changed, 0 insertions, 163 deletions
diff --git a/lib/gui/emessage.cpp b/lib/gui/emessage.cpp index 388eb14a..e69de29b 100644 --- a/lib/gui/emessage.cpp +++ b/lib/gui/emessage.cpp @@ -1,163 +0,0 @@ -#include <lib/gui/emessage.h> - -#include <lib/gui/elabel.h> -#include <lib/gui/ebutton.h> -#include <lib/gui/eskin.h> -#include <lib/gdi/font.h> -#include <lib/base/i18n.h> - -eMessageBox::eMessageBox(eString message, eString caption, int flags, int def): eWindow(0), icon(0) -{ - setText(caption); - int fontsize=eSkin::getActive()->queryValue("fontsize", 20); - int posx = eSkin::getActive()->queryValue("eMessageBox.pos.x", 100); - int posy = eSkin::getActive()->queryValue("eMessageBox.pos.y", 70); - move(ePoint(posx, posy)); - resize(eSize(450, 430)); - - if ( flags > 15 ) // we have to draw an icon - { - ePtr<gPixmap> pm; - switch ( flags & ~15 ) - { - case iconInfo: - eSkin::getActive()->queryImage(pm, "icon_info" ); - break; - case iconQuestion: - eSkin::getActive()->queryImage(pm, "icon_question" ); - break; - case iconWarning: - eSkin::getActive()->queryImage(pm, "icon_warning" ); - break; - case iconError: - eSkin::getActive()->queryImage(pm, "icon_error" ); - break; - } - if (pm) - { - icon = new eLabel(this); - icon->setPixmap( pm ); - icon->pixmap_position=ePoint(0,0); - icon->resize( eSize(pm->x, pm->y) ); - icon->setBlitFlags( BF_ALPHATEST ); - } - } - - text=new eLabel(this); - text->setText(message); - text->resize( eSize( clientrect.width(), clientrect.height() )); - text->setFlags( RS_WRAP|eLabel::flagVCenter ); - eSize txtSize=text->getExtend(); - txtSize+=eSize(8,4); // the given Size of the Text is okay... but the renderer sucks... - text->resize(txtSize); - - // here the two labels ( icon, text) has the correct size.. now we calc the border - - eSize ext; - - if ( icon ) - { - if ( icon->getSize().height() > text->getSize().height() ) - { - eDebug("icon is higher"); - eSize s = icon->getSize(); - icon->move( ePoint( 20, 20 ) ); - text->move( ePoint( 20 + s.width() + 20, icon->getPosition().y() + s.height() / 2 - txtSize.height() / 2 ) ); - ext.setHeight( icon->getPosition().y() + icon->getSize().height() + 20 ); - } - else - { - eDebug("text is higher"); - text->move( ePoint( 20 + icon->getSize().width() + 20 , 20 ) ); - icon->move( ePoint( 20, text->getPosition().y() + text->getSize().height() / 2 - icon->getSize().height() / 2 ) ); - ext.setHeight( text->getPosition().y() + text->getSize().height() + 20 ); - } - ext.setWidth( text->getPosition().x() + text->getSize().width() + 20 ); - } - else - { - text->move( ePoint(20, 20) ); - ext.setWidth( text->getPosition().x() + text->getSize().width()+20 ); - ext.setHeight( text->getPosition().y() + text->getSize().height() + 20 ); - } - - if (ext.width()<150) - ext.setWidth(150); - - int xpos=20; - - if ( flags & 15) - { - for (int i=btOK; i<btMax; i<<=1) - if (flags & i) - { - eButton *b=new eButton(this); - b->resize(eSize(size.width(), fontsize+4)); - const char *t="", *shortcut=""; - switch (i) - { - case btOK: t=_("OK"); shortcut="green"; CONNECT(b->selected, eMessageBox::pressedOK); break; - case btCancel: t=_("Cancel"); shortcut="red"; CONNECT(b->selected, eMessageBox::pressedCancel); break; - case btYes: t=_("Yes"); shortcut="green"; CONNECT(b->selected, eMessageBox::pressedYes); break; - case btNo: t=_("No"); shortcut="red"; CONNECT(b->selected, eMessageBox::pressedNo); break; - } - b->setProperty("shortcut", shortcut); - b->setText(t); - eSize bSize=b->getExtend(); - bSize.setWidth( bSize.width() * 2 ); - bSize.setHeight( fontsize + 4 + 10 ); - b->resize(bSize); - b->move( ePoint( xpos, ext.height() ) ); - - b->loadDeco(); - - if (def == i) - setFocus(b); - - xpos += bSize.width()+20; - if ( xpos+20 > ext.width() ) - cresize( eSize( xpos+20, ext.height() + bSize.height() + 20 ) ); - else - cresize( eSize( ext.width(), ext.height() + bSize.height() + 20 ) ); - } - } - else - cresize( ext ); - zOrderRaise(); -} - -eMessageBox::~eMessageBox() -{ -} - -void eMessageBox::pressedOK() -{ - if ( in_loop ) - close(btOK); - else - hide(); -} - -void eMessageBox::pressedCancel() -{ - if ( in_loop ) - close(btCancel); - else - hide(); -} - -void eMessageBox::pressedYes() -{ - if ( in_loop ) - close(btYes); - else - hide(); -} - -void eMessageBox::pressedNo() -{ - if ( in_loop ) - close(btNo); - else - hide(); -} |
