diff options
author | Christopher James Lahey <clahey@helixcode.com> | 2000-08-20 07:32:50 +0800 |
---|---|---|
committer | Chris Lahey <clahey@src.gnome.org> | 2000-08-20 07:32:50 +0800 |
commit | 862d1f25dea4fde774aca9b8e849f22b2e0b9d93 (patch) | |
tree | ed6266c92fbee21440085d1a71e258f2cbb18fb9 /widgets/e-table/e-table-subset-variable.c | |
parent | 668e92af992e05e58c714d71943a66a60eb49965 (diff) | |
download | gsoc2013-evolution-862d1f25dea4fde774aca9b8e849f22b2e0b9d93.tar gsoc2013-evolution-862d1f25dea4fde774aca9b8e849f22b2e0b9d93.tar.gz gsoc2013-evolution-862d1f25dea4fde774aca9b8e849f22b2e0b9d93.tar.bz2 gsoc2013-evolution-862d1f25dea4fde774aca9b8e849f22b2e0b9d93.tar.lz gsoc2013-evolution-862d1f25dea4fde774aca9b8e849f22b2e0b9d93.tar.xz gsoc2013-evolution-862d1f25dea4fde774aca9b8e849f22b2e0b9d93.tar.zst gsoc2013-evolution-862d1f25dea4fde774aca9b8e849f22b2e0b9d93.zip |
Made background colors alternate.
2000-08-19 Christopher James Lahey <clahey@helixcode.com>
* e-cell-text.c: Made background colors alternate.
* e-table-click-to-add.c: Made tabbing off the right edge of the
click to add commit the new values.
* e-table-group-container.c, e-table-group-leaf.c,
e-table-group.c, e-table-group.h, e-table-sorted-variable.c,
e-table-subset-variable.c, e-table-subset-variable.h: Added a
decrement method. Made the add and remove methods not
automatically increment and decrement.
* e-table-item.c: Fixed some view vs model issues for both rows
and columns.
* e-table-model.c: Added debugging code. Removed automatic
signalling of changes by the ETableModel set_value_at function
(the model should send these signals itself.)
* e-table.c: Added increment and decrement calls when a row is
removed or added from the source model.
svn path=/trunk/; revision=4881
Diffstat (limited to 'widgets/e-table/e-table-subset-variable.c')
-rw-r--r-- | widgets/e-table/e-table-subset-variable.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/widgets/e-table/e-table-subset-variable.c b/widgets/e-table/e-table-subset-variable.c index f418337092..d429604301 100644 --- a/widgets/e-table/e-table-subset-variable.c +++ b/widgets/e-table/e-table-subset-variable.c @@ -28,7 +28,6 @@ etssv_add (ETableSubsetVariable *etssv, { ETableModel *etm = E_TABLE_MODEL(etssv); ETableSubset *etss = E_TABLE_SUBSET(etssv); - int i; e_table_model_pre_change(etm); @@ -36,10 +35,7 @@ etssv_add (ETableSubsetVariable *etssv, etss->map_table = g_realloc (etss->map_table, (etssv->n_vals_allocated + INCREMENT_AMOUNT) * sizeof(int)); etssv->n_vals_allocated += INCREMENT_AMOUNT; } - if (row < e_table_model_row_count(etss->source) - 1) - for ( i = 0; i < etss->n_map; i++ ) - if (etss->map_table[i] >= row) - etss->map_table[i] ++; + etss->map_table[etss->n_map++] = row; e_table_model_row_inserted (etm, etss->n_map - 1); @@ -73,27 +69,18 @@ etssv_remove (ETableSubsetVariable *etssv, ETableModel *etm = E_TABLE_MODEL(etssv); ETableSubset *etss = E_TABLE_SUBSET(etssv); int i; - int ret_val = FALSE; for (i = 0; i < etss->n_map; i++){ if (etss->map_table[i] == row) { e_table_model_pre_change (etm); memmove (etss->map_table + i, etss->map_table + i + 1, (etss->n_map - i - 1) * sizeof(int)); etss->n_map --; - - e_table_model_changed (etm); - ret_val = TRUE; - break; - } - } - - for (i = 0; i < etss->n_map; i++){ - if (etss->map_table[i] > row) { - etss->map_table[i] --; + + e_table_model_row_deleted (etm, i); + return TRUE; } } - - return ret_val; + return FALSE; } static void @@ -174,13 +161,26 @@ e_table_subset_variable_increment (ETableSubsetVariable *etssv, { int i; ETableSubset *etss = E_TABLE_SUBSET(etssv); - for (i = 0; i < etss->n_map; i++){ + for (i = 0; i < etss->n_map; i++) { if (etss->map_table[i] > position) etss->map_table[i] += amount; } } void +e_table_subset_variable_decrement (ETableSubsetVariable *etssv, + gint position, + gint amount) +{ + int i; + ETableSubset *etss = E_TABLE_SUBSET(etssv); + for (i = 0; i < etss->n_map; i++) { + if (etss->map_table[i] > position) + etss->map_table[i] -= amount; + } +} + +void e_table_subset_variable_set_allocation (ETableSubsetVariable *etssv, gint total) { |