diff options
author | Arturo Espinosa <unammx@src.gnome.org> | 1999-12-12 17:20:46 +0800 |
---|---|---|
committer | Arturo Espinosa <unammx@src.gnome.org> | 1999-12-12 17:20:46 +0800 |
commit | fa895ed8e1454d4d761b8789381ca5ba464a7c93 (patch) | |
tree | 594aa949bfdb351a0cb6646bb950744c8a791c88 /widgets/table/e-cell-toggle.c | |
parent | 863f8aa634005c6400d629c353f5fed485106fce (diff) | |
download | gsoc2013-evolution-fa895ed8e1454d4d761b8789381ca5ba464a7c93.tar gsoc2013-evolution-fa895ed8e1454d4d761b8789381ca5ba464a7c93.tar.gz gsoc2013-evolution-fa895ed8e1454d4d761b8789381ca5ba464a7c93.tar.bz2 gsoc2013-evolution-fa895ed8e1454d4d761b8789381ca5ba464a7c93.tar.lz gsoc2013-evolution-fa895ed8e1454d4d761b8789381ca5ba464a7c93.tar.xz gsoc2013-evolution-fa895ed8e1454d4d761b8789381ca5ba464a7c93.tar.zst gsoc2013-evolution-fa895ed8e1454d4d761b8789381ca5ba464a7c93.zip |
More work. We now have the basics for nesting working, now we need all the
More work. We now have the basics for nesting working, now we need all
the interactions done properly.
I want to use a new GnomeCanvasItem for the nesting parent as well.
DnD will have to be done with our own protocol to provide all the feedback
we want to provide.
Miguel
svn path=/trunk/; revision=1481
Diffstat (limited to 'widgets/table/e-cell-toggle.c')
-rw-r--r-- | widgets/table/e-cell-toggle.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index ec6fa38a38..dbe5fe5cbd 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -38,17 +38,18 @@ etog_queue_redraw (ECellToggleView *text_view, int view_col, int view_row) * ECell::realize method */ static ECellView * -etog_realize (ECell *ecell, void *view) +etog_realize (ECell *ecell, ETableModel *table_model, void *view) { ECellToggleView *toggle_view = g_new0 (ECellToggleView, 1); ETableItem *eti = E_TABLE_ITEM (view); GnomeCanvas *canvas = GNOME_CANVAS_ITEM (eti)->canvas; toggle_view->cell_view.ecell = ecell; + toggle_view->cell_view.table_model = table_model; toggle_view->eti = eti; toggle_view->canvas = canvas; toggle_view->gc = gdk_gc_new (GTK_WIDGET (canvas)->window); - + return (ECellView *) toggle_view; } @@ -80,7 +81,7 @@ etog_draw (ECellView *ecell_view, GdkDrawable *drawable, ArtPixBuf *art; int x, y, width, height; const int value = GPOINTER_TO_INT ( - e_table_model_value_at (ecell_view->ecell->table_model, model_col, row)); + e_table_model_value_at (ecell_view->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", @@ -172,7 +173,8 @@ etog_set_value (ECellToggleView *toggle_view, int model_col, int view_col, int r if (value >= toggle->n_states) value = 0; - e_table_model_set_value_at (ecell->table_model, model_col, row, GINT_TO_POINTER (value)); + e_table_model_set_value_at (toggle_view->cell_view.table_model, + model_col, row, GINT_TO_POINTER (value)); etog_queue_redraw (toggle_view, view_col, row); } @@ -183,7 +185,7 @@ static gint etog_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row) { ECellToggleView *toggle_view = (ECellToggleView *) ecell_view; - void *_value = e_table_model_value_at (ecell_view->ecell->table_model, model_col, row); + void *_value = e_table_model_value_at (ecell_view->table_model, model_col, row); const int value = GPOINTER_TO_INT (_value); switch (event->type){ @@ -248,13 +250,11 @@ e_cell_toggle_class_init (GtkObjectClass *object_class) E_MAKE_TYPE(e_cell_toggle, "ECellToggle", ECellToggle, e_cell_toggle_class_init, NULL, PARENT_TYPE); void -e_cell_toggle_construct (ECellToggle *etog, ETableModel *etm, int border, int n_states, GdkPixbuf **images) +e_cell_toggle_construct (ECellToggle *etog, int border, int n_states, GdkPixbuf **images) { int max_height = 0; int i; - E_CELL (etog)->table_model = etm; - etog->border = border; etog->n_states = n_states; @@ -272,11 +272,13 @@ e_cell_toggle_construct (ECellToggle *etog, ETableModel *etm, int border, int n_ } ECell * -e_cell_toggle_new (ETableModel *etm, int border, int n_states, GdkPixbuf **images) +e_cell_toggle_new (int border, int n_states, GdkPixbuf **images) { ECellToggle *etog = gtk_type_new (e_cell_toggle_get_type ()); - e_cell_toggle_construct (etog, etm, border, n_states, images); + e_cell_toggle_construct (etog, border, n_states, images); return (ECell *) etog; } + + |