diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-07-27 22:50:04 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-07-27 22:50:04 +0800 |
commit | 86b1bd7f21c3024437375e656e75738423e85335 (patch) | |
tree | eb75adac6234d7e3262a5c10ba96b874eb2434f4 /widgets/e-table/e-table-click-to-add.c | |
parent | e52cd76bd60056abc4c142065ae0c8d34a169f58 (diff) | |
download | gsoc2013-evolution-86b1bd7f21c3024437375e656e75738423e85335.tar gsoc2013-evolution-86b1bd7f21c3024437375e656e75738423e85335.tar.gz gsoc2013-evolution-86b1bd7f21c3024437375e656e75738423e85335.tar.bz2 gsoc2013-evolution-86b1bd7f21c3024437375e656e75738423e85335.tar.lz gsoc2013-evolution-86b1bd7f21c3024437375e656e75738423e85335.tar.xz gsoc2013-evolution-86b1bd7f21c3024437375e656e75738423e85335.tar.zst gsoc2013-evolution-86b1bd7f21c3024437375e656e75738423e85335.zip |
Grab focus properly.
2000-07-27 Christopher James Lahey <clahey@helixcode.com>
* e-table-item.c (eti_cursor_change): Grab focus properly.
* e-table-item.c, e-table-click-to-add.c: Fixed ETableClickToAdd
to handle carriage return. This still doesn't quite work right.
svn path=/trunk/; revision=4384
Diffstat (limited to 'widgets/e-table/e-table-click-to-add.c')
-rw-r--r-- | widgets/e-table/e-table-click-to-add.c | 82 |
1 files changed, 55 insertions, 27 deletions
diff --git a/widgets/e-table/e-table-click-to-add.c b/widgets/e-table/e-table-click-to-add.c index 8732e88a51..0a4ba21f81 100644 --- a/widgets/e-table/e-table-click-to-add.c +++ b/widgets/e-table/e-table-click-to-add.c @@ -103,6 +103,10 @@ etcta_drop_one (ETableClickToAdd *etcta) gtk_object_set(GTK_OBJECT(etcta->selection), "model", NULL, NULL); + if (etcta->row) + gnome_canvas_item_set(GNOME_CANVAS_ITEM(etcta->row), + "ETableModel", NULL, + NULL); } static void @@ -310,7 +314,31 @@ etcta_event (GnomeCanvasItem *item, GdkEvent *e) gnome_canvas_item_w2i (item, &e->button.x, &e->button.y); } break; - + + case GDK_KEY_PRESS: + switch (e->key.keyval) { + case GDK_Return: + case GDK_KP_Enter: + case GDK_ISO_Enter: + case GDK_3270_Enter: + if (etcta->row) { + ETableModel *one; + e_table_selection_model_clear(etcta->selection); + + e_table_one_commit(E_TABLE_ONE(etcta->one)); + etcta_drop_one (etcta); + + one = e_table_one_new(etcta->model); + etcta_add_one (etcta, one); + gtk_object_unref(GTK_OBJECT(one)); + + e_table_item_set_cursor(E_TABLE_ITEM(etcta->row), 0, 0); + } + break; + default: + break; + } + default: return FALSE; } @@ -434,30 +462,30 @@ e_table_click_to_add_get_type (void) void e_table_click_to_add_commit (ETableClickToAdd *etcta) { - if (etcta->row) { - e_table_one_commit(E_TABLE_ONE(etcta->one)); - gtk_object_destroy(GTK_OBJECT(etcta->row)); - etcta_drop_one (etcta); - etcta->row = NULL; - } - if (!etcta->text) { - etcta->text = gnome_canvas_item_new(GNOME_CANVAS_GROUP(etcta), - e_text_get_type(), - "text", etcta->message ? etcta->message : "", - "anchor", GTK_ANCHOR_NW, - "width", etcta->width - 4, - NULL); - e_canvas_item_move_absolute (etcta->text, 2, 2); - } - if (!etcta->rect) { - etcta->rect = gnome_canvas_item_new(GNOME_CANVAS_GROUP(etcta), - gnome_canvas_rect_get_type(), - "x1", (double) 0, - "y1", (double) 0, - "x2", (double) etcta->width - 1, - "y2", (double) etcta->height - 1, - "outline_color", "black", - "fill_color", NULL, - NULL); - } + if (etcta->row) { + e_table_one_commit(E_TABLE_ONE(etcta->one)); + etcta_drop_one (etcta); + gtk_object_destroy(GTK_OBJECT(etcta->row)); + etcta->row = NULL; + } + if (!etcta->text) { + etcta->text = gnome_canvas_item_new(GNOME_CANVAS_GROUP(etcta), + e_text_get_type(), + "text", etcta->message ? etcta->message : "", + "anchor", GTK_ANCHOR_NW, + "width", etcta->width - 4, + NULL); + e_canvas_item_move_absolute (etcta->text, 2, 2); + } + if (!etcta->rect) { + etcta->rect = gnome_canvas_item_new(GNOME_CANVAS_GROUP(etcta), + gnome_canvas_rect_get_type(), + "x1", (double) 0, + "y1", (double) 0, + "x2", (double) etcta->width - 1, + "y2", (double) etcta->height - 1, + "outline_color", "black", + "fill_color", NULL, + NULL); + } } |