summaryrefslogtreecommitdiffstats
path: root/kbruch/src/statisticsview.h
blob: 91b54c22cbec85bd2bddd420fad523b1f0cc6b3d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/***************************************************************************
                          statisticsview.cpp  -  Header File
                             -------------------
    begin                : Tue Mar 08 17:20:00 CET 2002
    copyright            : (C) 2001 - 2004 by Sebastian Stein, Eva Brucherseifer
    email                : seb.kde@hpfsc.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef STATISTICSVIEW_H
#define STATISTICSVIEW_H

class TQLabel;
class TQPushButton;
class TQVBoxLayout;
class TQHBoxLayout;
class TQGridLayout;

#include <tqwidget.h>

/*!
  * StatisticsView takes care of the statistics of a test.
  * It saves the number of correct and wrong answers and
  * displays this data to the user.
  * \author Sebastian Stein
  * \author Eva Brucherseifer
  */

class StatisticsView : public QWidget
{
	Q_OBJECT

public:
	/** constructor */
	StatisticsView(TQWidget * parent = 0, const char * name = 0);

	/** destructor */
	~StatisticsView();

public slots:
	/** increment number of correct answers */
	void addCorrect();

	/** increment number of wrong answers */
	void addWrong();

	/** set statistics to zero.
	 *  Triggered by internal button or when a new test is started
	 */
	void resetStatistics();
private:
	/** calculate percentages and update view */
	void calc();

	unsigned int m_count;
	unsigned int m_correct;

	TQPushButton * resetBtn;
	TQHBoxLayout * buttonLayout;
	TQVBoxLayout * tqlayout1;
	TQGridLayout * labelGrid;
	TQLabel * result1Label;
	TQLabel * result2Label;
	TQLabel * result3Label;
	TQLabel * info1Label;
	TQLabel * info2Label;
	TQLabel * info3Label;
};

#endif