[gcalctool] Add support for | absolute value (can't use as this key is used by OR)
- From: Robert Ancell <rancell src gnome org>
- To: svn-commits-list gnome org
- Subject: [gcalctool] Add support for | absolute value (can't use as this key is used by OR)
- Date: Mon, 27 Jul 2009 02:26:25 +0000 (UTC)
commit ff854d5d2372a01e9b32202cba29e7118942535b
Author: Robert Ancell <robert ancell gmail com>
Date: Mon Jul 27 12:26:18 2009 +1000
Add support for | absolute value (can't use as this key is used by OR)
src/functions.c | 3 ++-
src/functions.h | 1 +
src/gtk.c | 8 +++++++-
3 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/src/functions.c b/src/functions.c
index 307d20b..c1e7457 100644
--- a/src/functions.c
+++ b/src/functions.c
@@ -109,7 +109,8 @@ static Function functions[NFUNCTIONS] = {
{ FN_NATURAL_LOGARITHM, " ln ", 0 },
{ FN_LOGARITHM, " log ", 0 },
{ FN_LOGARITHM2, " logâ?? ", 0 },
-{ FN_ABSOLUTE_VALUE, " abs ", 0 },
+{ FN_ABSOLUTE_VALUE, "|", 0 },
+{ FN_ABSOLUTE_VALUE_FUNC, " abs ", 0 },
{ FN_TRUNC, " trunc ", 0 },
{ FN_MODULUS_DIVIDE, " mod ", 0 },
{ FN_1S_COMPLEMENT, " ones ", 0 },
diff --git a/src/functions.h b/src/functions.h
index ff3290c..4bfd2de 100644
--- a/src/functions.h
+++ b/src/functions.h
@@ -60,6 +60,7 @@ enum
FN_LOGARITHM,
FN_LOGARITHM2,
FN_ABSOLUTE_VALUE,
+ FN_ABSOLUTE_VALUE_FUNC,
FN_TRUNC,
FN_MODULUS_DIVIDE,
FN_1S_COMPLEMENT,
diff --git a/src/gtk.c b/src/gtk.c
index 3fe391c..8a54b7d 100644
--- a/src/gtk.c
+++ b/src/gtk.c
@@ -295,7 +295,7 @@ static struct button_widget button_widgets[] = {
{ 0, 0 },
{ GDK_r, 0 }},
- {FN_ABSOLUTE_VALUE, "abs",
+ {FN_ABSOLUTE_VALUE_FUNC, "abs",
{ 0, 0 },
{ GDK_u, 0 }},
@@ -2140,6 +2140,12 @@ main_window_key_press_cb(GtkWidget *widget, GdkEventKey *event)
return TRUE;
}
+ /* Absolute value */
+ /*if (event->keyval == GDK_bar && state == 0) {
+ do_button(FN_ABSOLUTE_VALUE, 0);
+ return TRUE;
+ }*/
+
/* Delete in display */
if (event->keyval == GDK_Delete && state == 0 && (event->state & GDK_SHIFT_MASK) == 0) {
do_button(FN_DELETE, 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]