Difference between revisions of "More Calculator Functions"

From WebOS Internals
Jump to navigation Jump to search
(New page: Bottom line - there are secondary calculator functions already built in. Just push the space bar. Below is the coding showing where I found it. If you go to /usr/palm/applications/com.p...)
 
Line 1: Line 1:
Bottom line - there are secondary calculator functions already built in. Just push the space bar.  Below is the coding showing where I found it.
+
Bottom line - there are secondary calculator functions already built in. Just push the space bar.  Below is the coding showing where I found it.  I'm currently working on changing the M- function to a X^y function.
  
 
If you go to
 
If you go to

Revision as of 16:21, 31 July 2009

Bottom line - there are secondary calculator functions already built in. Just push the space bar. Below is the coding showing where I found it. I'm currently working on changing the M- function to a X^y function.

If you go to

/usr/palm/applications/com.palm.app.calculator/app/controllers

and look at calculator-assistant.js, you can see the following alternative functions that have always been available - but news to me.

onKeyPress: function(event) {
                if (Mojo.Char.isEnterKey(event.charCode)) {
                        this.onEqualsPress(event);
                } else if (event.charCode == Mojo.Char.backspace) {
                        this.onBackspacePress(event);
                } else if (event.charCode == Mojo.Char.spaceBar) {
                        this.toggleOptionKeyMode();
.
.
.
.
 onDividePress: function(event) {
                if (this.optionKeys) {
                        this.calculator.memMinus();
                        this.showMemoryIndicator();
                        this.toggleOptionKeyMode();
                } else {
                        this.calculator.divide();
                }
                this.updateResults();
                event.stop();
        },

        onMultiplyPress: function(event) {
                if (this.optionKeys) {
                        this.calculator.percent();
                        this.toggleOptionKeyMode();
                } else {
                        this.calculator.multiply();
                }
                this.updateResults();
                event.stop();
        },
 onSubtractPress: function(event) {
                if (this.optionKeys) {
                        this.calculator.sqrt();
                        this.toggleOptionKeyMode();
                } else {
                        this.calculator.subtract();
                }
                this.updateResults();
                event.stop();
        },

        onAddPress: function(event) {
                if (this.optionKeys) {
                        this.calculator.plusMinus();
                        this.toggleOptionKeyMode();
                } else {
                        this.calculator.add();
                }
                this.updateResults();
                event.stop();
        },