diff options
author | Jon Trowbridge <trow@gnu.org> | 2001-03-06 17:47:08 +0800 |
---|---|---|
committer | Jon Trowbridge <trow@src.gnome.org> | 2001-03-06 17:47:08 +0800 |
commit | 10d0e730eccccf34fc53dc8c1d6145fca1f52f57 (patch) | |
tree | 231d378aa6256253d73d078251d5c8096b824a54 /widgets/text/e-text.c | |
parent | 1bdc6e147f19384e42679512130cfc5f4d93364b (diff) | |
download | gsoc2013-evolution-10d0e730eccccf34fc53dc8c1d6145fca1f52f57.tar.gz gsoc2013-evolution-10d0e730eccccf34fc53dc8c1d6145fca1f52f57.tar.zst gsoc2013-evolution-10d0e730eccccf34fc53dc8c1d6145fca1f52f57.zip |
Added. This is part of a change of sematics that makes things much nicer
2001-03-06 Jon Trowbridge <trow@gnu.org>
* gal/e-text/e-entry.c (e_entry_text_keypress): Added. This is
part of a change of sematics that makes things much nicer for the
user --- auto-activate the completion popup only on keypresses
than also change the entry.
(e_entry_proxy_changed): Record that the underlying EText has
changed, and set up a timeout to clear the changed_since_keypress
flag in a very short amount of time.
(e_entry_init): Connect to the EText's "keypress" signal".
(e_entry_destroy): If our completion_delay_tag timeout is still
floating around out there when we are winding things down, remove
it.
* gal/e-text/e-text.c (e_text_class_init): Added keypress signal.
(e_text_text_model_reposition): Removed some old cruft.
(e_text_event): Emit our keypress signal after handling events of
type GDK_KEY_PRESS.
svn path=/trunk/; revision=8566
Diffstat (limited to 'widgets/text/e-text.c')
-rw-r--r-- | widgets/text/e-text.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 2f2e968394..e6e11750eb 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -38,6 +38,7 @@ enum { E_TEXT_CHANGED, E_TEXT_ACTIVATE, + E_TEXT_KEYPRESS, E_TEXT_POPUP, E_TEXT_LAST_SIGNAL }; @@ -227,6 +228,14 @@ e_text_class_init (ETextClass *klass) gtk_marshal_NONE__NONE, GTK_TYPE_NONE, 0); + e_text_signals[E_TEXT_KEYPRESS] = + gtk_signal_new ("keypress", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (ETextClass, keypress), + gtk_marshal_NONE__INT_INT, + GTK_TYPE_NONE, 2, GTK_TYPE_UINT, GTK_TYPE_UINT); + e_text_signals[E_TEXT_POPUP] = gtk_signal_new ("popup", GTK_RUN_LAST, @@ -498,9 +507,6 @@ static void e_text_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos_data, gpointer user_data) { EText *text = E_TEXT (user_data); -#if 0 - gint org_start = text->selection_start, org_end = text->selection_end; -#endif gint model_len = e_text_model_get_text_length (model); text->selection_start = fn (text->selection_start, repos_data); @@ -516,17 +522,6 @@ e_text_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer text->selection_start = text->selection_end; text->selection_end = tmp; } - -#if 0 - if (org_start != text->selection_start || org_end != text->selection_end) { - /* - In general we shouldn't need to do anything to refresh the - canvas to redraw the (moved) selection, since "reposition" events - will only be generated in association with ETextModel-changing - activities. - */ - } -#endif } static void @@ -2961,6 +2956,10 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) if (e_tep_event.key.string) g_free (e_tep_event.key.string); + if (event->type == GDK_KEY_PRESS) + gtk_signal_emit (GTK_OBJECT (text), e_text_signals[E_TEXT_KEYPRESS], + e_tep_event.key.keyval, e_tep_event.key.state); + return ret; } else @@ -3402,6 +3401,7 @@ e_text_command(ETextEventProcessor *tep, ETextEventProcessorCommand *command, gp if (text->timer) { g_timer_reset(text->timer); } + break; case E_TEP_SELECT: text->selection_start = e_text_model_validate_position (text->model, text->selection_start); /* paranoia */ |