Example #1
0
        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;
        }
Example #2
0
        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;
        }
Example #3
0
 public PostRenderIndicatorDigitEventArgs(
     Graphics graphics, NumericIndicator indicator, NumericElement digit, int index)
 {
     _Graphics = graphics;
     _Indicator = indicator;
     _Digit = digit;
     _Index = index;
 }
Example #4
0
 public PreRenderIndicatorDigitEventArgs(
     Graphics graphics, NumericIndicator indicator, NumericElement digit, int index)
     : base(graphics, indicator, digit, index)
 {
 }
Example #5
0
        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;
                }
            }
        }
Example #6
0
        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);
        }
Example #7
0
 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;
 }