aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorChris Toshok <toshok@helixcode.com>2000-06-11 12:44:27 +0800
committerChris Toshok <toshok@src.gnome.org>2000-06-11 12:44:27 +0800
commit07707b81afe216c617fead536a69b98d638f0e19 (patch)
tree72bd1378842b87a27ecbddb9478714d9b7c84e2c /widgets
parentaac3f2c8b69f579e04314b21a13d752afe4bd317 (diff)
downloadgsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.tar
gsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.tar.gz
gsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.tar.bz2
gsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.tar.lz
gsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.tar.xz
gsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.tar.zst
gsoc2013-evolution-07707b81afe216c617fead536a69b98d638f0e19.zip
offset events before passing them to our subcell view.
2000-06-10 Chris Toshok <toshok@helixcode.com> * e-cell-tree.c (ect_event): offset events before passing them to our subcell view. svn path=/trunk/; revision=3520
Diffstat (limited to 'widgets')
-rw-r--r--widgets/e-table/ChangeLog5
-rw-r--r--widgets/e-table/e-cell-tree.c21
-rw-r--r--widgets/table/e-cell-tree.c21
3 files changed, 39 insertions, 8 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog
index b2dc58456d..f99d011b05 100644
--- a/widgets/e-table/ChangeLog
+++ b/widgets/e-table/ChangeLog
@@ -1,5 +1,10 @@
2000-06-10 Chris Toshok <toshok@helixcode.com>
+ * e-cell-tree.c (ect_event): offset events before passing them to
+ our subcell view.
+
+2000-06-10 Chris Toshok <toshok@helixcode.com>
+
* e-table-item.c (eti_event): change things so we focus the cell
and select the row, and also dispatch the event to that row/cell.
This fixes the problem with the tree where you had to click twice
diff --git a/widgets/e-table/e-cell-tree.c b/widgets/e-table/e-cell-tree.c
index c3459ce4f8..893cae4f4c 100644
--- a/widgets/e-table/e-cell-tree.c
+++ b/widgets/e-table/e-cell-tree.c
@@ -282,14 +282,14 @@ static gint
ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row)
{
ECellTreeView *tree_view = (ECellTreeView *) ecell_view;
+ ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row);
+ ETreePath *node = e_cell_tree_get_node (tree_model, row);
+ int offset = offset_of_node (tree_model, node);
switch (event->type) {
case GDK_BUTTON_PRESS: {
/* if the event happened in our area of control (and
we care about it), handle it. */
- ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row);
- ETreePath *node = e_cell_tree_get_node (tree_model, row);
- int offset = offset_of_node (tree_model, node);
/* only activate the tree control if the click/release happens in the icon's area. */
if (event->button.x > (offset - INDENT_AMOUNT) && event->button.x < offset) {
@@ -304,7 +304,20 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col,
return TRUE;
}
default:
- /* otherwise, pass it off to our subcell_view */
+ /* modify the event and pass it off to our subcell_view */
+ switch (event->type) {
+ case GDK_BUTTON_PRESS:
+ case GDK_BUTTON_RELEASE:
+ case GDK_2BUTTON_PRESS:
+ case GDK_3BUTTON_PRESS:
+ event->button.x -= offset;
+ break;
+ case GDK_MOTION_NOTIFY:
+ event->motion.x -= offset;
+ break;
+ default:
+ /* nada */
+ }
e_cell_event(tree_view->subcell_view, event, model_col, view_col, row);
return TRUE;
}
diff --git a/widgets/table/e-cell-tree.c b/widgets/table/e-cell-tree.c
index c3459ce4f8..893cae4f4c 100644
--- a/widgets/table/e-cell-tree.c
+++ b/widgets/table/e-cell-tree.c
@@ -282,14 +282,14 @@ static gint
ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col, int row)
{
ECellTreeView *tree_view = (ECellTreeView *) ecell_view;
+ ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row);
+ ETreePath *node = e_cell_tree_get_node (tree_model, row);
+ int offset = offset_of_node (tree_model, node);
switch (event->type) {
case GDK_BUTTON_PRESS: {
/* if the event happened in our area of control (and
we care about it), handle it. */
- ETreeModel *tree_model = e_cell_tree_get_tree_model (ecell_view->e_table_model, row);
- ETreePath *node = e_cell_tree_get_node (tree_model, row);
- int offset = offset_of_node (tree_model, node);
/* only activate the tree control if the click/release happens in the icon's area. */
if (event->button.x > (offset - INDENT_AMOUNT) && event->button.x < offset) {
@@ -304,7 +304,20 @@ ect_event (ECellView *ecell_view, GdkEvent *event, int model_col, int view_col,
return TRUE;
}
default:
- /* otherwise, pass it off to our subcell_view */
+ /* modify the event and pass it off to our subcell_view */
+ switch (event->type) {
+ case GDK_BUTTON_PRESS:
+ case GDK_BUTTON_RELEASE:
+ case GDK_2BUTTON_PRESS:
+ case GDK_3BUTTON_PRESS:
+ event->button.x -= offset;
+ break;
+ case GDK_MOTION_NOTIFY:
+ event->motion.x -= offset;
+ break;
+ default:
+ /* nada */
+ }
e_cell_event(tree_view->subcell_view, event, model_col, view_col, row);
return TRUE;
}