aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@gnu.org>2000-04-17 04:27:11 +0800
committerAnders Carlsson <andersca@src.gnome.org>2000-04-17 04:27:11 +0800
commit50c22a17f03ccdff5cd2363db96c7fd9f08abdb2 (patch)
tree42baf099ec5c9bf83e5ace9f24b40360f4caf2c8
parentfc3bb06c5079fb2a8c0cd550211976f745ba3d86 (diff)
downloadgsoc2013-evolution-50c22a17f03ccdff5cd2363db96c7fd9f08abdb2.tar.gz
gsoc2013-evolution-50c22a17f03ccdff5cd2363db96c7fd9f08abdb2.tar.zst
gsoc2013-evolution-50c22a17f03ccdff5cd2363db96c7fd9f08abdb2.zip
Propagate mouse wheel events upwards.
2000-04-16 Anders Carlsson <andersca@gnu.org> * e-table-item.c (eti_event): Propagate mouse wheel events upwards. * e-table.c (et_real_construct): Use a GtkScrolledWindow here instead of a GtkScrollbar, since it makes mouse wheel scrolling much easier. svn path=/trunk/; revision=2463
-rw-r--r--widgets/e-table/ChangeLog8
-rw-r--r--widgets/e-table/e-table-item.c8
-rw-r--r--widgets/e-table/e-table.c22
-rw-r--r--widgets/table/e-table-item.c8
-rw-r--r--widgets/table/e-table.c22
5 files changed, 42 insertions, 26 deletions
diff --git a/widgets/e-table/ChangeLog b/widgets/e-table/ChangeLog
index b6e01fb2cb..0fbc9bec55 100644
--- a/widgets/e-table/ChangeLog
+++ b/widgets/e-table/ChangeLog
@@ -1,3 +1,11 @@
+2000-04-16 Anders Carlsson <andersca@gnu.org>
+
+ * e-table-item.c (eti_event): Propagate mouse wheel events upwards.
+
+ * e-table.c (et_real_construct): Use a GtkScrolledWindow here
+ instead of a GtkScrollbar, since it makes mouse wheel scrolling
+ much easier.
+
2000-04-15 Matt Loper <matt@helixcode.com>
* e-table.c (et_xml_to_header): sanity-check our parameters.
diff --git a/widgets/e-table/e-table-item.c b/widgets/e-table/e-table-item.c
index 53515517e6..0b8c106a27 100644
--- a/widgets/e-table/e-table-item.c
+++ b/widgets/e-table/e-table-item.c
@@ -1028,9 +1028,13 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
case GDK_2BUTTON_PRESS: {
double x1, y1;
int col, row;
-
+
+ if (e->button.button == 5 ||
+ e->button.button == 4)
+ return FALSE;
+
gnome_canvas_item_w2i (item, &e->button.x, &e->button.y);
-
+
if (!find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1))
return TRUE;
diff --git a/widgets/e-table/e-table.c b/widgets/e-table/e-table.c
index ee6014d728..7a0d725a97 100644
--- a/widgets/e-table/e-table.c
+++ b/widgets/e-table/e-table.c
@@ -769,7 +769,7 @@ et_real_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm,
xmlNode *xmlColumns;
xmlNode *xmlGrouping;
- GtkWidget *vscrollbar;
+ GtkWidget *scrolledwindow;
GtkWidget *vbox;
e_table->full_header = full_header;
@@ -797,6 +797,15 @@ et_real_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm,
e_table_setup_table (e_table, full_header, e_table->header, etm);
e_table_fill_table (e_table, etm);
+ scrolledwindow = gtk_scrolled_window_new (gtk_layout_get_hadjustment (GTK_LAYOUT (e_table->table_canvas)),
+ gtk_layout_get_vadjustment (GTK_LAYOUT (e_table->table_canvas)));
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow),
+ GTK_POLICY_NEVER,
+ GTK_POLICY_AUTOMATIC);
+
+ gtk_container_add (GTK_CONTAINER (scrolledwindow), e_table->table_canvas);
+ gtk_widget_show (scrolledwindow);
+
/*
* The header
*/
@@ -810,20 +819,11 @@ et_real_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm,
* The body
*/
gtk_table_attach (
- GTK_TABLE (e_table), GTK_WIDGET (e_table->table_canvas),
+ GTK_TABLE (e_table), GTK_WIDGET (scrolledwindow),
1, 2, 2, 3,
GTK_FILL | GTK_EXPAND,
GTK_FILL | GTK_EXPAND, 0, 0);
- vscrollbar = gtk_vscrollbar_new (gtk_layout_get_vadjustment (GTK_LAYOUT (e_table->table_canvas)));
- gtk_widget_show (vscrollbar);
-
- gtk_table_attach (
- GTK_TABLE (e_table), vscrollbar,
- 2, 3, 2, 3,
- GTK_FILL,
- GTK_FILL | GTK_EXPAND, 0, 0);
-
gtk_widget_pop_colormap ();
gtk_widget_pop_visual ();
}
diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c
index 53515517e6..0b8c106a27 100644
--- a/widgets/table/e-table-item.c
+++ b/widgets/table/e-table-item.c
@@ -1028,9 +1028,13 @@ eti_event (GnomeCanvasItem *item, GdkEvent *e)
case GDK_2BUTTON_PRESS: {
double x1, y1;
int col, row;
-
+
+ if (e->button.button == 5 ||
+ e->button.button == 4)
+ return FALSE;
+
gnome_canvas_item_w2i (item, &e->button.x, &e->button.y);
-
+
if (!find_cell (eti, e->button.x, e->button.y, &col, &row, &x1, &y1))
return TRUE;
diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c
index ee6014d728..7a0d725a97 100644
--- a/widgets/table/e-table.c
+++ b/widgets/table/e-table.c
@@ -769,7 +769,7 @@ et_real_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm,
xmlNode *xmlColumns;
xmlNode *xmlGrouping;
- GtkWidget *vscrollbar;
+ GtkWidget *scrolledwindow;
GtkWidget *vbox;
e_table->full_header = full_header;
@@ -797,6 +797,15 @@ et_real_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm,
e_table_setup_table (e_table, full_header, e_table->header, etm);
e_table_fill_table (e_table, etm);
+ scrolledwindow = gtk_scrolled_window_new (gtk_layout_get_hadjustment (GTK_LAYOUT (e_table->table_canvas)),
+ gtk_layout_get_vadjustment (GTK_LAYOUT (e_table->table_canvas)));
+ gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow),
+ GTK_POLICY_NEVER,
+ GTK_POLICY_AUTOMATIC);
+
+ gtk_container_add (GTK_CONTAINER (scrolledwindow), e_table->table_canvas);
+ gtk_widget_show (scrolledwindow);
+
/*
* The header
*/
@@ -810,20 +819,11 @@ et_real_construct (ETable *e_table, ETableHeader *full_header, ETableModel *etm,
* The body
*/
gtk_table_attach (
- GTK_TABLE (e_table), GTK_WIDGET (e_table->table_canvas),
+ GTK_TABLE (e_table), GTK_WIDGET (scrolledwindow),
1, 2, 2, 3,
GTK_FILL | GTK_EXPAND,
GTK_FILL | GTK_EXPAND, 0, 0);
- vscrollbar = gtk_vscrollbar_new (gtk_layout_get_vadjustment (GTK_LAYOUT (e_table->table_canvas)));
- gtk_widget_show (vscrollbar);
-
- gtk_table_attach (
- GTK_TABLE (e_table), vscrollbar,
- 2, 3, 2, 3,
- GTK_FILL,
- GTK_FILL | GTK_EXPAND, 0, 0);
-
gtk_widget_pop_colormap ();
gtk_widget_pop_visual ();
}