diff options
-rw-r--r-- | widgets/e-table/ChangeLog | 5 | ||||
-rw-r--r-- | widgets/e-table/e-table-item.c | 37 | ||||
-rw-r--r-- | widgets/table/e-table-item.c | 37 |
3 files changed, 79 insertions, 0 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog index b515364c3c..b60e7fa106 100644 --- a/widgets/e-table/ChangeLog +++ b/widgets/e-table/ChangeLog @@ -1,3 +1,8 @@ +2000-07-06 Christopher James Lahey <clahey@helixcode.com> + + * e-table-item.c: Send GDK_BUTTON_RELEASE events to the ecell + associated with the cell (if it's the cursor.) + 2000-07-03 Christopher James Lahey <clahey@helixcode.com> * e-table-item.c: Added a reflow_compare callback and did removal diff --git a/widgets/e-table/e-table-item.c b/widgets/e-table/e-table-item.c index 405bf20cb7..a32b0f44de 100644 --- a/widgets/e-table/e-table-item.c +++ b/widgets/e-table/e-table-item.c @@ -1303,6 +1303,43 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } break; } + + case GDK_BUTTON_RELEASE: { + double x1, y1; + int col, row; + + switch (e->button.button) { + case 1: /* Fall through. */ + case 2: + 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; + + if (eti->cursor_row == view_to_model_row(eti, row) && eti->cursor_col == col){ + + ecol = e_table_header_get_column (eti->header, col); + ecell_view = eti->cell_views [col]; + + /* + * Adjust the event positions + */ + e->button.x = x1; + e->button.y = y1; + + e_cell_event (ecell_view, e, ecol->col_idx, col, row); + } + break; + case 3: + case 4: + case 5: + return FALSE; + break; + + } + break; + } case GDK_2BUTTON_PRESS: { double x1, y1; diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index 405bf20cb7..a32b0f44de 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -1303,6 +1303,43 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e) } break; } + + case GDK_BUTTON_RELEASE: { + double x1, y1; + int col, row; + + switch (e->button.button) { + case 1: /* Fall through. */ + case 2: + 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; + + if (eti->cursor_row == view_to_model_row(eti, row) && eti->cursor_col == col){ + + ecol = e_table_header_get_column (eti->header, col); + ecell_view = eti->cell_views [col]; + + /* + * Adjust the event positions + */ + e->button.x = x1; + e->button.y = y1; + + e_cell_event (ecell_view, e, ecol->col_idx, col, row); + } + break; + case 3: + case 4: + case 5: + return FALSE; + break; + + } + break; + } case GDK_2BUTTON_PRESS: { double x1, y1; |