/**********************************************************************
            --- KDevelop (KDlgEdit)  generated file ---                

            Last generated: Sun Apr 16 18:04:10 2000

            DO NOT EDIT!!!  This file will be automatically
            regenerated by KDevelop.  All changes will be lost.

**********************************************************************/
#include <kapp.h>
#include <qpixmap.h>
#include <qmovie.h>
#include <qpainter.h>
#include "aboutdlg.h"
#include "lskat.h"

void  aboutDlg::initDialog(){
  this->resize(320,290);
  this->setMinimumSize(0,0);
  QGroupBox_1= new QGroupBox(this,"NoName");
  QGroupBox_1->setGeometry(20,10,280,230);
  QGroupBox_1->setMinimumSize(0,0);
  QGroupBox_1->setBackgroundColor(Qt::white);
  QGroupBox_1->setFrameStyle(QFrame::Panel|QFrame::Sunken);
  QGroupBox_1->setLineWidth(3);
  QGroupBox_1->setMidLineWidth(2);

  QLabel_1= new QLabel(QGroupBox_1,"NoName");
  QLabel_1->setGeometry(10,90,260,40);
  QLabel_1->setMinimumSize(0,0);
  QLabel_1->setText(i18n("Mail: martin@heni-online.de"));
  QLabel_1->setBackgroundColor(Qt::white);

  QLabel_7= new QLabel(QGroupBox_1,"NoName");
  QLabel_7->setGeometry(190,10,80,40);
  QLabel_7->setMinimumSize(0,0);
  QLabel_7->setText(i18n("Lieutnant\n   Skat"));
  QLabel_7->setBackgroundColor(Qt::white);

  QLabel_11= new QLabel(QGroupBox_1,"NoName");
  QLabel_11->setGeometry(190,50,80,40);
  QLabel_11->setMinimumSize(0,0);
  QLabel_11->setText(i18n("Version 0.9"));
  QLabel_11->setBackgroundColor(Qt::white);


  QLabel_2= new QMovieLabel(QGroupBox_1,"NoName");
  QLabel_2->setGeometry(10,10,170,70);
  QLabel_2->setMinimumSize(0,0);
  QLabel_2->setEMovie(mMovie);




  

  QLabel_8= new QLabel(QGroupBox_1,"NoName");
  QLabel_8->setGeometry(10,80,200,25);
  QLabel_8->setMinimumSize(0,0);
  QLabel_8->setText(i18n("(c) 2000 by Martin Heni"));
  QLabel_8->setBackgroundColor(Qt::white);

  QLabel_5= new QLabel(QGroupBox_1,"NoName");
  QLabel_5->setGeometry(10,120,260,100);
  QLabel_5->setMinimumSize(0,0);
  QLabel_5->setText(i18n(
  "Gamefeatures:\n"
  "- Multiplayer network game\n"
  "- Up to two Computerplayer\n"
  "\n"
  "Many thanks to Laura for betatesting!\n"));
  QLabel_5->setBackgroundColor(Qt::white);

  QPushButton_1= new QPushButton(this,"NoName");
  QPushButton_1->setGeometry(110,250,100,30);
  QPushButton_1->setMinimumSize(0,0);
  QPushButton_1->setFocus();
  QPushButton_1->setText(i18n("Ok"));

}

QMovieLabel::QMovieLabel(QWidget *parent,const char *name) :
  QLabel(parent,name)
{
  mTimer=0;
  cnt=0;
}
// paint function
void QMovieLabel::Paint(QPainter *p)
{
  if (mMovie->frameArray)
  {
    QRect r=p->window();
    QPixmap pm(mMovie->frameArray[cnt]);
    if (r.size()!=pm.size())
    {
      QWMatrix m;
      m.scale((double)r.width()/(double)pm.width(),
              (double)r.height()/(double)pm.height());
      pm=pm.xForm(m);
    }
    p->drawPixmap(QPoint(0,0),pm);
  }
}

// paint event
void QMovieLabel::paintEvent( QPaintEvent * e)
{
    QPixmap pm(this->rect().size());
    QPainter p;
    QBrush brush(Qt::black);
    p.begin(&pm,this);
    p.fillRect(0,0,this->rect().width(),this->rect().height(),brush);
    Paint(&p);
    p.end();
    bitBlt(this,0,0,&pm);
}
void QMovieLabel::setEMovie(EMovie *movie)
{
  mMovie=movie;
  mTimer=new QTimer(this);
  connect(mTimer,SIGNAL(timeout()),this,SLOT(slotTimer()));
  // mTimer->start(movie->frameDelay,FALSE);
  cnt=0;
}
void QMovieLabel::slotTimer(void)
{
  cnt++;
  if (cnt>=mMovie->frameCnt) cnt=0;
//  printf("Timer %d vis=%d\n",cnt,isVisible());
  if (isVisible()) repaint(false);
  else mTimer->stop();
}
void QMovieLabel::showEvent(QShowEvent *event)
{
  mTimer->start(mMovie->frameDelay,FALSE);
  cnt=0;
}
QMovieLabel::~QMovieLabel()
{
  delete mTimer;
}
