-/* PSPP - computes sample statistics.
+/* PSPPIRE - a graphical user interface for PSPP.
Copyright (C) 2007 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.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
- 02110-1301, USA. */
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+#include <config.h>
#include <gtk/gtksignal.h>
#include <gtk/gtktable.h>
#include <gtk/gtkbutton.h>
enum {
INSERT_SYNTAX,
+ ERASE,
n_SIGNALS
};
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
+
+ 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);
}
static const char *keypad_insert_text[] = {
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
".", "+", "-", "*", "**", "/", "=", "<>", "<", "<=",
- ">", ">=", "&", "|", "~", "(", ")"
+ ">", ">=", "&", "|", "~", "()", NULL
};
{
const gchar *s = g_hash_table_lookup (kp->frag_table, b);
- 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);
}
static const gint cols = 6;
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_widget_show (label);
+
add_button (kp, &kp->star_star,
0, 1,
4, 5);