diff options
author | Miguel de Icaza <miguel@gnu.org> | 1999-12-10 15:36:51 +0800 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1999-12-10 15:36:51 +0800 |
commit | 48618eb6eb0d02a6bc74d19d0241ac6b0849d136 (patch) | |
tree | df66b3707b394dd8737d579f04ec9a401eb2f9b4 /widgets/table/e-cell-text.c | |
parent | 54e2b5022a8eca59e4aac0d5b0d3cb125d54c008 (diff) | |
download | gsoc2013-evolution-48618eb6eb0d02a6bc74d19d0241ac6b0849d136.tar.gz gsoc2013-evolution-48618eb6eb0d02a6bc74d19d0241ac6b0849d136.tar.zst gsoc2013-evolution-48618eb6eb0d02a6bc74d19d0241ac6b0849d136.zip |
fix this routine.
1999-12-09 Miguel de Icaza <miguel@gnu.org>
* e-table-header.c (e_table_header_col_diff): fix this routine.
1999-12-04 Miguel de Icaza <miguel@gnu.org>
* e-table-header-item.c (ethi_event): Started drag and drop
support.
* e-table-item.c (eti_table_model_changed): The columns are
controled by the Header, not by the TableModel.
* e-table-header-item.c (ethi_draw): Fixed redraw logic to support
arbitrary header positioning.
* e-cell.h: Revamped e-cell interface. We now provide the model
column and the view column to all methods (so that the methods can
talk to the view and to the model at the same time).
* e-table-item.c: Update to new API
* e-cell-test.c: Update to new API
1999-12-03 Miguel de Icaza <miguel@gnu.org>
* e-cell.c (e_cell_class_init): Provide emtpy methods for
enter_edit, and leave_edit.
* e-table-item.c: Killed draw cell.
(eti_draw): Perform column mapping here.
(e_table_item_leave_edit): ditto.
(e_table_item_enter_edit): ditto.
(eti_event): ditto.
svn path=/trunk/; revision=1478
Diffstat (limited to 'widgets/table/e-cell-text.c')
-rw-r--r-- | widgets/table/e-cell-text.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c index d9d8a568db..828be6cc29 100644 --- a/widgets/table/e-cell-text.c +++ b/widgets/table/e-cell-text.c @@ -29,7 +29,7 @@ typedef struct { /* * Where the editing is taking place */ - int col, row; + int model_col, view_col, row; } CellEdit; typedef struct { @@ -48,9 +48,9 @@ typedef struct { static ECellClass *parent_class; static void -ect_queue_redraw (ECellTextView *text_view, int col, int row) +ect_queue_redraw (ECellTextView *text_view, int view_col, int view_row) { - e_table_item_redraw_range (text_view->eti, col, row, col, row); + e_table_item_redraw_range (text_view->eti, view_col, view_row, view_col, view_row); } /* @@ -62,7 +62,7 @@ ect_accept_edits (ECellTextView *text_view) const char *text = gtk_entry_get_text (text_view->edit->entry); CellEdit *edit = text_view->edit; - e_table_model_set_value_at (text_view->eti->table_model, edit->col, edit->row, text); + e_table_model_set_value_at (text_view->eti->table_model, edit->model_col, edit->row, text); } /* @@ -92,7 +92,7 @@ ect_stop_editing (ECellTextView *text_view) static void ect_cancel_edit (ECellTextView *text_view) { - ect_queue_redraw (text_view, text_view->edit->col, text_view->edit->row); + ect_queue_redraw (text_view, text_view->edit->view_col, text_view->edit->row); ect_stop_editing (text_view); } @@ -149,14 +149,14 @@ ect_unrealize (ECellView *ecv) */ static void ect_draw (ECellView *ecell_view, GdkDrawable *drawable, - int col, int row, gboolean selected, + int model_col, int view_col, int row, gboolean selected, int x1, int y1, int x2, int y2) { ECellText *ect = E_CELL_TEXT (ecell_view->ecell); ECellTextView *text_view = (ECellTextView *) ecell_view; GtkWidget *w = GTK_WIDGET (text_view->canvas); GdkRectangle rect; - const char *str = e_table_model_value_at (ecell_view->ecell->table_model, col, row); + const char *str = e_table_model_value_at (ecell_view->ecell->table_model, model_col, row); GdkFont *font = text_view->font; const int height = font->ascent + font->descent; int xoff; @@ -168,7 +168,7 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable, if (text_view->edit){ CellEdit *edit = text_view->edit; - if ((edit->col == col) && (edit->row == row)) + if ((edit->view_col == view_col) && (edit->row == row)) edit_display = TRUE; } @@ -312,7 +312,7 @@ ect_edit_select_all (ECellTextView *text_view) * ECell::event method */ static gint -ect_event (ECellView *ecell_view, GdkEvent *event, int col, int row) +ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row) { ECellTextView *text_view = (ECellTextView *) ecell_view; @@ -327,7 +327,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int col, int row) if (text_view->edit){ printf ("FIXME: Should handle click here\n"); } else - e_table_item_enter_edit (text_view->eti, col, row); + e_table_item_enter_edit (text_view->eti, view_col, row); break; case GDK_BUTTON_RELEASE: @@ -345,12 +345,12 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int col, int row) } if (!text_view->edit){ - e_table_item_enter_edit (text_view->eti, col, row); + e_table_item_enter_edit (text_view->eti, view_col, row); ect_edit_select_all (text_view); } gtk_widget_event (GTK_WIDGET (text_view->edit->entry), event); - ect_queue_redraw (text_view, col, row); + ect_queue_redraw (text_view, view_col, row); break; case GDK_KEY_RELEASE: @@ -366,7 +366,7 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int col, int row) * ECell::height method */ static int -ect_height (ECellView *ecell_view, int col, int row) +ect_height (ECellView *ecell_view, int model_col, int view_col, int row) { ECellTextView *text_view = (ECellTextView *) ecell_view; @@ -386,16 +386,17 @@ ect_entry_activate (GtkEntry *entry, ECellTextView *text_view) * ECellView::enter_edit method */ static void * -ect_enter_edit (ECellView *ecell_view, int col, int row) +ect_enter_edit (ECellView *ecell_view, int model_col, int view_col, int row) { ECellTextView *text_view = (ECellTextView *) ecell_view; - const char *str = e_table_model_value_at (ecell_view->ecell->table_model, col, row); + const char *str = e_table_model_value_at (ecell_view->ecell->table_model, model_col, row); CellEdit *edit; edit = g_new (CellEdit, 1); text_view->edit = edit; - edit->col = col; + edit->model_col = model_col; + edit->view_col = view_col; edit->row = row; edit->entry = (GtkEntry *) gtk_entry_new (); @@ -412,7 +413,7 @@ ect_enter_edit (ECellView *ecell_view, int col, int row) gtk_widget_set_uposition (edit->entry_top, 20000, 20000); gtk_widget_show_all (edit->entry_top); - ect_queue_redraw (text_view, col, row); + ect_queue_redraw (text_view, view_col, row); return NULL; } @@ -421,7 +422,7 @@ ect_enter_edit (ECellView *ecell_view, int col, int row) * ECellView::leave_edit method */ static void -ect_leave_edit (ECellView *ecell_view, int col, int row, void *edit_context) +ect_leave_edit (ECellView *ecell_view, int model_col, int view_col, int row, void *edit_context) { ECellTextView *text_view = (ECellTextView *) ecell_view; |