
Dashboard Calculator
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
Dashboard Calculator
As seen in Mac OS X Tiger preview screen shots.
Its a cute little calculator that you may find surprisingly useful (unlike anything else I've done with SuperKaramba :)
I just wrote the python script. It's a really quick ugly hack, but it works just fine.
The images are all from http://www.therealduckie.net/ - I have nothing to do with them. I didn't create them or anything. Thank/abuse/etc therealduckie.
The python script itself is GPL.
16 years ago
Version 1 -
It exists. It is most likely done.
16 years ago
Version 1 -
It exists. It is most likely done.
Ekardnam
16 years ago
Just one thing: If you type:
30-1
Then you type first 30: it displays 30
Then you typ -: it displays 0
Better if it still displays 30, maybe the "30" could "flash" once or something ;P
Report
is0
16 years ago
How to reproduce:
1. start this theme
2. press '1' (displaied 1)
3. press 'MR' (displaied 1, should be 0)
Patch:
diff -ru Dashboard_Calculator_orig/db_calculator.py Dashboard_Calculator/db_calculator.py
--- Dashboard_Calculator_orig/db_calculator.py 2002-01-02 11:22:43 +0400
+++ Dashboard_Calculator/db_calculator.py 2005-01-19 23:13:28 +0400
@@ -16,6 +16,7 @@
total = 0
hasfraction = False
isresult = False
+newnumber = False
textlabel = 0
@@ -154,7 +155,7 @@
global dbtnNums
global dbtnOps
global dbtnMemOps
- global activeOp, memory, display, total, hasfraction, isresult
+ global activeOp, memory, display, total, hasfraction, isresult, newnumber
global textlabel
uplist = []
@@ -167,8 +168,13 @@
if (isresult):
isresult = False
hasfraction = False
+ newnumber = False
display = "0"
+ if (newnumber):
+ display = "0"
+ newnumber = False
+
#handle digits
if ((len(display) < 7 and not hasfraction) or (len(display) < 8 and hasfraction)):
@@ -205,7 +211,7 @@
else:
total = float(display)
activeOp = "/"
- display = "0"
+ newnumber = True
isresult = False
hasfraction = False
@@ -221,7 +227,7 @@
else:
total = float(display)
activeOp = "*"
- display = "0"
+ newnumber = True
isresult = False
hasfraction = False
@@ -237,7 +243,7 @@
else:
total = float(display)
activeOp = "-"
- display = "0"
+ newnumber = True
isresult = False
hasfraction = False
@@ -253,7 +259,7 @@
else:
total = float(display)
activeOp = "+"
- display = "0"
+ newnumber = True
isresult = False
hasfraction = False
@@ -269,7 +275,7 @@
#handle decimal button
if (not hasfraction):
hasfraction = True
-
+
if (isFloat(display) and float(display) == 0):
display = "0."
else:
@@ -282,6 +288,7 @@
display = "0"
isresult = False
hasfraction = False
+ newnumber = False
if meter in btnMemOps:
@@ -304,6 +311,12 @@
elif (btnMemOps.index(meter) == 3):
#handle mr button
display = memory
+ # BUG: press 1, then MR: nothing heppens, should be display=0 (redraw?)
+ # message in the console:
+ # Call to meterClicked failed
+ # Traceback (most recent call last):
+ # File "db_calculator.py", line 318, in meterClicked
+ # ValueError: substring not found
hasfraction = (display.index(".") >= 0)
Report
nsicad
16 years ago
Report
ageitgey
16 years ago
Report
18volt
16 years ago
Report
Remenic
16 years ago
Report
nsicad
16 years ago
Report