/// <summary> /// Exeutes StartCalculator event /// </summary> public void OnStartCalculator() { if (startCalculator != null) { startCalculator(this); } else { int x, y, w; ParentWindow.GetPosition(out x, out y); x += Allocation.Left; y += Allocation.Top + Allocation.Height; w = Allocation.Right - Allocation.Left; DateCalculatorWindow wnd = new DateCalculatorWindow(x, y, w, new DateTime(Date.Year, Date.Month, Date.Day), EventOnPopupChange, EventOnClosePopup); } }
/// <summary> /// Executes DropDown event /// </summary> protected void OnDropDown() { if (dropDown != null) { dropDown(this); } else { int x, y, w; ParentWindow.GetPosition(out x, out y); x += Allocation.Left; y += Allocation.Top + Allocation.Height; w = Allocation.Right - Allocation.Left; DatePickerWindow wnd = new DatePickerWindow(x, y, w, new DateTime(Date.Year, Date.Month, Date.Day), EventOnPopupChange, EventOnClosePopup); } }
void HandleButtonClicked(object sender, EventArgs e) { if (calendwnd == null) { calendwnd = new CalendarWindow(); calendwnd.Hidden += HandleCalendwndHidden; } calendwnd.Date = Date; int x, y; ParentWindow.GetPosition(out x, out y); x += this.Allocation.Left; y += this.Allocation.Top + this.Allocation.Height; calendwnd.Move(x, y); calendwnd.Modal = true; calendwnd.Show(); }