From 48618eb6eb0d02a6bc74d19d0241ac6b0849d136 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Fri, 10 Dec 1999 07:36:51 +0000 Subject: fix this routine. 1999-12-09 Miguel de Icaza * e-table-header.c (e_table_header_col_diff): fix this routine. 1999-12-04 Miguel de Icaza * 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 * 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 --- widgets/table/test-cols.c | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-) (limited to 'widgets/table/test-cols.c') diff --git a/widgets/table/test-cols.c b/widgets/table/test-cols.c index 63033df569..4406c6b3b9 100644 --- a/widgets/table/test-cols.c +++ b/widgets/table/test-cols.c @@ -87,7 +87,7 @@ multi_cols_test (void) { GtkWidget *canvas, *window; ETableModel *e_table_model; - ETableHeader *e_table_header; + ETableHeader *e_table_header, *e_table_header_multiple; ETableCol *col_0, *col_1; ECell *cell_left_just, *cell_image_toggle; int i; @@ -122,13 +122,20 @@ multi_cols_test (void) g_free (images); } - col_0 = e_table_col_new (0, "A", 48, 48, cell_image_toggle, g_int_equal, TRUE); - e_table_header_add_column (e_table_header, col_0, 0); - col_1 = e_table_col_new (1, "Item Name", 180, 20, cell_left_just, g_str_equal, TRUE); - e_table_header_add_column (e_table_header, col_1, 1); + e_table_header_add_column (e_table_header, col_1, 0); + col_0 = e_table_col_new (0, "A", 48, 48, cell_image_toggle, g_int_equal, TRUE); + e_table_header_add_column (e_table_header, col_0, 1); + /* + * Second test + */ + e_table_header_multiple = e_table_header_new (); + e_table_header_add_column (e_table_header_multiple, col_0, 0); + e_table_header_add_column (e_table_header_multiple, col_1, 1); + e_table_header_add_column (e_table_header_multiple, col_1, 2); + /* * GUI */ @@ -140,6 +147,7 @@ multi_cols_test (void) gtk_container_add (GTK_CONTAINER (window), canvas); gtk_widget_show_all (window); + gnome_canvas_item_new ( gnome_canvas_root (GNOME_CANVAS (canvas)), e_table_header_item_get_type (), @@ -160,6 +168,25 @@ multi_cols_test (void) "spreadsheet", TRUE, NULL); + gnome_canvas_item_new ( + gnome_canvas_root (GNOME_CANVAS (canvas)), + e_table_header_item_get_type (), + "ETableHeader", e_table_header_multiple, + "x", 300, + "y", 0, + NULL); + gnome_canvas_item_new ( + gnome_canvas_root (GNOME_CANVAS (canvas)), + e_table_item_get_type (), + "ETableHeader", e_table_header_multiple, + "ETableModel", e_table_model, + "x", 300, + "y", 30, + "drawgrid", TRUE, + "drawfocus", TRUE, + "spreadsheet", TRUE, + NULL); + } -- cgit