private void InitElement(NumericElement element, char value, Color color, Color dimColor) { element.Value = value; element.DigitColor = color; element.DigitDimColor = dimColor; element.ColonPointsOn = false; element.DecimalPointOn = false; element.ShowDimColonPoints = _ShowDimColonPoints; element.ShowDimDecimalPoint = _ShowDimDecimalPoint; element.ShowDimSegments = _ShowDimSegments; }
private void AllocateElements() { NumericElement[] digit = new NumericElement[_NumberOfDigits]; for (int i = 0; i < _NumberOfDigits; i++) { NumericElement d; switch (_Style) { case NumericIndicatorStyle.Mechanical: d = new MechanicalElement(this); break; case NumericIndicatorStyle.Digital7Segment: d = new Seg7Element(this); break; default: d = new Seg16Element(this); break; } digit[i] = d; if (_Digits != null) { if (i < _Digits.Length) _Digits[i].CopyToItem(d); } } if (_Digits != null) { for (int i = _NumberOfDigits; i < _Digits.Length; i++) _Digits[i].Dispose(); } _Digits = digit; }
public PostRenderIndicatorDigitEventArgs( Graphics graphics, NumericIndicator indicator, NumericElement digit, int index) { _Graphics = graphics; _Indicator = indicator; _Digit = digit; _Index = index; }
public PreRenderIndicatorDigitEventArgs( Graphics graphics, NumericIndicator indicator, NumericElement digit, int index) : base(graphics, indicator, digit, index) { }
internal void OnPostRenderIndicatorDigit( PaintEventArgs e, NumericIndicator indicator, NumericElement digit, int index) { if (PostRenderIndicatorDigit != null) { PostRenderIndicatorDigitEventArgs args = new PostRenderIndicatorDigitEventArgs(e.Graphics, indicator, digit, index); try { digit.InRenderCallout = true; PostRenderIndicatorDigit(this, args); } finally { digit.InRenderCallout = false; } } }
internal bool OnPreRenderIndicatorDigit( PaintEventArgs e, NumericIndicator indicator, NumericElement digit, int index) { if (PreRenderIndicatorDigit != null) { PreRenderIndicatorDigitEventArgs args = new PreRenderIndicatorDigitEventArgs(e.Graphics, indicator, digit, index); try { digit.InRenderCallout = true; PreRenderIndicatorDigit(this, args); } finally { digit.InRenderCallout = false; } if (args.Cancel == true) return (true); } return (false); }
public virtual void CopyToItem(NumericElement copy) { copy.BackColor = _BackColor; copy.Bounds = _Bounds; copy.DigitDimColor = _DigitDimColor; copy.ColonPointsOn = _ColonPointsOn; copy.DigitColor = _DigitColor; copy.DigitDimColor = _DigitDimColor; copy.ShowDimColonPoints = _ShowDimColonPoints; copy.ShowDimDecimalPoint = _ShowDimDecimalPoint; copy.ShowDimSegments = _ShowDimSegments; copy.Value = _Value; }