/// <summary>
		/// Initializes a new instance of the <see cref="NuGenCalendarSelectionArea"/> class.
		/// </summary>
		public NuGenCalendarSelectionArea(int begin, int end, NuGenMonth month)
		{
			m_selBegin = begin;
			m_selEnd = end;
			m_month = month;
		}
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenCalendarSelectionArea"/> class.
		/// </summary>
		public NuGenCalendarSelectionArea(NuGenMonth month)
		{
			m_selBegin = -1;
			m_selEnd = -1;
			m_month = month;
		}
Ejemplo n.º 3
0
			/// <summary>
			/// Initializes a new instance of the <see cref="TransparencyCollection"/> class.
			/// </summary>
			public TransparencyCollection(NuGenMonth month)
			{
				// set the control to which the collection belong
				m_month = month;
				// Default values
				m_background = 175;
				m_text = 175;
			}
Ejemplo n.º 4
0
			/// <summary>
			/// Initializes a new instance of the <see cref="MonthPadding"/> class.
			/// </summary>
			public MonthPadding(NuGenMonth month)
			{
				// set the control to which the collection belong
				m_month = month;
				// Default values
				m_horizontal = 2;
				m_vertical = 2;
			}
Ejemplo n.º 5
0
			/// <summary>
			/// Initializes a new instance of the <see cref="MonthBorderStyles"/> class.
			/// </summary>
			public MonthBorderStyles(NuGenMonth month)
			{
				m_month = month;
				m_borderStyle = ButtonBorderStyle.None;
				m_focusBorderStyle = ButtonBorderStyle.Solid;
				m_selectedBorderStyle = ButtonBorderStyle.Solid;
			}
Ejemplo n.º 6
0
			/// <summary>
			/// Initializes a new instance of the <see cref="MonthColors"/> class.
			/// </summary>
			/// <param name="month">The month.</param>
			public MonthColors(NuGenMonth month)
			{
				m_month = month;
				m_trailingColors = new TrailingColors(this);
				m_weekendColors = new WeekendColors(this);
				m_disabledColors = new DisabledColors(this);
				m_selectedColors = new SelectedColors(this);
				m_focusColors = new FocusColors(this);
				m_dayColors = new DayColors(this);


				// Default values

				m_backColor1 = Color.White;
				m_backColor2 = Color.White;
				m_gradientMode = NuGenGradientMode.None;

			}
Ejemplo n.º 7
0
		/// <summary>
		/// Initializes a new instance of the <see cref="NuGenCalendar"/> class.
		/// </summary>
		/// <param name="serviceProvider">
		/// <para>Requires:</para>
		/// <para><see cref="INuGenControlStateService"/></para>
		/// <para><see cref="INuGenCalendarRenderer"/></para>
		/// </param>
		public NuGenCalendar(INuGenServiceProvider serviceProvider)
			: base(serviceProvider)
		{
			this.SetStyle(ControlStyles.DoubleBuffer, true);
			this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
			this.SetStyle(ControlStyles.UserPaint, true);
			this.SetStyle(ControlStyles.ResizeRedraw, true);
			this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);

			_borderColor = Color.Black;
			_selectButton = MouseButtons.Left;
			_extendedKey = NuGenExtendedSelectionKey.Ctrl;

			_activeRegion = NuGenCalendarRegion.None;
			_selectionMode = NuGenSelectionMode.MultiSimple;
			_dateTimeFormat = DateTimeFormatInfo.CurrentInfo;
			_theme = IntPtr.Zero;

			_installedCultures = CultureInfo.GetCultures(CultureTypes.InstalledWin32Cultures);
			_culture = CultureInfo.CurrentCulture;

			_showToday = true;
			_showTrailing = true;
			_showFocus = true;
			_todayColor = Color.Red;
			//initiate regions	
			_weekday = new NuGenWeekday(this);
			_month = new NuGenMonth(this);
			_footer = new NuGenFooter(this);
			_weeknumber = new NuGenWeeknumber(this);
			_header = new NuGenHeader(this, serviceProvider);

			_keyboard = new KeyboardConfig(this);
			_keyboardEnabled = true;
			_activeMonth = new NuGenActiveMonth(this);
			_dateItemCollection = new NuGenDateItemCollection(this);
			_selectedDates = new NuGenSelectedDatesCollection(this);

			// setup callback for weeknumbers
			WeeknumberCallBack = new NuGenWeekCallback(_weeknumber.CalcWeek);

			// setup internal events
			_hook.KeyDown += new KeyEventHandler(m_hook_KeyDown);
			_hook.KeyUp += new KeyEventHandler(m_hook_KeyUp);

			_dateItemCollection.DateItemModified += m_dateItemCollection_DateItemModified;

			_month.DayRender += m_month_DayRender;
			_month.DayQueryInfo += m_month_DayQueryInfo;
			_month.DayLostFocus += m_month_DayLostFocus;
			_month.DayGotFocus += m_month_DayGotFocus;
			_month.ImageClick += m_month_ImageClick;
			_month.DayMouseMove += m_month_DayMouseMove;
			_month.DayClick += m_month_DayClick;
			_month.DayDoubleClick += m_month_DayDoubleClick;
			_month.DaySelected += m_month_DaySelected;
			_month.DayDeselected += m_month_DayDeselected;
			_month.ColorChanged += m_month_ColorChanged;
			_month.BorderStyleChanged += m_month_BorderStyleChanged;
			_month.PropertyChanged += m_month_PropertyChanged;
			_month.BeforeDaySelected += m_month_BeforeDaySelected;
			_month.BeforeDayDeselected += m_month_BeforeDayDeselected;

			_footer.Click += m_footer_Click;
			_footer.DoubleClick += m_footer_DoubleClick;
			_footer.PropertyChanged += m_footer_PropertyChanged;

			_weeknumber.PropertyChanged += m_weeknumber_PropertyChanged;
			_weeknumber.Click += m_weeknumber_Click;
			_weeknumber.DoubleClick += m_weeknumber_DoubleClick;

			_weekday.PropertyChanged += m_weekday_PropertyChanged;
			_weekday.Click += m_weekday_Click;
			_weekday.DoubleClick += m_weekday_DoubleClick;

			_header.PropertyChanged += m_header_PropertyChanged;
			_header.Click += m_header_Click;
			_header.DoubleClick += m_header_DoubleClick;
			_header.PrevMonthButtonClick += m_header_PrevMonthButtonClick;
			_header.NextMonthButtonClick += m_header_NextMonthButtonClick;
			_header.PrevYearButtonClick += m_header_PrevYearButtonClick;
			_header.NextYearButtonClick += m_header_NextYearButtonClick;


			_activeMonth.MonthChanged += m_activeMonth_MonthChanged;
			_activeMonth.BeforeMonthChanged += m_activeMonth_BeforeMonthChanged;

			_printDoc.BeginPrint += m_printDoc_BeginPrint;
			_printDoc.PrintPage += m_printDoc_PrintPage;
			_printDoc.QueryPageSettings += m_printDoc_QueryPageSettings;

			_borderStyle = ButtonBorderStyle.Solid;

			_printDoc.DocumentName = "MonthCalendar";

			_showFooter = true;
			_showHeader = true;
			_showWeekday = true;

			_selectTrailing = true;
			_selectKeyDown = false;

			_activeMonth.Month = DateTime.Today.Month;
			_activeMonth.Year = DateTime.Today.Year;

			_minDate = DateTime.Now.AddYears(-10);
			_maxDate = DateTime.Now.AddYears(10);

			_month.SelectedMonth = DateTime.Parse(_activeMonth.Year + "-" + _activeMonth.Month + "-01");

			_hook.InstallKeyboardHook();
			_keyHandled = false;
			this.Size = new Size(250, 250);
			Setup();
			this.UseTheme = true;
		}