aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-cell-text.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@ximian.com>2001-10-11 04:44:25 +0800
committerChris Lahey <clahey@src.gnome.org>2001-10-11 04:44:25 +0800
commit484c8193e1ae11a967e002b132dd04fa8b4e460d (patch)
tree7f7dca2ac352b4c8ab0cc5b1b372bc356158fef4 /widgets/table/e-cell-text.c
parentd74fe8f60dfecbe1ceaae89f8dad3679907d5738 (diff)
downloadgsoc2013-evolution-484c8193e1ae11a967e002b132dd04fa8b4e460d.tar
gsoc2013-evolution-484c8193e1ae11a967e002b132dd04fa8b4e460d.tar.gz
gsoc2013-evolution-484c8193e1ae11a967e002b132dd04fa8b4e460d.tar.bz2
gsoc2013-evolution-484c8193e1ae11a967e002b132dd04fa8b4e460d.tar.lz
gsoc2013-evolution-484c8193e1ae11a967e002b132dd04fa8b4e460d.tar.xz
gsoc2013-evolution-484c8193e1ae11a967e002b132dd04fa8b4e460d.tar.zst
gsoc2013-evolution-484c8193e1ae11a967e002b132dd04fa8b4e460d.zip
Implement these functions as pass through to the child cell.
2001-10-10 Christopher James Lahey <clahey@ximian.com> * e-cell-popup.c (ecp_get_bg_color), e-cell-tree.c (ect_get_bg_color): Implement these functions as pass through to the child cell. * e-cell-text.c, e-cell-text.h (ect_get_bg_color): Implemented this using a bg_color_column which can be set through the argument of the same string. * e-cell.c, e-cell.h (e_cell_get_bg_color): Added this function to allow background color to change by cell. * e-table-item.c (eti_get_cell_background_color): Call e_cell_get_bg_color to allow background color to change by cell. svn path=/trunk/; revision=13566
Diffstat (limited to 'widgets/table/e-cell-text.c')
-rw-r--r--widgets/table/e-cell-text.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index 0de114d2ab..2894ff30d5 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -69,6 +69,7 @@ enum {
ARG_BOLD_COLUMN,
ARG_COLOR_COLUMN,
ARG_EDITABLE,
+ ARG_BG_COLOR_COLUMN
};
@@ -694,6 +695,27 @@ ect_draw (ECellView *ecell_view, GdkDrawable *drawable,
gdk_gc_set_clip_rectangle (fg_gc, NULL);
}
+
+/*
+ * Get the background color
+ */
+static gchar *
+ect_get_bg_color(ECellView *ecell_view, int row)
+{
+ ECellText *ect = E_CELL_TEXT (ecell_view->ecell);
+ gchar *color_spec;
+
+ if (ect->bg_color_column == -1)
+ return NULL;
+
+ color_spec = e_table_model_value_at (ecell_view->e_table_model,
+ ect->bg_color_column, row);
+
+ return color_spec;
+}
+
+
+
/*
* Selects the entire string
*/
@@ -1330,6 +1352,10 @@ ect_set_arg (GtkObject *object, GtkArg *arg, guint arg_id)
text->editable = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE;
break;
+ case ARG_BG_COLOR_COLUMN:
+ text->bg_color_column = GTK_VALUE_INT (*arg);
+ break;
+
default:
return;
}
@@ -1360,6 +1386,10 @@ ect_get_arg (GtkObject *object, GtkArg *arg, guint arg_id)
GTK_VALUE_BOOL (*arg) = text->editable ? TRUE : FALSE;
break;
+ case ARG_BG_COLOR_COLUMN:
+ GTK_VALUE_INT (*arg) = text->bg_color_column;
+ break;
+
default:
arg->type = GTK_TYPE_INVALID;
break;
@@ -1387,6 +1417,7 @@ e_cell_text_class_init (GtkObjectClass *object_class)
ecc->print_height = ect_print_height;
ecc->max_width = ect_max_width;
ecc->show_tooltip = ect_show_tooltip;
+ ecc->get_bg_color = ect_get_bg_color;
ectc->get_text = ect_real_get_text;
ectc->free_text = ect_real_free_text;
@@ -1404,6 +1435,8 @@ e_cell_text_class_init (GtkObjectClass *object_class)
GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_COLOR_COLUMN);
gtk_object_add_arg_type ("ECellText::editable",
GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_EDITABLE);
+ gtk_object_add_arg_type ("ECellText::bg_color_column",
+ GTK_TYPE_INT, GTK_ARG_READWRITE, ARG_BG_COLOR_COLUMN);
if (!clipboard_atom)
clipboard_atom = gdk_atom_intern ("CLIPBOARD", FALSE);
@@ -1417,6 +1450,7 @@ e_cell_text_init (ECellText *ect)
ect->strikeout_column = -1;
ect->bold_column = -1;
ect->color_column = -1;
+ ect->bg_color_column = -1;
ect->editable = TRUE;
}