aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc/e-calendar-item.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@helixcode.com>2000-09-06 08:10:39 +0800
committerDamon Chaplin <damon@src.gnome.org>2000-09-06 08:10:39 +0800
commit6403bd5b4def7c610285d2aaad10e793b321091d (patch)
treef2a8cb4cab2e72a42c881e036067fbe5517d1a64 /widgets/misc/e-calendar-item.c
parentd9da6499c0dbb37c30e940bbb2100132f7ddf489 (diff)
downloadgsoc2013-evolution-6403bd5b4def7c610285d2aaad10e793b321091d.tar
gsoc2013-evolution-6403bd5b4def7c610285d2aaad10e793b321091d.tar.gz
gsoc2013-evolution-6403bd5b4def7c610285d2aaad10e793b321091d.tar.bz2
gsoc2013-evolution-6403bd5b4def7c610285d2aaad10e793b321091d.tar.lz
gsoc2013-evolution-6403bd5b4def7c610285d2aaad10e793b321091d.tar.xz
gsoc2013-evolution-6403bd5b4def7c610285d2aaad10e793b321091d.tar.zst
gsoc2013-evolution-6403bd5b4def7c610285d2aaad10e793b321091d.zip
make sure we get the start_weekday since we need it for draw_days(). Fixes
2000-09-05 Damon Chaplin <damon@helixcode.com> * e-calendar-item.c (e_calendar_item_draw_month): make sure we get the start_weekday since we need it for draw_days(). Fixes a drawing bug. 2000-08-31 Damon Chaplin <damon@helixcode.com> * e-calendar-item.c (e_calendar_item_button_press): (e_calendar_item_button_release): grab/ungrab the pointer so we always get the button_release event. svn path=/trunk/; revision=5216
Diffstat (limited to 'widgets/misc/e-calendar-item.c')
-rw-r--r--widgets/misc/e-calendar-item.c36
1 files changed, 15 insertions, 21 deletions
diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c
index 08a0fa7e71..53f2608347 100644
--- a/widgets/misc/e-calendar-item.c
+++ b/widgets/misc/e-calendar-item.c
@@ -1018,19 +1018,20 @@ e_calendar_item_draw_month (ECalendarItem *calitem,
clip_rect.x = MAX (0, clip_rect.x);
clip_rect.y = MAX (0, text_y);
+ memset (&tmp_tm, 0, sizeof (tmp_tm));
+ tmp_tm.tm_year = year - 1900;
+ tmp_tm.tm_mon = month;
+ tmp_tm.tm_mday = 1;
+ tmp_tm.tm_isdst = -1;
+ mktime (&tmp_tm);
+ start_weekday = (tmp_tm.tm_wday + 6) % 7;
+
if (month_x + max_x - clip_rect.x > 0) {
clip_rect.width = month_x + max_x - clip_rect.x;
clip_rect.height = text_y + char_height - clip_rect.y;
gdk_gc_set_clip_rectangle (fg_gc, &clip_rect);
- memset (&tmp_tm, 0, sizeof (tmp_tm));
- tmp_tm.tm_year = year - 1900;
- tmp_tm.tm_mon = month;
- tmp_tm.tm_mday = 1;
- tmp_tm.tm_isdst = -1;
- mktime (&tmp_tm);
strftime (buffer, 64, "%B %Y", &tmp_tm);
- start_weekday = (tmp_tm.tm_wday + 6) % 7;
/* Ideally we place the text centered in the month, but we
won't go to the left of the minimum x position. */
@@ -1599,8 +1600,6 @@ e_calendar_item_button_press (ECalendarItem *calitem,
gint month_offset, day;
gboolean all_week, round_up_end = FALSE, round_down_start = FALSE;
- g_print ("In e_calendar_item_button_press\n");
-
if (event->button.button == 4)
e_calendar_item_set_first_month (calitem, calitem->year,
calitem->month - 1);
@@ -1626,7 +1625,11 @@ e_calendar_item_button_press (ECalendarItem *calitem,
if (event->button.button != 1 || day == -1)
return FALSE;
- g_print (" month offset: %i day: %i\n", month_offset, day);
+ if (gnome_canvas_item_grab (GNOME_CANVAS_ITEM (calitem),
+ GDK_POINTER_MOTION_MASK
+ | GDK_BUTTON_RELEASE_MASK,
+ NULL, event->button.time) != 0)
+ return FALSE;
calitem->selection_start_month_offset = month_offset;
calitem->selection_start_day = day;
@@ -1666,7 +1669,8 @@ static gboolean
e_calendar_item_button_release (ECalendarItem *calitem,
GdkEvent *event)
{
- g_print ("In e_calendar_item_button_release\n");
+ gnome_canvas_item_ungrab (GNOME_CANVAS_ITEM (calitem),
+ event->button.time);
if (!calitem->selecting)
return FALSE;
@@ -2157,8 +2161,6 @@ e_calendar_item_add_days_to_selection (ECalendarItem *calitem,
month = calitem->month + calitem->selection_end_month_offset;
e_calendar_item_normalize_date (calitem, &year, &month);
- g_print ("In e_calendar_item_add_days_to_selection days: %i month:%i\n", days, month);
-
calitem->selection_end_day += days;
if (calitem->selection_end_day <= 0) {
month--;
@@ -2347,9 +2349,6 @@ e_calendar_item_round_down_selection (ECalendarItem *calitem,
gint year, month, weekday, days, days_in_month;
struct tm tmp_tm = { 0 };
- g_print ("In e_calendar_item_round_down_selection month:%i day:%i\n",
- *month_offset, *day);
-
year = calitem->year;
month = calitem->month + *month_offset;
e_calendar_item_normalize_date (calitem, &year, &month);
@@ -2377,9 +2376,6 @@ e_calendar_item_round_down_selection (ECalendarItem *calitem,
(*month_offset)--;
*day += days_in_month;
}
-
- g_print ("Out e_calendar_item_round_down_selection month:%i day:%i\n",
- *month_offset, *day);
}
@@ -2486,8 +2482,6 @@ e_calendar_item_set_selection (ECalendarItem *calitem,
end_month = g_date_month (end_date) - 1;
end_day = g_date_day (end_date);
- g_print ("In e_calendar_item_set_selection start: %i/%i/%i end: %i/%i/%i\n", start_day, start_month, start_year, end_day, end_month, end_year);
-
need_update = e_calendar_item_ensure_days_visible (calitem,
start_year,
start_month,