From 84dc532fd9b4cffedbb4dfc33a9513f8b443a857 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Tue, 30 Oct 2001 07:25:22 +0000 Subject: Bumped the version number here to 0.15.99.9. 2001-10-30 Christopher James Lahey * configure.in: Bumped the version number here to 0.15.99.9. From gal/e-table/ChangeLog: 2001-10-30 Christopher James Lahey * e-cell-combo.c: Adapt to the changed popup signature. * e-cell-popup.c, e-cell-popup.h: Changed the behavior here to draw the button whenever we have the cursor. Changed the popup virtual method to pass in the row and column popping up. * e-cell.h: Added an E_CELL_CURSOR flag. * e-table-item.c: Pass in the E_CELL_CURSOR flag to event and draw calls as appropriate. svn path=/trunk/; revision=14439 --- widgets/table/e-cell-popup.c | 37 ++++++++++++++++--------------------- 1 file changed, 16 insertions(+), 21 deletions(-) (limited to 'widgets/table/e-cell-popup.c') diff --git a/widgets/table/e-cell-popup.c b/widgets/table/e-cell-popup.c index e398dc0abc..48b445a661 100644 --- a/widgets/table/e-cell-popup.c +++ b/widgets/table/e-cell-popup.c @@ -106,7 +106,9 @@ static void ecp_show_tooltip (ECellView *ecv, static char *ecp_get_bg_color (ECellView *ecell_view, int row); static gint e_cell_popup_do_popup (ECellPopupView *ecp_view, - GdkEvent *event); + GdkEvent *event, + int row, + int model_col); static ECellClass *parent_class; @@ -257,27 +259,22 @@ ecp_draw (ECellView *ecv, GdkDrawable *drawable, int x1, int y1, int x2, int y2) { ECellPopup *ecp = E_CELL_POPUP (ecv->ecell); - ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view); ECellPopupView *ecp_view = (ECellPopupView *) ecv; GtkWidget *canvas = GTK_WIDGET (GNOME_CANVAS_ITEM (ecv->e_table_item_view)->canvas); GtkShadowType shadow; GdkRectangle rect; gboolean show_popup_arrow = FALSE; - /* Display the popup arrow if we are editing this cell, or the popup + /* Display the popup arrow if we are the cursor cell, or the popup is shown for this cell. */ - if (eti->editing_col == view_col && eti->editing_row == row) { + if (flags & E_CELL_CURSOR) { show_popup_arrow = TRUE; ecp->popup_arrow_shown = TRUE; - } else if (ecp->popup_shown && ecp->popup_view_col == view_col && ecp->popup_row == row) { show_popup_arrow = TRUE; } - if (eti->editing_col == -1) - ecp->popup_arrow_shown = FALSE; - #if 0 g_print ("In ecp_draw row:%i col: %i %i,%i %i,%i Show Arrow:%i\n", row, view_col, x1, y1, x2, y2, show_popup_arrow); @@ -331,7 +328,7 @@ ecp_event (ECellView *ecv, GdkEvent *event, int model_col, int view_col, switch (event->type) { case GDK_BUTTON_PRESS: - if (eti->editing_col == view_col && eti->editing_row == row + if (flags & E_CELL_CURSOR && ecp->popup_arrow_shown) { width = e_table_header_col_diff (eti->header, view_col, view_col + 1); @@ -342,7 +339,7 @@ ecp_event (ECellView *ecv, GdkEvent *event, int model_col, int view_col, /* FIXME: The event coords seem to be relative to the text within the cell, so we have to add 4. */ if (event->button.x + 4 >= width - E_CELL_POPUP_ARROW_WIDTH) { - return e_cell_popup_do_popup (ecp_view, event); + return e_cell_popup_do_popup (ecp_view, event, row, view_col); } } break; @@ -352,7 +349,7 @@ ecp_event (ECellView *ecv, GdkEvent *event, int model_col, int view_col, if (event->key.state & GDK_MOD1_MASK && event->key.keyval == GDK_Down) { g_print ("## Alt-Down pressed\n"); - return e_cell_popup_do_popup (ecp_view, event); + return e_cell_popup_do_popup (ecp_view, event, row, view_col); } g_print ("Key Press Event ECellPopup\n"); break; @@ -384,17 +381,10 @@ static void * ecp_enter_edit (ECellView *ecv, int model_col, int view_col, int row) { ECellPopupView *ecp_view = (ECellPopupView *) ecv; - ECellPopup *ecp = E_CELL_POPUP (ecp_view->cell_view.ecell); g_print ("In ecp_enter_edit model_col: %i view_col: %i row: %i\n", model_col, view_col, row); - if (ecp->popup_view_col != view_col || ecp->popup_row != row) - ecp->popup_arrow_shown = FALSE; - - ecp->popup_view_col = view_col; - ecp->popup_row = row; - return e_cell_enter_edit (ecp_view->child_view, model_col, view_col, row); } @@ -499,14 +489,19 @@ e_cell_popup_set_child (ECellPopup *ecp, static gint e_cell_popup_do_popup (ECellPopupView *ecp_view, - GdkEvent *event) + GdkEvent *event, + int row, + int view_col) { ECellPopup *ecp = E_CELL_POPUP (ecp_view->cell_view.ecell); - gint (*popup_func) (ECellPopup *ecp, GdkEvent *event); + gint (*popup_func) (ECellPopup *ecp, GdkEvent *event, int row, int view_col); ecp->popup_cell_view = ecp_view; popup_func = E_CELL_POPUP_CLASS (GTK_OBJECT (ecp)->klass)->popup; - return popup_func ? popup_func (ecp, event) : FALSE; + ecp->popup_view_col = view_col; + ecp->popup_row = row; + + return popup_func ? popup_func (ecp, event, row, view_col) : FALSE; } -- cgit v1.2.3