aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui
diff options
context:
space:
mode:
authorViren.L <lviren@novell.com>2005-10-21 17:32:36 +0800
committerSankarasivasubramanian Pasupathilingam <psankar@src.gnome.org>2005-10-21 17:32:36 +0800
commitded9e18e126f3469b89f0deccdc490fe4c9314f4 (patch)
tree2b795655635f42fad34120277a1d028172a550ed /calendar/gui
parentf681752db0d20196cf6daf6b7ba76815096e01ab (diff)
downloadgsoc2013-evolution-ded9e18e126f3469b89f0deccdc490fe4c9314f4.tar
gsoc2013-evolution-ded9e18e126f3469b89f0deccdc490fe4c9314f4.tar.gz
gsoc2013-evolution-ded9e18e126f3469b89f0deccdc490fe4c9314f4.tar.bz2
gsoc2013-evolution-ded9e18e126f3469b89f0deccdc490fe4c9314f4.tar.lz
gsoc2013-evolution-ded9e18e126f3469b89f0deccdc490fe4c9314f4.tar.xz
gsoc2013-evolution-ded9e18e126f3469b89f0deccdc490fe4c9314f4.tar.zst
gsoc2013-evolution-ded9e18e126f3469b89f0deccdc490fe4c9314f4.zip
Sankar committing for Viren
2005-10-21 Viren.L <lviren@novell.com> Sankar committing for Viren Fixes #272920 * gui/gnome-cal.c (setup_widgets): Connect signal to catch the scroll-event on the widget of date navigator and handle the GDK_SCROLL_UP,GDK_SCROLL_DOWN in the callback. svn path=/trunk/; revision=30548
Diffstat (limited to 'calendar/gui')
-rw-r--r--calendar/gui/gnome-cal.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 5a203b31f8..9fa7edf7a4 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -219,6 +219,7 @@ static void gnome_calendar_update_date_navigator (GnomeCalendar *gcal);
static void gnome_calendar_hpane_realized (GtkWidget *w, GnomeCalendar *gcal);
static void gnome_calendar_vpane_realized (GtkWidget *w, GnomeCalendar *gcal);
static gboolean gnome_calendar_vpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gcal);
+static void gnome_calendar_date_navigator_scrolled (GtkWidget *widget, GdkEventScroll *event, gpointer user_data);
static gboolean gnome_calendar_hpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gcal);
static void gnome_calendar_on_date_navigator_date_range_changed (ECalendarItem *calitem,
@@ -1400,6 +1401,8 @@ setup_widgets (GnomeCalendar *gcal)
G_CALLBACK (gnome_calendar_on_date_navigator_selection_changed), gcal);
g_signal_connect (priv->date_navigator->calitem, "date_range_changed",
G_CALLBACK (gnome_calendar_on_date_navigator_date_range_changed), gcal);
+ g_signal_connect (w, "scroll-event",
+ G_CALLBACK (gnome_calendar_date_navigator_scrolled), gcal);
/* The ToDo list. */
priv->todo = e_calendar_table_new ();
@@ -3177,6 +3180,32 @@ gnome_calendar_vpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gc
return FALSE;
}
+static void
+gnome_calendar_date_navigator_scrolled (GtkWidget *widget, GdkEventScroll *event, gpointer user_data)
+{
+ GnomeCalendar *gcal = user_data;
+ ECalendarItem *calitem = gcal->priv->date_navigator->calitem;
+ GDate start_date, end_date;
+
+ if (e_calendar_item_get_selection (calitem, &start_date, &end_date)) {
+ switch (event->direction) {
+ case GDK_SCROLL_UP:
+ g_date_subtract_months (&start_date, 1);
+ g_date_subtract_months (&end_date, 1);
+ break;
+ case GDK_SCROLL_DOWN:
+ g_date_add_months (&start_date, 1);
+ g_date_add_months (&end_date, 1);
+ break;
+ default:
+ break;
+
+ }
+ e_calendar_item_set_selection (calitem, &start_date, &end_date);
+ gnome_calendar_on_date_navigator_selection_changed (calitem, gcal);
+ }
+}
+
static gboolean
gnome_calendar_hpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gcal)
{