summaryrefslogtreecommitdiff
path: root/noncore/tools/euroconv/calckeypad.h
blob: aac3f416c0c4ef1f5dea1a24653605436c5640a9 (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
/****************************************************************************
 *
 * File:        calckeypad.h
 *
 * Description: Header file for the class KeyPad
 *              
 *               
 * Authors:     Eric Santonacci <Eric.Santonacci@talc.fr>
 *
 * Requirements:    Qt
 *
 * $Id$
 *
 *
 ***************************************************************************/
#ifndef CALCKEYPAD_H
#define CALCKEYPAD_H

#include <qpushbutton.h>
#include <qgrid.h>
#include <qbuttongroup.h>

#include "calcdisplay.h"

class KeyPad : public QGrid {

Q_OBJECT
public:
    KeyPad(LCDDisplay *LCD, QWidget *parent=0, const char *name=0 );
    
public slots:
    void enterDigits(int);
    void operatorPressed(int);
    void clearLCD(void);
    void aboutDialog(void);
    void gotoDec(void);

private:
    LCDDisplay  *display;
    double      dCurrent;
    int         iLenCurrent;
    bool        bIsDec;
    double      dDecCurrent;
    int         iPreviousOperator;
    double      dPreviousValue;

    QPushButton *btn0;
    QPushButton *btn1;
    QPushButton *btn2;
    QPushButton *btn3;
    QPushButton *btn4;
    QPushButton *btn5;
    QPushButton *btn6;
    QPushButton *btn7;
    QPushButton *btn8;
    QPushButton *btn9;
    QButtonGroup *grpbtnDigits;

    QPushButton *btnDot;

    QPushButton *btnClear;
 
    QPushButton *btnPlus;
    QPushButton *btnMinus;
    QPushButton *btnMultiply;
    QPushButton *btnDivide;
    QPushButton *btnEqual;
    QPushButton *btnPercent;
    QPushButton *btnF1;
    QPushButton *btnAbout;
 
    QButtonGroup *grpbtnOperators;

    void setAppearance(void);

};

#endif // CALCKEYPAD_H