From 14e38f068da7255d7df240269d2b4f955315031f Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Wed, 11 Oct 2000 11:36:44 +0000 Subject: Updated to use the new ETable specification stuff. 2000-10-11 Christopher James Lahey * gui/e-calendar-table.c: Updated to use the new ETable specification stuff. svn path=/trunk/; revision=5846 --- calendar/gui/e-calendar-table.c | 81 +++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 51 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index 3d72b8f18a..250b03e1de 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -134,35 +134,37 @@ e_calendar_table_class_init (ECalendarTableClass *class) #define E_CALENDAR_TABLE_SPEC \ - "" \ - "" \ + " draw-grid=\"true\"" \ + "" \ + "" \ + "" \ + "" \ + "" \ + "" \ + "" \ + "" \ + "" \ + "" \ + "" \ + "" \ + "" \ + "" \ + "" \ + "" \ " 13 " \ " 9 " \ " 14 " \ - "" \ - " " \ + " " \ + "" \ "" -/* Creates a text column for the table header */ -static void -create_column (ETableHeader *header, ETableModel *model, int id, const char *text) -{ - ECell *cell; - ETableCol *column; - - cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); - column = e_table_col_new (id, text, 1.0, 10, cell, g_str_compare, TRUE); - e_table_header_add_column (header, column, id); -} - static void e_calendar_table_init (ECalendarTable *cal_table) { GtkWidget *table; ETableModel *model; - ETableHeader *header; ECell *cell; - ETableCol *column; + ETableExtras *extras; gint i; GdkPixbuf *pixbuf; GdkColormap *colormap; @@ -188,35 +190,17 @@ e_calendar_table_init (ECalendarTable *cal_table) cal_table->model = calendar_model_new (); model = E_TABLE_MODEL (cal_table->model); - header = e_table_header_new (); - gtk_object_ref (GTK_OBJECT (header)); - gtk_object_sink (GTK_OBJECT (header)); - /* Create the header columns */ - create_column (header, model, CAL_COMPONENT_FIELD_CATEGORIES, _("Categories")); - create_column (header, model, CAL_COMPONENT_FIELD_CLASSIFICATION, _("Classification")); - create_column (header, model, CAL_COMPONENT_FIELD_COMPLETED, _("Completion date")); - create_column (header, model, CAL_COMPONENT_FIELD_DTEND, _("End date")); - create_column (header, model, CAL_COMPONENT_FIELD_DTSTART, _("Start date")); - create_column (header, model, CAL_COMPONENT_FIELD_DUE, _("Due date")); - create_column (header, model, CAL_COMPONENT_FIELD_GEO, _("Geographical position")); - create_column (header, model, CAL_COMPONENT_FIELD_PERCENT, _("Percent complete")); - create_column (header, model, CAL_COMPONENT_FIELD_PRIORITY, _("Priority")); - - cell = e_cell_text_new (model, NULL, GTK_JUSTIFY_LEFT); + + extras = e_table_extras_new(); + + cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); gtk_object_set (GTK_OBJECT (cell), "strikeout_column", CAL_COMPONENT_FIELD_COMPLETE, "bold_column", CAL_COMPONENT_FIELD_OVERDUE, "color_column", CAL_COMPONENT_FIELD_COLOR, NULL); - column = e_table_col_new (CAL_COMPONENT_FIELD_SUMMARY, _("Summary"), - 1.0, 10, cell, g_str_compare, TRUE); - e_table_header_add_column (header, column, CAL_COMPONENT_FIELD_SUMMARY); - - create_column (header, model, CAL_COMPONENT_FIELD_TRANSPARENCY, _("Transparency")); - create_column (header, model, CAL_COMPONENT_FIELD_URL, _("URL")); - - create_column (header, model, CAL_COMPONENT_FIELD_HAS_ALARMS, _("Alarms")); + e_table_extras_add_cell(extras, "summary", cell); /* Create pixmaps */ @@ -227,21 +211,16 @@ e_calendar_table_init (ECalendarTable *cal_table) } cell = e_cell_toggle_new (0, E_CALENDAR_MODEL_NUM_ICONS, icon_pixbufs); - column = e_table_col_new_with_pixbuf (CAL_COMPONENT_FIELD_ICON, - icon_pixbufs[0], 0.0, 16, cell, - g_int_compare, FALSE); - e_table_header_add_column (header, column, CAL_COMPONENT_FIELD_ICON); + e_table_extras_add_cell(extras, "icon", cell); + e_table_extras_add_pixbuf(extras, "icon", icon_pixbufs[0]); - cell = e_cell_checkbox_new (); pixbuf = gdk_pixbuf_new_from_xpm_data ((const char **) check_filled_xpm); - column = e_table_col_new_with_pixbuf (CAL_COMPONENT_FIELD_COMPLETE, - pixbuf, 0.0, 16, cell, - g_int_compare, FALSE); - e_table_header_add_column (header, column, CAL_COMPONENT_FIELD_COMPLETE); + e_table_extras_add_pixbuf(extras, "complete", pixbuf); + gdk_pixbuf_unref(pixbuf); /* Create the table */ - table = e_table_scrolled_new (header, model, E_CALENDAR_TABLE_SPEC); + table = e_table_scrolled_new (model, extras, E_CALENDAR_TABLE_SPEC, NULL); gtk_object_set (GTK_OBJECT (table), "click_to_add_message", "Click here to add a new Task", NULL); -- cgit