Пример #1
0
		public SelectionArea(int begin,int end, Month month)
		{
			m_selBegin = begin;
			m_selEnd = end;
			m_month = month;
		}
Пример #2
0
		public SelectionArea(Month month)
		{
			m_selBegin = -1;
			m_selEnd = -1;
			m_month = month;
		}
Пример #3
0
 public TransparencyCollection(Month month)
 {
     // set the control to which the collection belong
     m_month = month;
     // Default values
     m_background = 175;
     m_text = 175;
 }
Пример #4
0
			public MonthPadding(Month month)
			{
				// set the control to which the collection belong
				m_month = month;
				// Default values
				m_horizontal = 2;
				m_vertical = 2;
			}
Пример #5
0
			public MonthBorderStyles(Month month)
			{
				m_month = month;
				m_borderStyle = ButtonBorderStyle.None;
				m_focusBorderStyle = ButtonBorderStyle.Solid;
				m_selectedBorderStyle = ButtonBorderStyle.Solid;
			}
Пример #6
0
			public MonthColors(Month 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 = mcGradientMode.None;
        		                
			}
Пример #7
0
		public MonthCalendar()
		{
			
			// This call is required by the Windows.Forms Form Designer.
			InitializeComponent();

			// TODO: Add any initialization after the InitComponent call
			
			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);
            			
			m_borderColor = Color.Black; 
			m_selectButton = MouseButtons.Left; 
			m_extendedKey = mcExtendedSelectionKey.Ctrl;

           	m_activeRegion = mcCalendarRegion.None; 
			m_selectionMode = mcSelectionMode.MultiSimple; 										
			m_dateTimeFormat = DateTimeFormatInfo.CurrentInfo;
			m_theme = IntPtr.Zero;
										
			m_installedCultures = CultureInfo.GetCultures(CultureTypes.InstalledWin32Cultures);
			m_culture = CultureInfo.CurrentCulture; 
			
			m_showToday = true;
			m_showTrailing = true;
			m_showFocus = true;
			m_todayColor = Color.Red;
			//initiate regions	
			m_weekday = new Weekday(this);
			m_month = new Month(this);
			m_footer = new Footer(this);
			m_weeknumber = new Weeknumber(this);
			m_header = new Header(this);

            m_keyboard = new KeyboardConfig(this);
            m_keyboardEnabled = true;
			m_activeMonth = new ActiveMonth(this);
			m_dateItemCollection = new DateItemCollection(this);
            m_selectedDates = new SelectedDatesCollection(this); 

			// setup callback for weeknumbers
			WeeknumberCallBack = new WeekCallBack(m_weeknumber.CalcWeek);  	
			
			// setup internal events
			m_hook.KeyDown+=new KeyEventHandler(m_hook_KeyDown); 
			m_hook.KeyUp+=new KeyEventHandler(m_hook_KeyUp); 
			
			m_dateItemCollection.DateItemModified+=new DateItemEventHandler(m_dateItemCollection_DateItemModified); 
			
			m_month.DayRender+=new DayRenderEventHandler(m_month_DayRender);
            m_month.DayQueryInfo += new DayQueryInfoEventHandler(m_month_DayQueryInfo);  
            m_month.DayLostFocus+=new DayEventHandler(m_month_DayLostFocus); 
			m_month.DayGotFocus +=new DayEventHandler(m_month_DayGotFocus);
            m_month.ImageClick += new DayClickEventHandler(m_month_ImageClick);
            m_month.DayMouseMove += new DayMouseMoveEventHandler(m_month_DayMouseMove); 
            m_month.DayClick+=new DayClickEventHandler(m_month_DayClick);
			m_month.DayDoubleClick +=new DayClickEventHandler(m_month_DayDoubleClick);	
			m_month.DaySelected+=new DaySelectedEventHandler(m_month_DaySelected); 
			m_month.DayDeselected+=new DaySelectedEventHandler(m_month_DayDeselected); 
			m_month.ColorChanged+=new MonthColorEventHandler(m_month_ColorChanged);
			m_month.BorderStyleChanged+=new MonthBorderStyleEventHandler(m_month_BorderStyleChanged);
			m_month.PropertyChanged+=new MonthPropertyEventHandler(m_month_PropertyChanged);
            m_month.BeforeDaySelected += new DayStateChangedEventHandler(m_month_BeforeDaySelected);
            m_month.BeforeDayDeselected += new DayStateChangedEventHandler(m_month_BeforeDayDeselected); 

			m_footer.Click +=new ClickEventHandler(m_footer_Click);	
			m_footer.DoubleClick +=new ClickEventHandler(m_footer_DoubleClick);
			m_footer.PropertyChanged +=new FooterPropertyEventHandler(m_footer_PropertyChanged);
			
			m_weeknumber.PropertyChanged+=new WeeknumberPropertyEventHandler(m_weeknumber_PropertyChanged); 
			m_weeknumber.Click+=new WeeknumberClickEventHandler(m_weeknumber_Click); 
			m_weeknumber.DoubleClick+=new WeeknumberClickEventHandler(m_weeknumber_DoubleClick); 	
			
			m_weekday.PropertyChanged+=new WeekdayPropertyEventHandler(m_weekday_PropertyChanged); 
			m_weekday.Click+=new WeekdayClickEventHandler(m_weekday_Click); 	
			m_weekday.DoubleClick +=new WeekdayClickEventHandler(m_weekday_DoubleClick);		
			
			m_header.PropertyChanged+=new HeaderPropertyEventHandler(m_header_PropertyChanged); 
			m_header.Click +=new ClickEventHandler(m_header_Click);	
			m_header.DoubleClick +=new ClickEventHandler(m_header_DoubleClick);	
			m_header.PrevMonthButtonClick +=new EventHandler(m_header_PrevMonthButtonClick);		
			m_header.NextMonthButtonClick+=new EventHandler(m_header_NextMonthButtonClick); 		
			m_header.PrevYearButtonClick +=new EventHandler(m_header_PrevYearButtonClick);		
			m_header.NextYearButtonClick+=new EventHandler(m_header_NextYearButtonClick); 		
			

			m_activeMonth.MonthChanged+=new MonthChangedEventHandler(m_activeMonth_MonthChanged);
            m_activeMonth.BeforeMonthChanged += new BeforeMonthChangedEventHandler(m_activeMonth_BeforeMonthChanged); 

			m_printDoc.BeginPrint+=new PrintEventHandler(m_printDoc_BeginPrint); 
			m_printDoc.PrintPage+=new PrintPageEventHandler(m_printDoc_PrintPage);
			m_printDoc.QueryPageSettings+=new QueryPageSettingsEventHandler(m_printDoc_QueryPageSettings); 
			
			m_borderStyle = ButtonBorderStyle.Solid; 
			
			m_printDoc.DocumentName = "MonthCalendar"; 

			m_showFooter = true;
			m_showHeader = true;
			m_showWeekday = true;
						
			m_selectTrailing = true;
            m_selectKeyDown = false;
	
			m_activeMonth.Month = DateTime.Today.Month; 
			m_activeMonth.Year = DateTime.Today.Year;
			  
			m_minDate = DateTime.Now.AddYears(-10);
			m_maxDate = DateTime.Now.AddYears(10);
			
			m_month.SelectedMonth = DateTime.Parse(m_activeMonth.Year+"-"+m_activeMonth.Month+"-01");

            m_hook.InstallKeyboardHook();

            this.Width = 176;
            this.Height = 184;
            m_keyHandled = false;
            Setup();
						
		}