aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2001-01-27 14:43:39 +0800
committerChris Lahey <clahey@src.gnome.org>2001-01-27 14:43:39 +0800
commit133b44558c4ef50cb479eb2646f045eb4aa0b4aa (patch)
tree6e33e217d8f34da5f8fd65030eca8d8476a5fa6f /widgets/table/e-table.c
parent803fc4da6978b404212cf233ad7dec740a1c6bd0 (diff)
downloadgsoc2013-evolution-133b44558c4ef50cb479eb2646f045eb4aa0b4aa.tar
gsoc2013-evolution-133b44558c4ef50cb479eb2646f045eb4aa0b4aa.tar.gz
gsoc2013-evolution-133b44558c4ef50cb479eb2646f045eb4aa0b4aa.tar.bz2
gsoc2013-evolution-133b44558c4ef50cb479eb2646f045eb4aa0b4aa.tar.lz
gsoc2013-evolution-133b44558c4ef50cb479eb2646f045eb4aa0b4aa.tar.xz
gsoc2013-evolution-133b44558c4ef50cb479eb2646f045eb4aa0b4aa.tar.zst
gsoc2013-evolution-133b44558c4ef50cb479eb2646f045eb4aa0b4aa.zip
Make ETable stop editing when it looses focus.
2001-01-27 Christopher James Lahey <clahey@helixcode.com> * e-table-item.c (eti_event): Make ETable stop editing when it looses focus. * e-table.c (et_canvas_button_press): Make ETable stop editing if you click on an unhandled area of the table canvas (The white area at the bottom for instance.) svn path=/trunk/; revision=7849
Diffstat (limited to 'widgets/table/e-table.c')
-rw-r--r--widgets/table/e-table.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index 240b9068ba..3c9c2d2659 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -4,17 +4,14 @@
*
* Author:
* Miguel de Icaza (miguel@ximian.com)
- * Chris Lahey (clahey@ximian.com)
+ * Chris Lahey <clahey@ximian.com>
*
- * Copyright 1999, Ximian, Inc
+ * Copyright 1999, 2000, 2001, Ximian, Inc
*/
#include <config.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
#include <stdio.h>
#include "gal/util/e-i18n.h"
#include <libgnomeui/gnome-canvas.h>
@@ -567,6 +564,18 @@ et_canvas_realize (GtkWidget *canvas, ETable *e_table)
}
static void
+et_canvas_button_press (GtkWidget *canvas, GdkEvent *event, ETable *e_table)
+{
+ if (GTK_WIDGET_HAS_FOCUS(canvas)) {
+ GnomeCanvasItem *item = GNOME_CANVAS(canvas)->focused_item;
+
+ if (E_IS_TABLE_ITEM(item)) {
+ e_table_item_leave_edit(E_TABLE_ITEM(item));
+ }
+ }
+}
+
+static void
e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *header,
ETableModel *model)
{
@@ -621,9 +630,13 @@ e_table_setup_table (ETable *e_table, ETableHeader *full_header, ETableHeader *h
"y2", (double) 100,
"fill_color_gdk", &GTK_WIDGET(e_table->table_canvas)->style->base[GTK_STATE_NORMAL],
NULL);
+
gtk_signal_connect (
GTK_OBJECT(e_table->table_canvas), "realize",
GTK_SIGNAL_FUNC(et_canvas_realize), e_table);
+ gtk_signal_connect (
+ GTK_OBJECT(e_table->table_canvas), "button_press_event",
+ GTK_SIGNAL_FUNC(et_canvas_button_press), e_table);
e_table->canvas_vbox = gnome_canvas_item_new(
gnome_canvas_root(e_table->table_canvas),
e_canvas_vbox_get_type(),