diff options
author | Miguel de Icaza <miguel@ximian.com> | 2001-01-12 16:16:35 +0800 |
---|---|---|
committer | Miguel de Icaza <miguel@src.gnome.org> | 2001-01-12 16:16:35 +0800 |
commit | e779159c4b5c3b79fe29cec7e277d2901a0790af (patch) | |
tree | 7925833c34877be05b3ce5057c21531e227fc565 /widgets | |
parent | 0db9dfca79bc3292c6459e5fef8603b83128427d (diff) | |
download | gsoc2013-evolution-e779159c4b5c3b79fe29cec7e277d2901a0790af.tar gsoc2013-evolution-e779159c4b5c3b79fe29cec7e277d2901a0790af.tar.gz gsoc2013-evolution-e779159c4b5c3b79fe29cec7e277d2901a0790af.tar.bz2 gsoc2013-evolution-e779159c4b5c3b79fe29cec7e277d2901a0790af.tar.lz gsoc2013-evolution-e779159c4b5c3b79fe29cec7e277d2901a0790af.tar.xz 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')
-rw-r--r-- | widgets/table/e-cell-text.c | 23 | ||||
-rw-r--r-- | widgets/table/e-table-selection-model.c | 9 |
2 files changed, 23 insertions, 9 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) { diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index 05f549c92a..a1001438ac 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -447,10 +447,11 @@ etsm_move_selection_end (ETableSelectionModel *selection, int row) e_table_selection_model_signals [SELECTION_CHANGED]); } -void e_table_selection_model_do_something (ETableSelectionModel *selection, - guint row, - guint col, - GdkModifierType state) +void +e_table_selection_model_do_something (ETableSelectionModel *selection, + guint row, + guint col, + GdkModifierType state) { gint shift_p = state & GDK_SHIFT_MASK; gint ctrl_p = state & GDK_CONTROL_MASK; |