From 62ca9f5fd718312c9ce4af70c9ecd0f2ab2b5fcd Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Wed, 9 Aug 2000 19:40:04 +0000 Subject: Make right click select if the current row is not selected. 2000-08-09 Christopher James Lahey * e-table-item.c, e-table-selection-model.c, e-table-selection-model.h: Make right click select if the current row is not selected. svn path=/trunk/; revision=4658 --- widgets/table/e-table-item.c | 2 ++ widgets/table/e-table-selection-model.c | 13 +++++++++++++ widgets/table/e-table-selection-model.h | 4 ++++ 3 files changed, 19 insertions(+) (limited to 'widgets/table') diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index baee6586f7..19a146de25 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -1417,6 +1417,8 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) gnome_canvas_item_w2i (item, &e->button.x, &e->button.y); if (!find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1)) return TRUE; + + e_table_selection_model_maybe_do_something(eti->selection, row, col, 0); gtk_signal_emit (GTK_OBJECT (eti), eti_signals [RIGHT_CLICK], row, col, e, &return_val); diff --git a/widgets/table/e-table-selection-model.c b/widgets/table/e-table-selection-model.c index a40298c992..09b1d6bf93 100644 --- a/widgets/table/e-table-selection-model.c +++ b/widgets/table/e-table-selection-model.c @@ -446,6 +446,19 @@ void e_table_selection_model_do_something (ETableSelectionModel } } +void e_table_selection_model_maybe_do_something (ETableSelectionModel *selection, + guint row, + guint col, + GdkModifierType state) +{ + if (e_table_selection_model_is_row_selected(selection, row)) { + selection->cursor_row = row; + selection->cursor_col = col; + } else { + e_table_selection_model_do_something(selection, row, col, state); + } +} + void e_table_selection_model_clear(ETableSelectionModel *selection) { diff --git a/widgets/table/e-table-selection-model.h b/widgets/table/e-table-selection-model.h index df2e377d14..6b57ab56f0 100644 --- a/widgets/table/e-table-selection-model.h +++ b/widgets/table/e-table-selection-model.h @@ -58,6 +58,10 @@ void e_table_selection_model_do_something (ETableSelectionModel * guint row, guint col, GdkModifierType state); +void e_table_selection_model_maybe_do_something (ETableSelectionModel *selection, + guint row, + guint col, + GdkModifierType state); void e_table_selection_model_clear (ETableSelectionModel *selection); ETableSelectionModel *e_table_selection_model_new (void); -- cgit v1.2.3