home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / qt3_emx.zip / examples / life / lifedlg.h < prev    next >
C/C++ Source or Header  |  2001-10-11  |  1KB  |  66 lines

  1. /****************************************************************************
  2. ** $Id:  qt/lifedlg.h   3.0.0   edited Jun 22 13:24 $
  3. **
  4. ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
  5. **
  6. ** This file is part of an example program for Qt.  This example
  7. ** program may be used, distributed and modified without limitation.
  8. **
  9. *****************************************************************************/
  10.  
  11. #ifndef LIFEDLG_H
  12. #define LIFEDLG_H
  13.  
  14. #include <qtimer.h>
  15. #include <qwidget.h>
  16.  
  17. class QSlider;
  18. class QPushButton;
  19. class QLabel;
  20. class QComboBox;
  21.  
  22. #include "life.h"
  23.  
  24.  
  25. class LifeTimer : public QTimer
  26. {
  27.     Q_OBJECT
  28. public:
  29.     LifeTimer( QWidget *parent );
  30.     enum { MAXSPEED = 1000 };
  31.  
  32. public slots:
  33.     void    setSpeed( int speed );
  34.     void    pause( bool );
  35.  
  36. private:
  37.     int        interval;
  38. };
  39.  
  40.  
  41. class LifeDialog : public QWidget
  42. {
  43.     Q_OBJECT
  44. public:
  45.     LifeDialog( int scale = 10, QWidget *parent = 0, const char *name = 0 );
  46. public slots:
  47.     void    getPattern( int );
  48.  
  49. protected:
  50.     virtual void resizeEvent( QResizeEvent * e );
  51.  
  52. private:
  53.     enum { TOPBORDER = 70, SIDEBORDER = 10 };
  54.  
  55.     LifeWidget    *life;
  56.     QPushButton *qb;
  57.     LifeTimer    *timer;
  58.     QPushButton *pb;
  59.     QComboBox    *cb;
  60.     QLabel    *sp;
  61.     QSlider    *scroll;
  62. };
  63.  
  64.  
  65. #endif // LIFEDLG_H
  66.