Beispiel #1
0
 protected override void Hide()
 {
     if (this.EditControl != null)
     {
         this.EditControl.Hide();
     }
     base.Hide();
     this.EditControl = null;
 }
Beispiel #2
0
 protected override void Hide()
 {
     if (this.EditControl != null)
     {
         this.EditControl.Hide();
     }
     base.Hide();
     this.EditControl = null;
 }
Beispiel #3
0
 protected override void Click(int yOffset, int parentWidth)
 {
     if (this.Enabled)
     {
         if (this.EditControl != null)
         {
             this.EditControl.Focus();
             this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name));
         }
         else
         {
             base.DisableEvents = true;
             DVDateTimePicker control = base.Parent.GetControl(typeof(DVDateTimePicker)) as DVDateTimePicker;
             if (control != null)
             {
                 control.ParentItem      = this;
                 control.DatePicker.Font = base.TextFont;
                 control.TimePicker.Font = base.TextFont;
                 control.Enabled         = true;
                 control.Style           = this.DateTimeStyle;
                 control.Format          = this.m_Format;
                 control.AllowNone       = this.AllowNoneDate;
                 control.DatePicker.MonthCalendar.TitleVistaStyle = this.CalendarTitleVistaStyle;
                 control.DatePicker.MaxDate                  = this.MaxDate;
                 control.DatePicker.MinDate                  = this.MinDate;
                 control.TimePicker.ShowUpDown               = this.ShowTimeUpDown;
                 control.DatePicker.ShowDropDown             = this.m_showDropDown;
                 control.TimePicker.ShowDropDown             = this.m_showDropDown;
                 control.TimePicker.ShowTimeNone             = this.m_showTimeNone;
                 control.TimePicker.TimePickerStartTime      = new System.DateTime(1, 1, 1, this.m_startTime.Hours, this.m_startTime.Minutes, this.m_startTime.Seconds);
                 control.TimePicker.TimePickerEndTime        = new System.DateTime(1, 1, 1, this.m_endTime.Hours, this.m_endTime.Minutes, this.m_endTime.Seconds);
                 control.TimePicker.TimePickerMinuteInterval = this.m_minuteInterval;
                 try
                 {
                     if (this.DateTime == NoneDateTime)
                     {
                         control.Date = System.DateTime.Now;
                         if (this.AllowNoneDate)
                         {
                             control.DatePicker.Checked = false;
                             control.TimePicker.Checked = false;
                         }
                     }
                     else
                     {
                         control.TimePicker.Enabled = true;
                         control.Date = this.DateTime;
                     }
                 }
                 catch
                 {
                     control.Date = System.DateTime.Now;
                 }
                 this.EditControl      = control;
                 control.ValueChanged += new ItemEventHandler(this.OnChanged);
                 control.Bounds        = this.GetActivePartBounds(yOffset);
                 base.DisableEvents    = false;
                 this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name));
                 base.DisableEvents = true;
                 if (this.EditControl != null)
                 {
                     this.EditControl.Show();
                     if (this.ShowDropDown && this.DropDownClicked(parentWidth, yOffset))
                     {
                         this.EditControl.DroppedDown = true;
                     }
                 }
             }
             base.DisableEvents = false;
             base.Click(yOffset, parentWidth);
         }
     }
 }
Beispiel #4
0
 protected override void Click(int yOffset, int parentWidth)
 {
     if (this.Enabled)
     {
         if (this.EditControl != null)
         {
             this.EditControl.Focus();
             this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name));
         }
         else
         {
             base.DisableEvents = true;
             DVDateTimePicker control = base.Parent.GetControl(typeof(DVDateTimePicker)) as DVDateTimePicker;
             if (control != null)
             {
                 control.ParentItem = this;
                 control.DatePicker.Font = base.TextFont;
                 control.TimePicker.Font = base.TextFont;
                 control.Enabled = true;
                 control.Style = this.DateTimeStyle;
                 control.Format = this.m_Format;
                 control.AllowNone = this.AllowNoneDate;
                 control.DatePicker.MonthCalendar.TitleVistaStyle = this.CalendarTitleVistaStyle;
                 control.DatePicker.MaxDate = this.MaxDate;
                 control.DatePicker.MinDate = this.MinDate;
                 control.TimePicker.ShowUpDown = this.ShowTimeUpDown;
                 control.DatePicker.ShowDropDown = this.m_showDropDown;
                 control.TimePicker.ShowDropDown = this.m_showDropDown;
                 control.TimePicker.ShowTimeNone = this.m_showTimeNone;
                 control.TimePicker.TimePickerStartTime = new System.DateTime(1, 1, 1, this.m_startTime.Hours, this.m_startTime.Minutes, this.m_startTime.Seconds);
                 control.TimePicker.TimePickerEndTime = new System.DateTime(1, 1, 1, this.m_endTime.Hours, this.m_endTime.Minutes, this.m_endTime.Seconds);
                 control.TimePicker.TimePickerMinuteInterval = this.m_minuteInterval;
                 try
                 {
                     if (this.DateTime == NoneDateTime)
                     {
                         control.Date = System.DateTime.Now;
                         if (this.AllowNoneDate)
                         {
                             control.DatePicker.Checked = false;
                             control.TimePicker.Checked = false;
                         }
                     }
                     else
                     {
                         control.TimePicker.Enabled = true;
                         control.Date = this.DateTime;
                     }
                 }
                 catch
                 {
                     control.Date = System.DateTime.Now;
                 }
                 this.EditControl = control;
                 control.ValueChanged += new ItemEventHandler(this.OnChanged);
                 control.Bounds = this.GetActivePartBounds(yOffset);
                 base.DisableEvents = false;
                 this.OnGotFocus(this, new ItemEventArgs(this, 0, base.Name));
                 base.DisableEvents = true;
                 if (this.EditControl != null)
                 {
                     this.EditControl.Show();
                     if (this.ShowDropDown && this.DropDownClicked(parentWidth, yOffset))
                     {
                         this.EditControl.DroppedDown = true;
                     }
                 }
             }
             base.DisableEvents = false;
             base.Click(yOffset, parentWidth);
         }
     }
 }