diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-05-30 21:19:32 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-05-30 21:19:32 +0800 |
commit | a076f5b58f51b45bf5308f7b077d6314dc893f29 (patch) | |
tree | a9a9c17a8db8028145847823e3e04f747882684c /widgets/e-table/e-table-group.c | |
parent | bdf6f37a8afa9988de108ac207b48de01fee6141 (diff) | |
download | gsoc2013-evolution-a076f5b58f51b45bf5308f7b077d6314dc893f29.tar gsoc2013-evolution-a076f5b58f51b45bf5308f7b077d6314dc893f29.tar.gz gsoc2013-evolution-a076f5b58f51b45bf5308f7b077d6314dc893f29.tar.bz2 gsoc2013-evolution-a076f5b58f51b45bf5308f7b077d6314dc893f29.tar.lz gsoc2013-evolution-a076f5b58f51b45bf5308f7b077d6314dc893f29.tar.xz gsoc2013-evolution-a076f5b58f51b45bf5308f7b077d6314dc893f29.tar.zst gsoc2013-evolution-a076f5b58f51b45bf5308f7b077d6314dc893f29.zip |
Fixed a bunch of selection bugs. Removed "spreadsheet" argument (for now.)
2000-05-30 Christopher James Lahey <clahey@helixcode.com>
* e-table-group-container.c, e-table-group-container.h,
e-table-group-leaf.c, e-table-group-leaf.h, e-table-group.c,
e-table-group.h, e-table-item.c, e-table-item.h, e-table.c,
e-table.h, test-check.c, test-cols.c, test-table.c: Fixed a bunch
of selection bugs. Removed "spreadsheet" argument (for now.)
Added "cursor_mode" argument. Added "cursor_change" signal.
Temporarily removed "selection_mode" argument.
svn path=/trunk/; revision=3277
Diffstat (limited to 'widgets/e-table/e-table-group.c')
-rw-r--r-- | widgets/e-table/e-table-group.c | 58 |
1 files changed, 57 insertions, 1 deletions
diff --git a/widgets/e-table/e-table-group.c b/widgets/e-table/e-table-group.c index 90893cfee2..4258640a97 100644 --- a/widgets/e-table/e-table-group.c +++ b/widgets/e-table/e-table-group.c @@ -29,6 +29,7 @@ static GnomeCanvasGroupClass *etg_parent_class; enum { ROW_SELECTION, + CURSOR_CHANGE, DOUBLE_CLICK, LAST_SIGNAL }; @@ -132,6 +133,18 @@ e_table_group_get_count (ETableGroup *etg) return 0; } +gint +e_table_group_row_count (ETableGroup *etg) +{ + g_return_val_if_fail (etg != NULL, 0); + g_return_val_if_fail (E_IS_TABLE_GROUP (etg), 0); + + if (ETG_CLASS (etg)->row_count) + return ETG_CLASS (etg)->row_count (etg); + else + return 0; +} + void e_table_group_increment (ETableGroup *etg, gint position, @@ -156,6 +169,27 @@ e_table_group_set_focus (ETableGroup *etg, ETG_CLASS (etg)->set_focus (etg, direction, row); } +void +e_table_group_select_row (ETableGroup *etg, + gint row) +{ + g_return_if_fail (etg != NULL); + g_return_if_fail (E_IS_TABLE_GROUP (etg)); + + if (ETG_CLASS (etg)->select_row) + ETG_CLASS (etg)->select_row (etg, row); +} + +void +e_table_group_unfocus (ETableGroup *etg) +{ + g_return_if_fail (etg != NULL); + g_return_if_fail (E_IS_TABLE_GROUP (etg)); + + if (ETG_CLASS (etg)->unfocus) + ETG_CLASS (etg)->unfocus (etg); +} + gboolean e_table_group_get_focus (ETableGroup *etg) { @@ -204,6 +238,17 @@ e_table_group_row_selection (ETableGroup *e_table_group, gint row, gboolean sele } void +e_table_group_cursor_change (ETableGroup *e_table_group, gint row) +{ + g_return_if_fail (e_table_group != NULL); + g_return_if_fail (E_IS_TABLE_GROUP (e_table_group)); + + gtk_signal_emit (GTK_OBJECT (e_table_group), + etg_signals [CURSOR_CHANGE], + row); +} + +void e_table_group_double_click (ETableGroup *e_table_group, gint row) { g_return_if_fail (e_table_group != NULL); @@ -263,14 +308,18 @@ etg_class_init (GtkObjectClass *object_class) item_class->event = etg_event; klass->row_selection = NULL; + klass->cursor_change = NULL; klass->double_click = NULL; klass->add = NULL; klass->add_all = NULL; klass->remove = NULL; klass->get_count = NULL; + klass->row_count = NULL; klass->increment = NULL; klass->set_focus = NULL; + klass->select_row = NULL; + klass->unfocus = NULL; klass->get_focus = etg_get_focus; klass->get_ecol = NULL; @@ -284,6 +333,14 @@ etg_class_init (GtkObjectClass *object_class) gtk_marshal_NONE__INT_INT, GTK_TYPE_NONE, 2, GTK_TYPE_INT, GTK_TYPE_INT); + etg_signals [CURSOR_CHANGE] = + gtk_signal_new ("cursor_change", + GTK_RUN_LAST, + object_class->type, + GTK_SIGNAL_OFFSET (ETableGroupClass, cursor_change), + gtk_marshal_NONE__INT, + GTK_TYPE_NONE, 1, GTK_TYPE_INT); + etg_signals [DOUBLE_CLICK] = gtk_signal_new ("double_click", GTK_RUN_LAST, @@ -296,4 +353,3 @@ etg_class_init (GtkObjectClass *object_class) } E_MAKE_TYPE (e_table_group, "ETableGroup", ETableGroup, etg_class_init, NULL, PARENT_TYPE); - |