aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2002-03-14 04:51:44 +0800
committerChris Lahey <clahey@src.gnome.org>2002-03-14 04:51:44 +0800
commit84d68e495549a6c14a730888e58ed6f24f4b017f (patch)
tree0a0db9a85508c9bc429993412b411cb64d7581dc
parent521ba6b4bf30269f16b511084db0f85009dbef95 (diff)
downloadgsoc2013-evolution-84d68e495549a6c14a730888e58ed6f24f4b017f.tar
gsoc2013-evolution-84d68e495549a6c14a730888e58ed6f24f4b017f.tar.gz
gsoc2013-evolution-84d68e495549a6c14a730888e58ed6f24f4b017f.tar.bz2
gsoc2013-evolution-84d68e495549a6c14a730888e58ed6f24f4b017f.tar.lz
gsoc2013-evolution-84d68e495549a6c14a730888e58ed6f24f4b017f.tar.xz
gsoc2013-evolution-84d68e495549a6c14a730888e58ed6f24f4b017f.tar.zst
gsoc2013-evolution-84d68e495549a6c14a730888e58ed6f24f4b017f.zip
Added this function.
2002-03-13 Christopher James Lahey <clahey@ximian.com> * e-table-search.c, e-table-search.h (e_table_search_backspace): Added this function. * e-table.c, e-tree.c: Call the new function on backspace. svn path=/trunk/; revision=16145
-rw-r--r--widgets/table/e-table-search.c19
-rw-r--r--widgets/table/e-table-search.h2
-rw-r--r--widgets/table/e-table.c3
-rw-r--r--widgets/table/e-tree.c3
4 files changed, 26 insertions, 1 deletions
diff --git a/widgets/table/e-table-search.c b/widgets/table/e-table-search.c
index e05210fe65..d9465bf580 100644
--- a/widgets/table/e-table-search.c
+++ b/widgets/table/e-table-search.c
@@ -220,3 +220,22 @@ e_table_search_input_character (ETableSearch *ets, gunichar character)
}
}
}
+
+void
+e_table_search_backspace (ETableSearch *ets)
+{
+ char *end;
+
+ g_return_if_fail (ets != NULL);
+ g_return_if_fail (E_IS_TABLE_SEARCH (ets));
+
+ if (!ets->priv->search_string ||
+ !*ets->priv->search_string)
+ return;
+
+ end = ets->priv->search_string + strlen (ets->priv->search_string);
+ end = g_utf8_prev_char (end);
+ *end = 0;
+ ets->priv->last_character = 0;
+ add_timeout (ets);
+}
diff --git a/widgets/table/e-table-search.h b/widgets/table/e-table-search.h
index f90fae19d7..8cda0e7d94 100644
--- a/widgets/table/e-table-search.h
+++ b/widgets/table/e-table-search.h
@@ -56,7 +56,6 @@ typedef struct {
*/
gboolean (*search) (ETableSearch *ets, char *string /* utf8 */, ETableSearchFlags flags);
void (*accept) (ETableSearch *ets);
- void (*cancelled) (ETableSearch *ets);
} ETableSearchClass;
GtkType e_table_search_get_type (void);
@@ -65,6 +64,7 @@ ETableSearch *e_table_search_new (void);
/**/
void e_table_search_input_character (ETableSearch *e_table_search,
gunichar character);
+void e_table_search_backspace (ETableSearch *e_table_search);
void e_table_search_cancel (ETableSearch *e_table_search);
END_GNOME_DECLS
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index e730dabbc7..a12350da1f 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -753,6 +753,9 @@ group_key_press (ETableGroup *etg, int row, int col, GdkEvent *event, ETable *et
e_selection_model_select_as_key_press (E_SELECTION_MODEL (et->selection), row_local, col_local, key->state);
return_val = 1;
break;
+ case GDK_BackSpace:
+ e_table_search_backspace (et->search);
+ break;
default:
if ((key->keyval >= GDK_a && key->keyval <= GDK_z) ||
(key->keyval >= GDK_A && key->keyval <= GDK_Z) ||
diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c
index 91f9a500ce..aee7061f7a 100644
--- a/widgets/table/e-tree.c
+++ b/widgets/table/e-tree.c
@@ -857,6 +857,9 @@ item_key_press (ETableItem *eti, int row, int col, GdkEvent *event, ETree *et)
}
return_val = 1;
break;
+ case GDK_BackSpace:
+ e_table_search_backspace (et->priv->search);
+ break;
default:
if ((key->keyval >= GDK_a && key->keyval <= GDK_z) ||
(key->keyval >= GDK_A && key->keyval <= GDK_Z) ||