with locale=de_DE:
- entering for exampe (1,5) results in an error
- pressing the "="-button multiple times when an number with a comma is displayed results in multipliying the result by 10
- Added a code to delete the selected text if a new value is entered with
the popup keyboard. Prior to this change the new value was added to the
displayed text. That was an other behavior as known from the
normal OS behavior.
Signed-off-by: Norbert Schechner <nieson@web.de>
made the calc widget support locale settings,
so users can use there num pad of the keyboard,
no matter if they use a comma or a dot as decimal separator.
When using the calculator as a numerical entry sometimes we onnly want
integers - such as when using it for run-from-line entry.
We already had an integer_entry_only method to hide the decimal
button, now it also makes the display only show integers.
numbers starting with a 0 such as 0123+1 would be
converted to octal instead of decimal (so above = 84)
also dividing a whole number into a faction would not
show the decimal portion (1/2 would not = .5)
now we split the string up and qualify all the parts.
converting the numbers to floats first. Then we put it back
together and eval() it.
This bug affected Gscreen's run-from-line badly and certain
division calculations as above.
num_pad_only makes calulator into a numerical input only.
added global references foe the entry and calc_box, so users can
connect signals or add widgets
If there was an error and you ask for the value send None instead of 0
Also if 'Error' is on screen the next key press should clear the error.
hey now it does!