aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-cell-toggle.c
diff options
context:
space:
mode:
authorMiguel de Icaza <miguel@gnu.org>1999-12-10 15:36:51 +0800
committerArturo Espinosa <unammx@src.gnome.org>1999-12-10 15:36:51 +0800
commit48618eb6eb0d02a6bc74d19d0241ac6b0849d136 (patch)
treedf66b3707b394dd8737d579f04ec9a401eb2f9b4 /widgets/table/e-cell-toggle.c
parent54e2b5022a8eca59e4aac0d5b0d3cb125d54c008 (diff)
downloadgsoc2013-evolution-48618eb6eb0d02a6bc74d19d0241ac6b0849d136.tar
gsoc2013-evolution-48618eb6eb0d02a6bc74d19d0241ac6b0849d136.tar.gz
gsoc2013-evolution-48618eb6eb0d02a6bc74d19d0241ac6b0849d136.tar.bz2
gsoc2013-evolution-48618eb6eb0d02a6bc74d19d0241ac6b0849d136.tar.lz
gsoc2013-evolution-48618eb6eb0d02a6bc74d19d0241ac6b0849d136.tar.xz
gsoc2013-evolution-48618eb6eb0d02a6bc74d19d0241ac6b0849d136.tar.zst
gsoc2013-evolution-48618eb6eb0d02a6bc74d19d0241ac6b0849d136.zip
fix this routine.
1999-12-09 Miguel de Icaza <miguel@gnu.org> * e-table-header.c (e_table_header_col_diff): fix this routine. 1999-12-04 Miguel de Icaza <miguel@gnu.org> * e-table-header-item.c (ethi_event): Started drag and drop support. * e-table-item.c (eti_table_model_changed): The columns are controled by the Header, not by the TableModel. * e-table-header-item.c (ethi_draw): Fixed redraw logic to support arbitrary header positioning. * e-cell.h: Revamped e-cell interface. We now provide the model column and the view column to all methods (so that the methods can talk to the view and to the model at the same time). * e-table-item.c: Update to new API * e-cell-test.c: Update to new API 1999-12-03 Miguel de Icaza <miguel@gnu.org> * e-cell.c (e_cell_class_init): Provide emtpy methods for enter_edit, and leave_edit. * e-table-item.c: Killed draw cell. (eti_draw): Perform column mapping here. (e_table_item_leave_edit): ditto. (e_table_item_enter_edit): ditto. (eti_event): ditto. svn path=/trunk/; revision=1478
Diffstat (limited to 'widgets/table/e-cell-toggle.c')
-rw-r--r--widgets/table/e-cell-toggle.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c
index 8e06d8d87d..ec6fa38a38 100644
--- a/widgets/table/e-cell-toggle.c
+++ b/widgets/table/e-cell-toggle.c
@@ -29,9 +29,9 @@ typedef struct {
static ECellClass *parent_class;
static void
-etog_queue_redraw (ECellToggleView *text_view, int col, int row)
+etog_queue_redraw (ECellToggleView *text_view, int view_col, int view_row)
{
- e_table_item_redraw_range (text_view->eti, col, row, col, row);
+ e_table_item_redraw_range (text_view->eti, view_col, view_row, view_col, view_row);
}
/*
@@ -40,7 +40,6 @@ etog_queue_redraw (ECellToggleView *text_view, int col, int row)
static ECellView *
etog_realize (ECell *ecell, void *view)
{
- ECellToggle *eccb = E_CELL_TOGGLE (ecell);
ECellToggleView *toggle_view = g_new0 (ECellToggleView, 1);
ETableItem *eti = E_TABLE_ITEM (view);
GnomeCanvas *canvas = GNOME_CANVAS_ITEM (eti)->canvas;
@@ -72,7 +71,7 @@ etog_unrealize (ECellView *ecv)
*/
static void
etog_draw (ECellView *ecell_view, GdkDrawable *drawable,
- int col, int row, gboolean selected,
+ int model_col, int view_col, int row, gboolean selected,
int x1, int y1, int x2, int y2)
{
ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell);
@@ -80,9 +79,8 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable,
GdkPixbuf *image;
ArtPixBuf *art;
int x, y, width, height;
- gboolean free_image;
const int value = GPOINTER_TO_INT (
- e_table_model_value_at (ecell_view->ecell->table_model, col, row));
+ e_table_model_value_at (ecell_view->ecell->table_model, model_col, row));
if (value >= toggle->n_states){
g_warning ("Value from the table model is %d, the states we support are [0..%d)\n",
@@ -166,7 +164,7 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable,
}
static void
-etog_set_value (ECellToggleView *toggle_view, int col, int row, int value)
+etog_set_value (ECellToggleView *toggle_view, int model_col, int view_col, int row, int value)
{
ECell *ecell = toggle_view->cell_view.ecell;
ECellToggle *toggle = E_CELL_TOGGLE (ecell);
@@ -174,29 +172,28 @@ etog_set_value (ECellToggleView *toggle_view, int col, int row, int value)
if (value >= toggle->n_states)
value = 0;
- e_table_model_set_value_at (ecell->table_model, col, row, GINT_TO_POINTER (value));
- etog_queue_redraw (toggle_view, col, row);
+ e_table_model_set_value_at (ecell->table_model, model_col, row, GINT_TO_POINTER (value));
+ etog_queue_redraw (toggle_view, view_col, row);
}
/*
* ECell::event method
*/
static gint
-etog_event (ECellView *ecell_view, GdkEvent *event, int col, int row)
+etog_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row)
{
- ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell);
ECellToggleView *toggle_view = (ECellToggleView *) ecell_view;
- void *_value = e_table_model_value_at (ecell_view->ecell->table_model, col, row);
+ void *_value = e_table_model_value_at (ecell_view->ecell->table_model, model_col, row);
const int value = GPOINTER_TO_INT (_value);
switch (event->type){
case GDK_BUTTON_RELEASE:
- etog_set_value (toggle_view, col, row, value + 1);
+ etog_set_value (toggle_view, model_col, view_col, row, value + 1);
return TRUE;
case GDK_KEY_PRESS:
if (event->key.keyval == GDK_space){
- etog_set_value (toggle_view, col, row, value + 1);
+ etog_set_value (toggle_view, model_col, view_col, row, value + 1);
return TRUE;
}
return FALSE;
@@ -211,7 +208,7 @@ etog_event (ECellView *ecell_view, GdkEvent *event, int col, int row)
* ECell::height method
*/
static int
-etog_height (ECellView *ecell_view, int col, int row)
+etog_height (ECellView *ecell_view, int model_col, int view_col, int row)
{
ECellToggle *toggle = E_CELL_TOGGLE (ecell_view->ecell);