aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-item.c
diff options
context:
space:
mode:
authorSuresh Chandrasekharan <suresh.chandrasekharan@sun.com>2003-10-15 02:20:18 +0800
committerSuresh Chandrasekharan <kcsuresh@src.gnome.org>2003-10-15 02:20:18 +0800
commit0517e6655c44fde264965dc7221f597471846cef (patch)
treec825bb39da5ad0ea86a782a80386a4f6d9d93fb8 /widgets/table/e-table-item.c
parenta267d0a153a33621c6d51710d370ab2b90278b2b (diff)
downloadgsoc2013-evolution-0517e6655c44fde264965dc7221f597471846cef.tar
gsoc2013-evolution-0517e6655c44fde264965dc7221f597471846cef.tar.gz
gsoc2013-evolution-0517e6655c44fde264965dc7221f597471846cef.tar.bz2
gsoc2013-evolution-0517e6655c44fde264965dc7221f597471846cef.tar.lz
gsoc2013-evolution-0517e6655c44fde264965dc7221f597471846cef.tar.xz
gsoc2013-evolution-0517e6655c44fde264965dc7221f597471846cef.tar.zst
gsoc2013-evolution-0517e6655c44fde264965dc7221f597471846cef.zip
Support for preedit in e-text widgets.
2003-10-14 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com> * Support for preedit in e-text widgets. * gal/gal/e-text/e-text.c: Added e_text_preedit_changed_cb and insert_preedit_text. * Modified the following functions. (e_text_draw) Calls insert_preedit_text also cursor pos @ the end of text->selection_start + text->preedit_len (e_text_event) Added hooks for preedit_cb (e_text_init) Inits text->preedit_len (e_text_retrieve_surrounding_cb) Removed printf (e_text_delete_surrounding_cb) Correct params for gtk_editable_delete_text to make it work. * gal/gal/e-text/e-text.h: Added preedit_len in struct _EText 2003-09-25 Suresh Chandrasekharan <suresh.chandrasekharan@sun.com> * Fix for "44222 task summary entry widget not i18ned". The following files are changed. * gal/gal/e-table/e-cell-text.c: Lots of changes for i18n selection/input support. Added these functions for input method support. (e_cell_text_preedit_changed_cb) (e_cell_text_commit_cb) (e_cell_text_retrieve_surrounding_cb) (e_cell_text_delete_surrounding_cb) (layout_with_preedit) This function inserts the preedit string with the right attribs to the layout text. (build_attr_list) Creates the PangoAttrList with bold/stikeout/underline as applicable for the current ECellText. The following functions are modified. (ect_stop_editing): disconnect signal handlers when editing stops (ect_draw): Changes for including the preedit only to the currently selected row/col. Also display the cursor at the end of preedit text. (ect_event): Connects the IM callbacks to the key press event. Disconnect when not in editing mode. Also a special flag to see when Enter key pressed in preedit mode, the text is committed only not a new row is created. This woks in conjunction with the changes made in the eti_event in e-table-item.c file and e-cell.h. (ect_height): Changes due to parameters changing for generate_layout (ect_enter_edit): Initialization of im_context for a cell text and assoociated flags. (ect_max_width): Changes due to parameters changing for generate_layout. (ect_max_width_by_row): Changes due to parameters changing for generate_layout. (ect_show_tooltip): Changes due to parameters changing for generate_layout. (e_cell_text_construct): check whether paramters are NULL. (get_position_from_xy): Changes due to parameters changing for generate_layout. (_insert): Set the selection_start as the minimum of strlen(edit->text) and selection_start. Used to correct the preedit_string length which may have added to the selection_start. (e_cell_text_view_command): When inserting, if in the preedit mode do not delete the selection. (_selection_get): Set utf8 data instead of string data. (_selection_received): Take in UTF8_ATOM inaddition to GDK_SELECTION_TYPE_STRING. (e_cell_text_view_get_selection): Make utf8 data when acting as a selection source. * gal/e-table/e-cell-text.h : Included <gtk/gtkmenu.h> * gal/e-table/e-cell.h: Added enum E_CELL_PREEDIT to ECellFlags * gal/e-table/e-table-item.c: (eti_event) Changes for not committing the edited text as a seperate row in preedit mode. * gal/e-table/e-table.c: (table_canvas_focus_event_cb) To have proper im_context focus for the ecanvas holding the e-table. svn path=/trunk/; revision=22882
Diffstat (limited to 'widgets/table/e-table-item.c')
-rw-r--r--widgets/table/e-table-item.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 1015920e57..4acff10b2c 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -2703,18 +2703,17 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
case GDK_ISO_Enter:
case GDK_3270_Enter:
if (eti_editing (eti)){
- e_table_item_leave_edit_(eti);
-#if 0
ecell_view = eti->cell_views [eti->editing_col];
return_val = eti_e_cell_event (eti, ecell_view, e, e->key.time,
- view_to_model_col(eti, eti->editing_col),
- eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR);
-#endif
+ view_to_model_col (eti, eti->editing_col),
+ eti->editing_col, eti->editing_row, E_CELL_EDITING | E_CELL_CURSOR | E_CELL_PREEDIT);
+ if (!return_val)
+ break;
}
g_signal_emit (eti, eti_signals [KEY_PRESS], 0,
- model_to_view_row(eti, cursor_row), cursor_col, e, &return_val);
+ model_to_view_row (eti, cursor_row), cursor_col, e, &return_val);
if (!return_val)
- return_val = e_selection_model_key_press(E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
+ return_val = e_selection_model_key_press (E_SELECTION_MODEL (eti->selection), (GdkEventKey *) e);
break;
default: