From 1ad76125efe77fe8237c8bdf6dde4f0bacf92f38 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Mon, 31 Jul 2000 22:32:36 +0000 Subject: Added an argument to set a column so that you can't sort by that column. 2000-07-31 Christopher James Lahey * e-table-col.c, e-table-col.h: Added an argument to set a column so that you can't sort by that column. * e-table-header-item.c: Obey the sortable column of ETableCol. svn path=/trunk/; revision=4439 --- widgets/table/e-table-col.c | 43 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 42 insertions(+), 1 deletion(-) (limited to 'widgets/table/e-table-col.c') diff --git a/widgets/table/e-table-col.c b/widgets/table/e-table-col.c index 5a167a8940..e767aa5567 100644 --- a/widgets/table/e-table-col.c +++ b/widgets/table/e-table-col.c @@ -17,6 +17,12 @@ static GtkObjectClass *parent_class; + +enum { + ARG_0, + ARG_SORTABLE, +}; + static void etc_destroy (GtkObject *object) { @@ -31,18 +37,53 @@ etc_destroy (GtkObject *object) (*parent_class->destroy)(object); } - + + +static void +etc_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) +{ + ETableCol *etc = E_TABLE_COL (o); + + switch (arg_id){ + case ARG_SORTABLE: + etc->sortable = GTK_VALUE_BOOL(*arg); + break; + } +} + +static void +etc_get_arg (GtkObject *o, GtkArg *arg, guint arg_id) +{ + ETableCol *etc = E_TABLE_COL (o); + + switch (arg_id){ + case ARG_SORTABLE: + GTK_VALUE_BOOL(*arg) = etc->sortable; + break; + default: + arg->type = GTK_TYPE_INVALID; + break; + } +} + static void e_table_col_class_init (GtkObjectClass *object_class) { parent_class = gtk_type_class (PARENT_TYPE); object_class->destroy = etc_destroy; + object_class->get_arg = etc_get_arg; + object_class->set_arg = etc_set_arg; + + gtk_object_add_arg_type ("ETableCol::sortable", + GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_SORTABLE); } static void e_table_col_init (ETableCol *etc) { etc->width = 0; + etc->sortable = 1; + etc->groupable = 1; } E_MAKE_TYPE(e_table_col, "ETableCol", ETableCol, e_table_col_class_init, e_table_col_init, PARENT_TYPE); -- cgit