//
// Qt Example Application: Conway's game of life
//
// Definition of life dialog class.
//

#ifndef LIFEDLG_H
#define LIFEDLG_H

#include <qtimer.h>
#include <qpushbt.h>
#include <qlabel.h>
#include <qscrbar.h>
#include <qcombo.h>

#include "life.h"


class LifeTimer : public QTimer
{
    Q_OBJECT
public:
    LifeTimer( QWidget *parent );
    enum { MAXSPEED = 1000 };

public slots:
    void	setSpeed( int speed );
    void	pause( bool );

private:
    int		interval;
};


class LifeDialog : public QWidget
{
    Q_OBJECT
public:
    LifeDialog( QWidget *parent = 0, const char *name = 0 );
public slots:
    void	getPattern( int );

protected:
    virtual void resizeEvent( QResizeEvent * e );

private:
    enum { TOPBORDER = 70, SIDEBORDER = 10 };

    LifeWidget	*life;
    QPushButton *qb;
    LifeTimer	*timer;
    QPushButton *pb;
    QComboBox	*cb;
    QLabel	*sp;
    QScrollBar	*scroll;
};


#endif // LIFEDLG_H
