예제 #1
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;
             Resco.Controls.DetailView.DetailView parent = base.Parent;
             if (parent != null)
             {
                 Resco.Controls.NumericUpDown.NumericUpDown control = parent.GetControl(typeof(Resco.Controls.NumericUpDown.NumericUpDown)) as Resco.Controls.NumericUpDown.NumericUpDown;
                 if (control != null)
                 {
                     control.DecimalPlaces  = this.DecimalPlaces;
                     control.Font           = base.TextFont;
                     control.Minimum        = this.Minimum;
                     control.Maximum        = this.Maximum;
                     control.Increment      = this.Increment;
                     control.TextAlign      = base.TextAlign;
                     control.UpDownWidth    = this.UpDownWidth;
                     control.UpDownAlign    = this.ShowArrows ? this.UpDownAlign : UpDownAlignment.None;
                     control.UpDownStyle    = this.UpDownStyle;
                     control.NoneText       = this.NoneText;
                     control.AllowNoneValue = this.AllowNoneValue;
                     if (this.Value == null)
                     {
                         control.NoneValue = true;
                     }
                     else
                     {
                         control.NoneValue = false;
                     }
                     control.Value           = this.NumericValue;
                     control.ValueChanged   += new EventHandler(this.OnValueChanged);
                     this.EditControl        = control;
                     this.EditControl.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.BringToFront();
                         this.EditControl.Show();
                         this.EditControl.Focus();
                     }
                 }
                 base.DisableEvents = false;
                 base.Click(yOffset, parentWidth);
             }
         }
     }
 }
예제 #2
0
 protected override void Hide()
 {
     if (this.EditControl != null)
     {
         this.EditControl.UpdateValue();
         if (this.EditControl.NoneValue)
         {
             this.Value = null;
         }
         else
         {
             this.NumericValue = this.EditControl.Value;
         }
         this.EditControl.ValueChanged -= new EventHandler(this.OnValueChanged);
         this.EditControl.Visible       = false;
     }
     base.Hide();
     this.EditControl = null;
 }
예제 #3
0
 protected override void Hide()
 {
     if (this.EditControl != null)
     {
         this.EditControl.UpdateValue();
         if (this.EditControl.NoneValue)
         {
             this.Value = null;
         }
         else
         {
             this.NumericValue = this.EditControl.Value;
         }
         this.EditControl.ValueChanged -= new EventHandler(this.OnValueChanged);
         this.EditControl.Visible = false;
     }
     base.Hide();
     this.EditControl = null;
 }
예제 #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;
             Resco.Controls.DetailView.DetailView parent = base.Parent;
             if (parent != null)
             {
                 Resco.Controls.NumericUpDown.NumericUpDown control = parent.GetControl(typeof(Resco.Controls.NumericUpDown.NumericUpDown)) as Resco.Controls.NumericUpDown.NumericUpDown;
                 if (control != null)
                 {
                     control.DecimalPlaces = this.DecimalPlaces;
                     control.Font = base.TextFont;
                     control.Minimum = this.Minimum;
                     control.Maximum = this.Maximum;
                     control.Increment = this.Increment;
                     control.TextAlign = base.TextAlign;
                     control.UpDownWidth = this.UpDownWidth;
                     control.UpDownAlign = this.ShowArrows ? this.UpDownAlign : UpDownAlignment.None;
                     control.UpDownStyle = this.UpDownStyle;
                     control.NoneText = this.NoneText;
                     control.AllowNoneValue = this.AllowNoneValue;
                     if (this.Value == null)
                     {
                         control.NoneValue = true;
                     }
                     else
                     {
                         control.NoneValue = false;
                     }
                     control.Value = this.NumericValue;
                     control.ValueChanged += new EventHandler(this.OnValueChanged);
                     this.EditControl = control;
                     this.EditControl.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.BringToFront();
                         this.EditControl.Show();
                         this.EditControl.Focus();
                     }
                 }
                 base.DisableEvents = false;
                 base.Click(yOffset, parentWidth);
             }
         }
     }
 }