/*  "calcqt.h" : Qtopia source header for "RPN calculator on Zaurus"
 * 
 *    This is a Qtopia program to realize "RPN caculator" on Sharp Zaurus,
 *  which consists of header file "calcqt.h" (this file), main program code
 *  "calcqt.cpp", and image file "calcqt.png".
 *  Package file "calcqt_YYYY.MM.DD_arm.ipk" is also available.
 *    The author, T. Nakatsuka, does not insist any right on this program,
 *  i.e., free to re-distribute to any place with/without any modification.
 *    The author acknowledges Hewlett-Packard Corp. for their intelligent
 *  product of micro-calculators, which were borne in mind during designing,
 *  and Trolltech for providing comprehensive environment of Qt/Qtopia.
 */

#include <qobject.h>
#include <qwidget.h>
#include <qevent.h>
#include <qradiobutton.h>
#include <qlabel.h>
#include <qpixmap.h>
#include <qstring.h>

class MainWin : public QLabel
{
  Q_OBJECT
public:
  MainWin( QWidget *parent=0, const char *name=0, WFlags f=0 );
  ~MainWin();
protected:
  virtual void mousePressEvent( QMouseEvent* );
  virtual void keyPressEvent( QKeyEvent* );
public slots:
  void radio1event();
  void radio2event();
private:
  QRadioButton *deg, *rad;
  QLabel *regT, *regZ, *regY, *regX;
  QPixmap keymap;
  QString xstr;
  double x, y, z, t, r, tmp;
  int key, l, lce, kdeg;
  void showx();
  void push(int k);
  void pop();
  void rad0();
  void rad1();
  void num(int i);
  void dot();
  void eex();
  void chs();
  void error();
};