aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher James Lahey <clahey@helixcode.com>2000-10-11 17:40:22 +0800
committerChris Lahey <clahey@src.gnome.org>2000-10-11 17:40:22 +0800
commit8d310c47bd10416b7b4eca88b04664d8e903b549 (patch)
treed3968a042c420e93e4d2e715276b51a6cabb06bc
parentabbd11d2aa07bb781026c54d3394eb508c3c279c (diff)
downloadgsoc2013-evolution-8d310c47bd10416b7b4eca88b04664d8e903b549.tar.gz
gsoc2013-evolution-8d310c47bd10416b7b4eca88b04664d8e903b549.tar.zst
gsoc2013-evolution-8d310c47bd10416b7b4eca88b04664d8e903b549.zip
Changed these to use the default cells.
2000-10-11 Christopher James Lahey <clahey@helixcode.com> * tests/test-tree-1.c, tests/test-tree-2.c, tests/test-tree-3.c: Changed these to use the default cells. From gal/e-table/ChangeLog: 2000-10-11 Christopher James Lahey <clahey@helixcode.com> * e-cell-text.c, e-cell-text.h, e-cell-tree.c, e-cell-tree.h: Got rid of the model parameter to e_cell_text_new and e_cell_tree_new as they aren't used. * e-table-extras.c: Added default "integer" compare and default "tree-string", "string", and "checkbox" cells. * e-table.c: Made this use the draw-grid, cursor-mode, and _click-to-add-message fields from the xml. svn path=/trunk/; revision=5841
-rw-r--r--widgets/table/e-cell-text.c2
-rw-r--r--widgets/table/e-cell-text.h2
-rw-r--r--widgets/table/e-cell-tree.c3
-rw-r--r--widgets/table/e-cell-tree.h3
-rw-r--r--widgets/table/e-table-extras.c6
-rw-r--r--widgets/table/e-table.c47
6 files changed, 13 insertions, 50 deletions
diff --git a/widgets/table/e-cell-text.c b/widgets/table/e-cell-text.c
index a8d2fa2a92..07b543808a 100644
--- a/widgets/table/e-cell-text.c
+++ b/widgets/table/e-cell-text.c
@@ -1607,7 +1607,7 @@ e_cell_text_init (ECellText *ect)
E_MAKE_TYPE(e_cell_text, "ECellText", ECellText, e_cell_text_class_init, e_cell_text_init, PARENT_TYPE);
ECell *
-e_cell_text_new (ETableModel *etm, const char *fontname, GtkJustification justify)
+e_cell_text_new (const char *fontname, GtkJustification justify)
{
ECellText *ect = gtk_type_new (e_cell_text_get_type ());
diff --git a/widgets/table/e-cell-text.h b/widgets/table/e-cell-text.h
index 32bcd148e8..ef3ffeab35 100644
--- a/widgets/table/e-cell-text.h
+++ b/widgets/table/e-cell-text.h
@@ -70,7 +70,7 @@ typedef struct {
} ECellTextClass;
GtkType e_cell_text_get_type (void);
-ECell *e_cell_text_new (ETableModel *model, const char *fontname, GtkJustification justify);
+ECell *e_cell_text_new (const char *fontname, GtkJustification justify);
#endif /* _E_CELL_TEXT_H_ */
diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c
index 1602d11eb3..8861399c3e 100644
--- a/widgets/table/e-cell-tree.c
+++ b/widgets/table/e-cell-tree.c
@@ -635,8 +635,7 @@ e_cell_tree_construct (ECellTree *ect,
ECell *
-e_cell_tree_new (ETableModel *etm,
- GdkPixbuf *open_pixbuf,
+e_cell_tree_new (GdkPixbuf *open_pixbuf,
GdkPixbuf *closed_pixbuf,
gboolean draw_lines,
ECell *subcell)
diff --git a/widgets/table/e-cell-tree.h b/widgets/table/e-cell-tree.h
index 6eb67a8dbc..301a3ea2a5 100644
--- a/widgets/table/e-cell-tree.h
+++ b/widgets/table/e-cell-tree.h
@@ -32,8 +32,7 @@ typedef struct {
} ECellTreeClass;
GtkType e_cell_tree_get_type (void);
-ECell *e_cell_tree_new (ETableModel *model,
- GdkPixbuf *open_pixbuf,
+ECell *e_cell_tree_new (GdkPixbuf *open_pixbuf,
GdkPixbuf *closed_pixbuf,
gboolean draw_lines,
ECell *subcell);
diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c
index c9d6545d97..d4b2fda12b 100644
--- a/widgets/table/e-table-extras.c
+++ b/widgets/table/e-table-extras.c
@@ -13,6 +13,7 @@
#include "gal/util/e-util.h"
#include "gal/e-table/e-cell-text.h"
#include "gal/e-table/e-cell-checkbox.h"
+#include "gal/e-table/e-cell-tree.h"
#include "e-table-extras.h"
#define PARENT_TYPE (gtk_object_get_type())
@@ -75,6 +76,11 @@ ete_init (ETableExtras *extras)
extras->pixbufs = g_hash_table_new(g_str_hash, g_str_equal);
e_table_extras_add_compare(extras, "string", g_str_compare);
+ e_table_extras_add_compare(extras, "integer", g_int_compare);
+
+ e_table_extras_add_cell(extras, "checkbox", e_cell_checkbox_new());
+ e_table_extras_add_cell(extras, "string", e_cell_text_new (NULL, GTK_JUSTIFY_LEFT));
+ e_table_extras_add_cell(extras, "tree-string", e_cell_tree_new (NULL, NULL, TRUE, e_cell_text_new (NULL, GTK_JUSTIFY_LEFT)));
}
E_MAKE_TYPE(e_table_extras, "ETableExtras", ETableExtras, ete_class_init, ete_init, PARENT_TYPE);
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index 2e14d0374c..feea12d0e5 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -61,11 +61,8 @@ enum {
enum {
ARG_0,
- ARG_TABLE_DRAW_GRID,
ARG_TABLE_DRAW_FOCUS,
- ARG_CURSOR_MODE,
ARG_LENGTH_THRESHOLD,
- ARG_CLICK_TO_ADD_MESSAGE,
};
static gint et_signals [LAST_SIGNAL] = { 0, };
@@ -759,6 +756,9 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete,
ete = e_table_extras_new();
e_table->use_click_to_add = specification->click_to_add;
+ e_table->click_to_add_message = g_strdup(specification->click_to_add_message_);
+ e_table->draw_grid = specification->draw_grid;
+ e_table->cursor_mode = specification->cursor_mode;
e_table->full_header = et_spec_to_full_header(e_table, specification, ete);
e_table->model = etm;
@@ -1136,17 +1136,9 @@ et_get_arg (GtkObject *o, GtkArg *arg, guint arg_id)
ETable *etable = E_TABLE (o);
switch (arg_id){
- case ARG_TABLE_DRAW_GRID:
- GTK_VALUE_BOOL (*arg) = etable->draw_grid;
- break;
-
case ARG_TABLE_DRAW_FOCUS:
GTK_VALUE_BOOL (*arg) = etable->draw_focus;
break;
-
- case ARG_CLICK_TO_ADD_MESSAGE:
- GTK_VALUE_STRING (*arg) = g_strdup (etable->click_to_add_message);
- break;
}
}
@@ -1170,15 +1162,6 @@ et_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
}
break;
- case ARG_TABLE_DRAW_GRID:
- etable->draw_grid = GTK_VALUE_BOOL (*arg);
- if (etable->group) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etable->group),
- "drawgrid", GTK_VALUE_BOOL (*arg),
- NULL);
- }
- break;
-
case ARG_TABLE_DRAW_FOCUS:
etable->draw_focus = GTK_VALUE_BOOL (*arg);
if (etable->group) {
@@ -1187,24 +1170,6 @@ et_set_arg (GtkObject *o, GtkArg *arg, guint arg_id)
NULL);
}
break;
-
- case ARG_CURSOR_MODE:
- etable->cursor_mode = GTK_VALUE_INT (*arg);
- if (etable->group) {
- gnome_canvas_item_set (GNOME_CANVAS_ITEM(etable->group),
- "cursor_mode", GTK_VALUE_INT (*arg),
- NULL);
- }
- break;
- case ARG_CLICK_TO_ADD_MESSAGE:
- if (etable->click_to_add_message)
- g_free(etable->click_to_add_message);
- etable->click_to_add_message = g_strdup(GTK_VALUE_STRING (*arg));
- if (etable->click_to_add)
- gnome_canvas_item_set(etable->click_to_add,
- "message", etable->click_to_add_message,
- NULL);
- break;
}
}
@@ -1989,16 +1954,10 @@ e_table_class_init (GtkObjectClass *object_class)
gtk_marshal_NONE__POINTER_POINTER,
GTK_TYPE_NONE, 2, GTK_TYPE_ADJUSTMENT, GTK_TYPE_ADJUSTMENT);
- gtk_object_add_arg_type ("ETable::drawgrid", GTK_TYPE_BOOL,
- GTK_ARG_READWRITE, ARG_TABLE_DRAW_GRID);
gtk_object_add_arg_type ("ETable::drawfocus", GTK_TYPE_BOOL,
GTK_ARG_READWRITE, ARG_TABLE_DRAW_FOCUS);
- gtk_object_add_arg_type ("ETable::cursor_mode", GTK_TYPE_INT,
- GTK_ARG_WRITABLE, ARG_CURSOR_MODE);
gtk_object_add_arg_type ("ETable::length_threshold", GTK_TYPE_INT,
GTK_ARG_WRITABLE, ARG_LENGTH_THRESHOLD);
- gtk_object_add_arg_type ("ETable::click_to_add_message", GTK_TYPE_STRING,
- GTK_ARG_READWRITE, ARG_CLICK_TO_ADD_MESSAGE);
}
E_MAKE_TYPE(e_table, "ETable", ETable, e_table_class_init, e_table_init, PARENT_TYPE);