aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-cell-text.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@ximian.com>2001-01-12 16:16:35 +0800
committerMiguel de Icaza <miguel@src.gnome.org>2001-01-12 16:16:35 +0800
commite779159c4b5c3b79fe29cec7e277d2901a0790af (patch)
tree7925833c34877be05b3ce5057c21531e227fc565 /widgets/table/e-cell-text.c
parent0db9dfca79bc3292c6459e5fef8603b83128427d (diff)
downloadgsoc2013-evolution-e779159c4b5c3b79fe29cec7e277d2901a0790af.tar.gz
gsoc2013-evolution-e779159c4b5c3b79fe29cec7e277d2901a0790af.tar.zst
gsoc2013-evolution-e779159c4b5c3b79fe29cec7e277d2901a0790af.zip
New function. Tells whether a key should begin editing. (ect_event,
2001-01-12 Miguel de Icaza <miguel@ximian.com> * e-cell-text.c (key_begins_editing): New function. Tells whether a key should begin editing. (ect_event, GDK_KEY_PRESS/RELEASE): check whether we should start editing. svn path=/trunk/; revision=7445
Diffstat (limited to 'widgets/table/e-cell-text.c')
-rw-r--r--widgets/table/e-cell-text.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 8d7d94deac..7da73b4792 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -681,6 +681,15 @@ ect_edit_select_all (ECellTextView *text_view)
text_view->edit->selection_end = strlen (text_view->edit->cell.text);
}
+static gboolean
+key_begins_editing (GdkEventKey *event)
+{
+ if (event->length == 0)
+ return FALSE;
+
+ return TRUE;
+}
+
/*
* ECell::event method
*/
@@ -725,8 +734,10 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col,
return_val = TRUE;
break;
}
-
- if ((!edit_display) && e_table_model_is_cell_editable (ecell_view->e_table_model, model_col, row)) {
+
+ if ((!edit_display) &&
+ e_table_model_is_cell_editable (ecell_view->e_table_model, model_col, row) &&
+ key_begins_editing (&event->key)) {
e_table_item_enter_edit (text_view->cell_view.e_table_item_view, view_col, row);
ect_edit_select_all (text_view);
edit = text_view->edit;
@@ -1995,13 +2006,15 @@ e_cell_text_view_command (ETextEventProcessor *tep, ETextEventProcessorCommand *
#endif
}
-static void _invisible_destroy (GtkInvisible *invisible,
- CellEdit *edit)
+static void
+_invisible_destroy (GtkInvisible *invisible,
+ CellEdit *edit)
{
edit->invisible = NULL;
}
-static GtkWidget *e_cell_text_view_get_invisible (CellEdit *edit)
+static GtkWidget *
+e_cell_text_view_get_invisible (CellEdit *edit)
{
GtkWidget *invisible;
if (edit->invisible) {