Exemplo n.º 1
0
        private void addTextGauge(string arg_str, DevExpress.XtraGauges.Win.Gauges.Digital.DigitalGauge gauge)
        {
            //if (arg_str.Length <= 20)
            //{
            //    arg_str = arg_str.PadRight(20, ' ');
            //}

            //if (_iStartText + 1 > arg_str.Length)
            //{
            //    _iStartText = 0;
            //}

            //gauge.Text += arg_str.Substring(_iStartText, 1);
        }
        private void addTextGauge(string arg_str, DevExpress.XtraGauges.Win.Gauges.Digital.DigitalGauge gauge)
        {
            if (arg_str.Length < 20)
            {
                arg_str = arg_str.PadRight(20, ' ');
            }

            if (_iStartText + 1 >= arg_str.Length)
            {
                _iStartText = 0;
            }

            gauge.Text += arg_str.Substring(_iStartText, 1);
        }
 private void addTextGauge(string arg_str, DevExpress.XtraGauges.Win.Gauges.Digital.DigitalGauge gauge)
 {
 }
        private void valueDisplayToolStripMenuItem_Click(object sender, EventArgs e)
        {
            DevExpress.XtraGauges.Win.GaugeControl gaugeControl = new DevExpress.XtraGauges.Win.GaugeControl();
            DevExpress.XtraGauges.Win.Gauges.Digital.DigitalGauge digitalGauge = new DevExpress.XtraGauges.Win.Gauges.Digital.DigitalGauge();
            DevExpress.XtraGauges.Win.Gauges.Digital.DigitalBackgroundLayerComponent digitalBackgroundLayerComponent = new DevExpress.XtraGauges.Win.Gauges.Digital.DigitalBackgroundLayerComponent();

            gaugeControl.AutoLayout = false;
            gaugeControl.Gauges.AddRange(new DevExpress.XtraGauges.Base.IGauge[] {
            digitalGauge});
            gaugeControl.Location = new System.Drawing.Point(221, 79);
            gaugeControl.Name = "gaugeControl";
            gaugeControl.Size = new System.Drawing.Size(229, 86);
            gaugeControl.TabIndex = 0;

            digitalGauge.AppearanceOff.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#FFC0C0");
            digitalGauge.AppearanceOn.ContentBrush = new DevExpress.XtraGauges.Core.Drawing.SolidBrushObject("Color:#A40000");
            digitalGauge.BackgroundLayers.AddRange(new DevExpress.XtraGauges.Win.Gauges.Digital.DigitalBackgroundLayerComponent[] {
            digitalBackgroundLayerComponent});
            digitalGauge.Bounds = new System.Drawing.Rectangle(3, 2, 221, 80);
            digitalGauge.DigitCount = 5;
            digitalGauge.Name = "digitalGauge";
            digitalGauge.Text = "1802";

            digitalBackgroundLayerComponent.BottomRight = new DevExpress.XtraGauges.Core.Base.PointF2D(259.8125F, 99.9625F);
            digitalBackgroundLayerComponent.Name = "digitalBackgroundLayerComponent";
            digitalBackgroundLayerComponent.ShapeType = DevExpress.XtraGauges.Core.Model.DigitalBackgroundShapeSetType.Style12;
            digitalBackgroundLayerComponent.TopLeft = new DevExpress.XtraGauges.Core.Base.PointF2D(20F, 0F);
            digitalBackgroundLayerComponent.ZOrder = 1000;

            ObjectIndicator indicatorAdd = new ObjectIndicator(gaugeControl);
            //indicatorAdd.ParentUserControl = this;
            SubscribeIndicator(indicatorAdd);
        }