|
PHP2Go Javascript Framework | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Object | +--Calculator
Defined in widgets/calculator.js
| Field Summary | |
Object |
container
Calculator container layer |
Array |
elements
Array of calculator elements (action buttons) |
Boolean |
ignore
Used to signal keys to be ignored inside keydown and keypress handlers |
Object |
input
Calculator text input |
String |
lastOp
Last operator |
Number |
left
Used to hold left operand value |
Boolean |
newNum
Indicates if next number pressed will represent a new number |
String |
pendingOp
Pending operator |
Number |
right
Used to hold right operand value |
Object |
target
Current calculator target (field) |
Object |
trigger
Current calculator trigger (button, image or link) |
<static> Boolean |
loaded
Indicates if the calculator singleton was already loaded |
<static> Calculator |
singleton
Holds the single instance of the Calculator class, shared among all fields that use it |
| Constructor Summary | |
Calculator
()
The Calculator class is used to build a simple calculator widget to be used by numeric fields in the PHP2Go forms |
|
| Method Summary | |
void
|
backspace()
Removes the rightmost number in the calculator text input |
void
|
build()
Builds the calculator widget |
void
|
buttonHandler(<Object> sender)
Calculator button handler. |
void
|
clear()
Resets the calculator status |
void
|
clearEntry()
Clears the current calculator entry |
void
|
decimal()
Adds a decimal point in the calculator text input |
void
|
hide()
Hides the calculator widget. |
void
|
keyDownHandler(<Event> e)
Calculator keydown handler. |
void
|
keyPressHandler(<Event> e)
Calculator keypress handler |
void
|
mouseDownHandler(<Event> e)
Listen to mousedown events in the document. |
void
|
negate()
Inverts the signal of the current calculator entry |
void
|
number(<Number> n)
Method called when a number (0-9) is pressed |
void
|
operation(<String> op)
Method called when an operation button is pressed |
void
|
result()
Called when the "Result" button is pressed. |
void
|
showAt(<Object> tgr, <Object> trg, <String> align)
Shows the calculator widget in a given trigger and target. |
<static> void
|
setup(<Object> opts)
Sets up a new calculator based on a set of options. |
| Field Detail |
Object container
Array elements
Boolean ignore
Object input
String lastOp
Number left
Boolean newNum
String pendingOp
Number right
Object target
Object trigger
<static> Boolean loaded
<static> Calculator singleton
| Constructor Detail |
Calculator()
| Method Detail |
void backspace()
void build()
void buttonHandler(<Object> sender)
sender - Button clicked
void clear()
void clearEntry()
void decimal()
void hide()
void keyDownHandler(<Event> e)
e - Event
void keyPressHandler(<Event> e)
e - Event
void mouseDownHandler(<Event> e)
e - Event
void negate()
void number(<Number> n)
n - Number pressed
void operation(<String> op)
op - Operation name
void result()
void showAt(<Object> tgr, <Object> trg, <String> align)
tgr - Trigger
trg - Target field
align - Alignment ("right", "bottom")
<static> void setup(<Object> opts)
opts - Setup options
|
PHP2Go Javascript Framework | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||