From b43b0612d2bf2fc1100f77c7e59fdeb34f9f0e9d Mon Sep 17 00:00:00 2001 From: John BouAntoun Date: Sat, 27 Nov 2004 01:49:45 +0000 Subject: [PATCH] * MonthCalendar.cs: - Fix usage of ScrollChange Property when scrolling months svn path=/trunk/mcs/; revision=36681 --- .../Managed.Windows.Forms/System.Windows.Forms/ChangeLog | 5 +++++ .../System.Windows.Forms/MonthCalendar.cs | 16 +++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog index 38fa00b8b67..2c5ce8c649e 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog @@ -1,3 +1,8 @@ +2004-11-26 John BouAntoun + + * MonthCalendar.cs: + - Fix usage of ScrollChange Property when scrolling months + 2004-11-26 Jordi Mas i Hernandez * Menu.cs, MainMenu.cs, MenuItem.cs, MenuAPI.cs diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MonthCalendar.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MonthCalendar.cs index 6db51713994..138d742ee0c 100644 --- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MonthCalendar.cs +++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/MonthCalendar.cs @@ -1,4 +1,3 @@ -// // Permission is hereby granted, free of charge, to any person obtaining // a copy of this software and associated documentation files (the // "Software"), to deal in the Software without restriction, including @@ -107,7 +106,7 @@ namespace System.Windows.Forms { max_selection_count = 7; min_date = new DateTime (1953, 1, 1); monthly_bolded_dates = null; - scroll_change = 1; + scroll_change = 0; show_today = true; show_today_circle = true; show_week_numbers = false; @@ -346,16 +345,15 @@ namespace System.Windows.Forms { throw new ArgumentException(); } - // if zero it to the default -> the total number of months currently visible - if (value == 0) { - scroll_change = CalendarDimensions.Width * CalendarDimensions.Height; - } - if (scroll_change != value) { scroll_change = value; } } get { + // if zero it to the default -> the total number of months currently visible + if (scroll_change == 0) { + return CalendarDimensions.Width * CalendarDimensions.Height; + } return scroll_change; } } @@ -1276,13 +1274,13 @@ namespace System.Windows.Forms { // show the click then move on SetItemClick(hti); this.Invalidate (); - this.CurrentMonth = this.CurrentMonth.AddMonths (CalendarDimensions.Width * CalendarDimensions.Height); + this.CurrentMonth = this.CurrentMonth.AddMonths (ScrollChange); break; case HitArea.PrevMonthButton: // show the click then move on SetItemClick(hti); this.Invalidate (); - this.CurrentMonth = this.CurrentMonth.AddMonths ((CalendarDimensions.Width * CalendarDimensions.Height)*-1); + this.CurrentMonth = this.CurrentMonth.AddMonths (ScrollChange*-1); break; case HitArea.PrevMonthDate: SetItemClick(hti); -- 2.11.4.GIT