~ubuntu-branches/ubuntu/dapper/psi/dapper

« back to all changes in this revision

Viewing changes to src/busywidget.h

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2002-04-19 02:28:44 UTC
  • Revision ID: james.westby@ubuntu.com-20020419022844-za7xgai5qyfd9xv6
Tags: upstream-0.8.5
ImportĀ upstreamĀ versionĀ 0.8.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
** busywidget.h - cool animating widget
 
3
** Copyright (C) 2001, 2002  Justin Karneges
 
4
**
 
5
** This program is free software; you can redistribute it and/or
 
6
** modify it under the terms of the GNU General Public License
 
7
** as published by the Free Software Foundation; either version 2
 
8
** of the License, or (at your option) any later version.
 
9
**
 
10
** This program is distributed in the hope that it will be useful,
 
11
** but WITHOUT ANY WARRANTY; without even the implied warranty of
 
12
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
13
** GNU General Public License for more details.
 
14
**
 
15
** You should have received a copy of the GNU General Public License
 
16
** along with this program; if not, write to the Free Software
 
17
** Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
 
18
**
 
19
****************************************************************************/
 
20
 
 
21
#ifndef BUSYWIDGET_H
 
22
#define BUSYWIDGET_H
 
23
 
 
24
#include<qwidget.h>
 
25
#include<qpixmap.h>
 
26
#include<qtimer.h>
 
27
 
 
28
class BusyWidget : public QWidget
 
29
{
 
30
        Q_OBJECT
 
31
public:
 
32
        BusyWidget(QWidget *parent=0, const char *name=0);
 
33
 
 
34
        void start();
 
35
        void stop();
 
36
        bool isActive() { return v_isActive; }
 
37
 
 
38
protected:
 
39
        void paintEvent(QPaintEvent *);
 
40
        void resizeEvent(QResizeEvent *);
 
41
 
 
42
private:
 
43
        bool v_isActive;
 
44
        int frame;
 
45
        int at;
 
46
        QPixmap pix;
 
47
        QTimer *t;
 
48
 
 
49
        void render();
 
50
        void renderPixmap();
 
51
 
 
52
private slots:
 
53
        void animate();
 
54
};
 
55
 
 
56
#endif