-/* PSPP - computes sample statistics.
- Copyright (C) 2007 Free Software Foundation, Inc.
+/* PSPPIRE - a graphical user interface for PSPP.
+ Copyright (C) 2007, 2010, 2011 Free Software Foundation, Inc.
- This program is free software; you can redistribute it and/or
- modify it under the terms of the GNU General Public License as
- published by the Free Software Foundation; either version 2 of the
- License, or (at your option) any later version.
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
- This program is distributed in the hope that it will be useful, but
- WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- General Public License for more details.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
-
-#include <gtk/gtksignal.h>
-#include <gtk/gtktable.h>
-#include <gtk/gtkbutton.h>
-#include <gtk/gtklabel.h>
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+#include <config.h>
+#include <gtk/gtk.h>
n_SIGNALS
};
static void psppire_keypad_class_init (PsppireKeypadClass *klass);
static void psppire_keypad_init (PsppireKeypad *kp);
n_SIGNALS
};
static void psppire_keypad_class_init (PsppireKeypadClass *klass);
static void psppire_keypad_init (PsppireKeypad *kp);
+
+ keypad_signals[ERASE] = g_signal_new ("erase",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (PsppireKeypadClass,
+ keypad),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
".", "+", "-", "*", "**", "/", "=", "<>", "<", "<=",
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
".", "+", "-", "*", "**", "/", "=", "<>", "<", "<=",
- ">", ">=", "&", "|", "~", "(", ")"
+ ">", ">=", "&", "|", "~", "()", NULL
- g_signal_emit (kp, keypad_signals [INSERT_SYNTAX], 0, s);
+
+ if ( s )
+ g_signal_emit (kp, keypad_signals [INSERT_SYNTAX], 0, s);
+ else
+ g_signal_emit (kp, keypad_signals [ERASE], 0);
{
g_object_set (G_OBJECT (*button), "focus-on-click", FALSE, NULL);
{
g_object_set (G_OBJECT (*button), "focus-on-click", FALSE, NULL);
- gtk_table_attach_defaults (GTK_TABLE (kp->table),
- *button,
- x1, x2,
- y1, y2);
+ gtk_grid_attach (GTK_GRID(kp->table), *button, x1, y1, 1, 1);
gtk_widget_set_size_request (*button,
30 * rows / (float) cols,
gtk_widget_set_size_request (*button,
30 * rows / (float) cols,
- GTK_WIDGET_SET_FLAGS (kp, GTK_CAN_FOCUS);
- GTK_WIDGET_UNSET_FLAGS (kp, GTK_HAS_FOCUS);
+ gtk_widget_set_can_focus (GTK_WIDGET (kp), TRUE);
- snprintf (buf, 5, "%d", i);
+ g_snprintf (buf, 5, "%d", i);
g_markup_printf_escaped ("<span style=\"italic\">x<sup>y</sup></span>");
label = gtk_label_new ("**");
g_markup_printf_escaped ("<span style=\"italic\">x<sup>y</sup></span>");
label = gtk_label_new ("**");
gtk_label_set_markup (GTK_LABEL (label), markup);
g_free (markup);
kp->star_star = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (kp->star_star), label);
gtk_label_set_markup (GTK_LABEL (label), markup);
g_free (markup);
kp->star_star = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (kp->star_star), label);