summaryrefslogtreecommitdiff
path: root/noncore/tools/calc2/simple/simpleimpl.cpp
Unidiff
Diffstat (limited to 'noncore/tools/calc2/simple/simpleimpl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/tools/calc2/simple/simpleimpl.cpp120
1 files changed, 120 insertions, 0 deletions
diff --git a/noncore/tools/calc2/simple/simpleimpl.cpp b/noncore/tools/calc2/simple/simpleimpl.cpp
new file mode 100644
index 0000000..f71f000
--- a/dev/null
+++ b/noncore/tools/calc2/simple/simpleimpl.cpp
@@ -0,0 +1,120 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20
21#include <qpushbutton.h>
22#include <qlcdnumber.h>
23
24#include "simpleimpl.h"
25#include <stdinstructions.h>
26
27void FormSimpleImpl::CEClicked() {
28 engine->hardReset();
29}
30
31void FormSimpleImpl::MCClicked() {
32 engine->memClear();
33}
34
35void FormSimpleImpl::MRClicked() {
36 engine->memRecall();
37}
38
39void FormSimpleImpl::MPlusClicked() {
40 engine->memSave();
41}
42
43void FormSimpleImpl::evalClicked() {
44 engine->eval();
45}
46
47void FormSimpleImpl::addClicked ()
48{
49 engine->pushInstruction (new iAdd ());
50}
51
52void FormSimpleImpl::subClicked ()
53{
54 engine->pushInstruction (new iSub ());
55}
56
57void FormSimpleImpl::mulClicked ()
58{
59 engine->pushInstruction (new iMul ());
60}
61
62void FormSimpleImpl::divClicked ()
63{
64 engine->pushInstruction (new iDiv ());
65}
66
67void FormSimpleImpl::decimalClicked ()
68{
69 engine->pushValue ('.');
70}
71
72void FormSimpleImpl::val1Clicked ()
73{
74 engine->pushValue ('1');
75}
76
77void FormSimpleImpl::val2Clicked ()
78{
79 engine->pushValue ('2');
80}
81
82void FormSimpleImpl::val3Clicked ()
83{
84 engine->pushValue ('3');
85}
86
87void FormSimpleImpl::val4Clicked ()
88{
89 engine->pushValue ('4');
90}
91
92void FormSimpleImpl::val5Clicked ()
93{
94 engine->pushValue ('5');
95}
96
97void FormSimpleImpl::val6Clicked ()
98{
99 engine->pushValue ('6');
100}
101
102void FormSimpleImpl::val7Clicked ()
103{
104 engine->pushValue ('7');
105}
106
107void FormSimpleImpl::val8Clicked ()
108{
109 engine->pushValue ('8');
110}
111
112void FormSimpleImpl::val9Clicked ()
113{
114 engine->pushValue ('9');
115}
116
117void FormSimpleImpl::val0Clicked ()
118{
119 engine->pushValue ('0');
120}