00001 /**************************************************************************** 00002 * 00003 * File: calckeypad.h 00004 * 00005 * Description: Header file for the class KeyPad 00006 * 00007 * 00008 * Authors: Eric Santonacci <Eric.Santonacci@talc.fr> 00009 * 00010 * Requirements: Qt 00011 * 00012 * $Id: calckeypad.h,v 1.2 2003/02/21 10:39:30 eric Exp $ 00013 * 00014 * 00015 ***************************************************************************/ 00016 #ifndef CALCKEYPAD_H 00017 #define CALCKEYPAD_H 00018 00019 #include <qpushbutton.h> 00020 #include <qgrid.h> 00021 #include <qbuttongroup.h> 00022 00023 #include "calcdisplay.h" 00024 00025 class KeyPad : public QGrid { 00026 00027 Q_OBJECT 00028 public: 00029 KeyPad(LCDDisplay *LCD, QWidget *parent=0, const char *name=0 ); 00030 00031 public slots: 00032 void enterDigits(int); 00033 void operatorPressed(int); 00034 void clearLCD(void); 00035 void aboutDialog(void); 00036 void gotoDec(void); 00037 00038 private: 00039 LCDDisplay *display; 00040 double dCurrent; 00041 int iLenCurrent; 00042 bool bIsDec; 00043 double dDecCurrent; 00044 int iPreviousOperator; 00045 double dPreviousValue; 00046 00047 QPushButton *btn0; 00048 QPushButton *btn1; 00049 QPushButton *btn2; 00050 QPushButton *btn3; 00051 QPushButton *btn4; 00052 QPushButton *btn5; 00053 QPushButton *btn6; 00054 QPushButton *btn7; 00055 QPushButton *btn8; 00056 QPushButton *btn9; 00057 QButtonGroup *grpbtnDigits; 00058 00059 QPushButton *btnDot; 00060 00061 QPushButton *btnClear; 00062 00063 QPushButton *btnPlus; 00064 QPushButton *btnMinus; 00065 QPushButton *btnMultiply; 00066 QPushButton *btnDivide; 00067 QPushButton *btnEqual; 00068 QPushButton *btnPercent; 00069 QPushButton *btnF1; 00070 QPushButton *btnAbout; 00071 00072 QButtonGroup *grpbtnOperators; 00073 00074 void setAppearance(void); 00075 00076 }; 00077 00078 #endif // CALCKEYPAD_H
1.4.2