diff options
author | Morten Welinder <mortenw@src.gnome.org> | 2001-10-08 22:17:54 +0800 |
---|---|---|
committer | Morten Welinder <mortenw@src.gnome.org> | 2001-10-08 22:17:54 +0800 |
commit | 7d5b83061f8ef709f47a0f7020cf38cd1d9fe197 (patch) | |
tree | 27e0a3ec7f2f8fe32e8431a4ef565182aa629c3e /widgets/table | |
parent | 856ebf12de55fc015d9b6c5b6da888ab9b384a5d (diff) | |
download | gsoc2013-evolution-7d5b83061f8ef709f47a0f7020cf38cd1d9fe197.tar.gz gsoc2013-evolution-7d5b83061f8ef709f47a0f7020cf38cd1d9fe197.tar.zst gsoc2013-evolution-7d5b83061f8ef709f47a0f7020cf38cd1d9fe197.zip |
Partial bit-rot fight. Sample still does not work.
svn path=/trunk/; revision=13498
Diffstat (limited to 'widgets/table')
-rw-r--r-- | widgets/table/e-table-col.c | 1 | ||||
-rw-r--r-- | widgets/table/table-test.c | 2 | ||||
-rw-r--r-- | widgets/table/test-table.c | 64 |
3 files changed, 56 insertions, 11 deletions
diff --git a/widgets/table/e-table-col.c b/widgets/table/e-table-col.c index 9efeedcae7..5eb18ada92 100644 --- a/widgets/table/e-table-col.c +++ b/widgets/table/e-table-col.c @@ -99,6 +99,7 @@ E_MAKE_TYPE(e_table_col, "ETableCol", ETableCol, e_table_col_class_init, e_table * @ecell: the renderer to be used for this column * @compare: comparision function for the elements stored in this column * @resizable: whether the column can be resized interactively by the user + * @priority: FIXME * * The ETableCol represents a column to be used inside an ETable. The * ETableCol objects are inserted inside an ETableHeader (which is just a collection diff --git a/widgets/table/table-test.c b/widgets/table/table-test.c index dd0dee4d24..da60221371 100644 --- a/widgets/table/table-test.c +++ b/widgets/table/table-test.c @@ -9,7 +9,7 @@ #include <string.h> #include <fcntl.h> #include <gnome.h> -#include "gal/e-util/e-cursors.h" +#include "gal/widgets/e-cursors.h" #include "table-test.h" int diff --git a/widgets/table/test-table.c b/widgets/table/test-table.c index 314df1000e..3b8ebc5db9 100644 --- a/widgets/table/test-table.c +++ b/widgets/table/test-table.c @@ -151,6 +151,12 @@ row_count (ETableModel *etc, void *data) return lines; } +static void +append_row (ETableModel *etm, ETableModel *model, int row, void *data) +{ + abort (); +} + static void * value_at (ETableModel *etc, int col, int row, void *data) { @@ -178,6 +184,18 @@ is_cell_editable (ETableModel *etc, int col, int row, void *data) return TRUE; } +static gboolean +has_save_id (ETableModel *etm, void *data) +{ + return FALSE; +} + +static char * +get_save_id (ETableModel *etm, int row, void *data) +{ + abort (); +} + static void * duplicate_value (ETableModel *etc, int col, const void *value, void *data) { @@ -230,8 +248,12 @@ table_browser_test (void) * Data model */ e_table_model = e_table_simple_new ( - col_count, row_count, value_at, - set_value_at, is_cell_editable, + col_count, row_count, append_row, + + value_at, set_value_at, is_cell_editable, + + has_save_id, get_save_id, + duplicate_value, free_value, initialize_value, value_is_empty, value_to_string, @@ -241,13 +263,14 @@ table_browser_test (void) * Header */ e_table_header = e_table_header_new (); - cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); + cell_left_just = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); for (i = 0; i < cols; i++){ ETableCol *ecol = e_table_col_new ( i, column_labels [i], 1.0, 20, cell_left_just, - g_str_compare, TRUE); + g_str_compare, TRUE, + 1); e_table_header_add_column (e_table_header, ecol, i); } @@ -292,7 +315,9 @@ table_browser_test (void) static void save_spec (GtkWidget *button, ETable *e_table) { +#if 0 e_table_save_specification (e_table, "e-table-test.xml"); +#endif } static void @@ -320,7 +345,9 @@ do_e_table_demo (const char *spec) ECell *cell_left_just; ETableHeader *full_header; int i; - + ETableExtras *extras = NULL; + char *state = NULL; + /* * Data model */ @@ -328,29 +355,44 @@ do_e_table_demo (const char *spec) if (e_table_model == NULL) e_table_model = - e_table_simple_new (col_count, row_count, value_at, - set_value_at, is_cell_editable, + e_table_simple_new (col_count, row_count, append_row, + value_at, set_value_at, is_cell_editable, + has_save_id, get_save_id, duplicate_value, free_value, initialize_value, value_is_empty, value_to_string, NULL); full_header = e_table_header_new (); - cell_left_just = e_cell_text_new (e_table_model, NULL, GTK_JUSTIFY_LEFT); + cell_left_just = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); for (i = 0; i < cols; i++){ ETableCol *ecol = e_table_col_new ( i, column_labels [i], 1.0, 20, cell_left_just, - g_str_compare, TRUE); + g_str_compare, TRUE, + 1); e_table_header_add_column (full_header, ecol, i); } + state = "<ETableState> + <column source=\"0\"/> + <column source=\"3\"/> + <column source=\"1\"/> + <column source=\"2\"/> + <grouping> + <group column=\"2\" ascending=\"true\"> + <leaf column=\"1\" ascending=\"true\"/> + </group> + </grouping> + <!-- Column that's been added by hand. Not implemented yet. + <ETableColumn model_col=\"custom-string\" _title=\"Custom\" expansion=\"1.0\" minimum_widgth=\"20\" resizable=\"true\" cell=\"string\" compare=\"string\"/> --> +</ETableState>"; window = gtk_window_new (GTK_WINDOW_TOPLEVEL); frame = gtk_frame_new (NULL); - e_table = e_table_new (full_header, e_table_model, spec); + e_table = e_table_new (e_table_model, extras, spec, state); gtk_signal_connect (GTK_OBJECT(e_table), "row_selection", GTK_SIGNAL_FUNC(row_selection_test), NULL); @@ -375,9 +417,11 @@ do_e_table_demo (const char *spec) gtk_widget_set_usize (window, 200, 200); gtk_widget_show_all (window); +#if 0 if (getenv ("TEST")){ e_table_do_gui_config (NULL, E_TABLE(e_table)); } +#endif } void |