aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-header-item.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnu.org>1999-11-25 16:02:13 +0800
committerArturo Espinosa <unammx@src.gnome.org>1999-11-25 16:02:13 +0800
commit385ccbd512c4c43305dee900f86d0f51f94b1200 (patch)
tree81920b9b2281f21a55ccd417895d0bd3a271cff7 /widgets/table/e-table-header-item.c
parent858500c40a2bf4485e75e1a056d0310b92625929 (diff)
downloadgsoc2013-evolution-385ccbd512c4c43305dee900f86d0f51f94b1200.tar
gsoc2013-evolution-385ccbd512c4c43305dee900f86d0f51f94b1200.tar.gz
gsoc2013-evolution-385ccbd512c4c43305dee900f86d0f51f94b1200.tar.bz2
gsoc2013-evolution-385ccbd512c4c43305dee900f86d0f51f94b1200.tar.lz
gsoc2013-evolution-385ccbd512c4c43305dee900f86d0f51f94b1200.tar.xz
gsoc2013-evolution-385ccbd512c4c43305dee900f86d0f51f94b1200.tar.zst
gsoc2013-evolution-385ccbd512c4c43305dee900f86d0f51f94b1200.zip
Realize cells.
1999-11-25 Miguel de Icaza <miguel@gnu.org> * e-table-header-item.c (ethi_realize): Realize cells. * e-table-item.c (eti_header_dim_changed): redraw before and after. * e-table-header-item.c (ethi_event): Add continuous resizing. 1999-11-24 Miguel de Icaza <miguel@gnu.org> * e-table-subset.h, e-table-subset.c: New files, used to implement subset tables. * e-table-sorted.h, e-table-sorted.c: Now they derive from e-table-subset. * e-cell.c, e-cell.h: realize method now return per view instance data. svn path=/trunk/; revision=1434
Diffstat (limited to 'widgets/table/e-table-header-item.c')
-rw-r--r--widgets/table/e-table-header-item.c39
1 files changed, 31 insertions, 8 deletions
diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c
index dab5d3d71d..ab59d9a01c 100644
--- a/widgets/table/e-table-header-item.c
+++ b/widgets/table/e-table-header-item.c
@@ -157,6 +157,7 @@ ethi_realize (GnomeCanvasItem *item)
ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
GdkWindow *window;
GdkColor c;
+ int i;
if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)-> realize)
(*GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->realize)(item);
@@ -171,13 +172,27 @@ ethi_realize (GnomeCanvasItem *item)
if (!ethi->font)
ethi_font_load (ethi, "fixed");
+
+ /*
+ * Now realize the various ECells
+ */
+ ethi->n_cells = e_table_header_count (ethi->eth);
+ ethi->cell_views = g_new (ECellView *, ethi->n_cells);
+
+ for (i = 0; i < ethi->n_cells; i++){
+ ETableCol *col = e_table_header_get_column (ethi->eth, i);
+
+ ethi->cell_views [i] = e_cell_realize (col->ecell, item->canvas);
+ }
+
}
static void
ethi_unrealize (GnomeCanvasItem *item)
{
ETableHeaderItem *ethi = E_TABLE_HEADER_ITEM (item);
-
+ int i;
+
gdk_gc_unref (ethi->gc);
ethi->gc = NULL;
@@ -187,6 +202,14 @@ ethi_unrealize (GnomeCanvasItem *item)
gdk_cursor_destroy (ethi->normal_cursor);
ethi->normal_cursor = NULL;
+ for (i = 0; i < ethi->n_cells; i++){
+ ETableCol *col = e_table_header_get_column (ethi->eth, i);
+
+ e_cell_unrealize (col->ecell, ethi->cell_views [i]);
+ ethi->cell_views = NULL;
+ }
+ g_free (ethi->cell_views);
+
if (GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->unrealize)
(*GNOME_CANVAS_ITEM_CLASS (ethi_parent_class)->unrealize)(item);
}
@@ -244,8 +267,10 @@ ethi_draw (GnomeCanvasItem *item, GdkDrawable *drawable, int x1, int y1, int wid
total = 0;
x = -x1;
+#if 0
printf ("My coords are: %g %g %g %g\n",
item->x1, item->y1, item->x2, item->y2);
+#endif
for (col = 0; col < cols; col++){
ETableCol *ecol = e_table_header_get_column (ethi->eth, col);
@@ -353,11 +378,6 @@ ethi_end_resize (ETableHeaderItem *ethi, int new_size)
{
e_table_header_set_size (ethi->eth, ethi->resize_col, new_size);
- if (ethi->resize_guide){
-#warning Fix this
- /* gtk_object_destroy (ethi->resize_guide);*/
- ethi->resize_guide = NULL;
- }
ethi->resize_col = -1;
ethi_request_redraw (ethi);
}
@@ -394,9 +414,12 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e)
if (x - ethi->resize_start_pos <= 0)
break;
-
+
+ ethi_request_redraw (ethi);
+
ethi->resize_width = x - ethi->resize_start_pos;
-
+ e_table_header_set_size (ethi->eth, ethi->resize_col, ethi->resize_width);
+
ethi_request_redraw (ethi);
} else
set_cursor (ethi, x);