aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-table-simple.c
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-06-27 08:51:06 +0800
committerChris Lahey <clahey@src.gnome.org>2000-06-27 08:51:06 +0800
commite4de45da5f6021db9a009f112c91e21493a87e1f (patch)
tree8e481cf3ba0b08eede834c97820476a3dd5e87c9 /widgets/table/e-table-simple.c
parent9d5faecef3b9e0f8fff68a2d4ddd9dab91b2f66d (diff)
downloadgsoc2013-evolution-e4de45da5f6021db9a009f112c91e21493a87e1f.tar.gz
gsoc2013-evolution-e4de45da5f6021db9a009f112c91e21493a87e1f.tar.zst
gsoc2013-evolution-e4de45da5f6021db9a009f112c91e21493a87e1f.zip
Calculate height including if clip_height is set to -1.
2000-06-26 Christopher James Lahey <clahey@helixcode.com> * widgets/e-text/e-text.c: Calculate height including if clip_height is set to -1. From addressbook/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * contact-editor/e-contact-editor-categories.c, addressbook/gui/component/e-cardlist-model.c: Added value_to_string handlers. * demo/addressbook-widget.c, demo/demo.c: Removed usage of "x" and "y" arguments. * addressbook/gui/component/addressbook.c: Activated Click To Add and set the click to add message. * addressbook/gui/component/e-addressbook-model.c: Added value_to_string and append_row handlers. * addressbook/gui/component/e-select-names.c: Added a column. From calendar/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * gui/calendar-model.c: Added an #ifdefed value_to_string handler assignment. From camel/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * providers/mbox/camel-mbox-summary.c: Added debugging information. From composer/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added e-msg-composer-select-file.h for make distcheck. From e-util/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added e-canvas-vbox.c and e-canvas-vbox.h. * e-canvas-vbox.c, e-canvas-vbox.h: New canvas object to act like a vbox using the reflow system. From mail/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * message-list.c: Added a value_to_string handler. From shell/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * glade/Makefile.am: Added EXTRA_DIST for make distcheck. From widgets/e-table/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added e-table-click-to-add.c, e-table-click-to-add.h, e-table-one.c, and e-table-one.h. * e-table-click-to-add.c, e-table-click-to-add.h: A new canvas item that represents a single row that sometimes exists. It's for adding new rows to your table. * e-table-example-1.c, e-table-example-2.c, e-table-size-test.c, test-check.c, test-cols.c, test-table.c: Added value_to_string handlers. * e-table-group-container.c: Use value_to_string to make grouping not crash for non string columns. Made some changes to work properly in an ECanvasVbox. * e-table-group-leaf.c, e-table-item.c: Made some changes to work properly in an ECanvasVbox. * e-table-model.c, e-table-model.h: Added append_row and value_to_string methods. * e-table-one.c, e-table-one.h: Given a source ETableModel, this provides a single row model that uses the initialize_value, duplicate_value, free_value, and value_is_empty methods of the original source to implement set_value and value_at (and proxies most of the other methods.) This is used for ETableClickToAdd. * e-table-simple.c, e-table-simple.h: Added append_row and value_to_string handlers. append_row uses a GtkArg instead of a parameter to e_table_simple_new. * e-table-subset.c: Added append_row and value_to_string handlers. * e-table.c, e-table.h: Use a vbox containing an ETableClickToAdd and an ETableItem instead of an ETableItem directly. Only show the ETableClickToAdd if the top level of the xml SPEC has the attribute click-to-add set to some non-zero integer. (click-to-add="1"). Add a "click_to_add_message" argument. * e-tree-model.c: Add a commented out value_to_string handler. From widgets/meeting-time-sel/ChangeLog: 2000-06-26 Christopher James Lahey <clahey@helixcode.com> * Makefile.am: Added the include path to top_srcdir. svn path=/trunk/; revision=3744
Diffstat (limited to 'widgets/table/e-table-simple.c')
-rw-r--r--widgets/table/e-table-simple.c63
1 files changed, 63 insertions, 0 deletions
diff --git a/widgets/table/e-table-simple.c b/widgets/table/e-table-simple.c
index e823e8d550..fa0a25f784 100644
--- a/widgets/table/e-table-simple.c
+++ b/widgets/table/e-table-simple.c
@@ -13,6 +13,11 @@
#include <config.h>
#include "e-table-simple.h"
+enum {
+ ARG_0,
+ ARG_APPEND_ROW,
+};
+
#define PARENT_TYPE e_table_model_get_type ()
static int
@@ -111,11 +116,62 @@ simple_value_is_empty (ETableModel *etm, int col, const void *value)
return FALSE;
}
+static char *
+simple_value_to_string (ETableModel *etm, int col, const void *value)
+{
+ ETableSimple *simple = E_TABLE_SIMPLE(etm);
+
+ if (simple->value_to_string)
+ return simple->value_to_string (etm, col, value, simple->data);
+ else
+ return g_strdup ("");
+}
+
+static int
+simple_append_row (ETableModel *etm)
+{
+ ETableSimple *simple = E_TABLE_SIMPLE(etm);
+
+ if (simple->append_row)
+ return simple->append_row (etm, simple->data);
+ else
+ return -1;
+}
+
+static void
+simple_get_arg (GtkObject *o, GtkArg *arg, guint arg_id)
+{
+ ETableSimple *simple = E_TABLE_SIMPLE (o);
+
+ switch (arg_id){
+ case ARG_APPEND_ROW:
+ GTK_VALUE_POINTER(*arg) = simple->append_row;
+ break;
+ }
+}
+
+static void
+simple_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
+{
+ ETableSimple *simple = E_TABLE_SIMPLE (o);
+
+ switch (arg_id){
+ case ARG_APPEND_ROW:
+ simple->append_row = GTK_VALUE_POINTER(*arg);
+ break;
+ default:
+ arg->type = GTK_TYPE_INVALID;
+ }
+}
+
static void
e_table_simple_class_init (GtkObjectClass *object_class)
{
ETableModelClass *model_class = (ETableModelClass *) object_class;
+ object_class->set_arg = simple_set_arg;
+ object_class->get_arg = simple_get_arg;
+
model_class->column_count = simple_column_count;
model_class->row_count = simple_row_count;
model_class->value_at = simple_value_at;
@@ -125,6 +181,11 @@ e_table_simple_class_init (GtkObjectClass *object_class)
model_class->free_value = simple_free_value;
model_class->initialize_value = simple_initialize_value;
model_class->value_is_empty = simple_value_is_empty;
+ model_class->value_to_string = simple_value_to_string;
+ model_class->append_row = simple_append_row;
+
+ gtk_object_add_arg_type ("ETableSimple::append_row", GTK_TYPE_POINTER,
+ GTK_ARG_READWRITE, ARG_APPEND_ROW);
}
GtkType
@@ -160,6 +221,7 @@ e_table_simple_new (ETableSimpleColumnCountFn col_count,
ETableSimpleFreeValueFn free_value,
ETableSimpleInitializeValueFn initialize_value,
ETableSimpleValueIsEmptyFn value_is_empty,
+ ETableSimpleValueToStringFn value_to_string,
void *data)
{
ETableSimple *et;
@@ -175,6 +237,7 @@ e_table_simple_new (ETableSimpleColumnCountFn col_count,
et->free_value = free_value;
et->initialize_value = initialize_value;
et->value_is_empty = value_is_empty;
+ et->value_to_string = value_to_string;
et->data = data;
return (ETableModel *) et;