private void SetFormLocation(StripChartX parentChart)
        {
            Control currentControl = parentChart;
            int     chartAbsoluteX = parentChart.Location.X;
            int     chartAbsoluteY = parentChart.Location.X;

            while (null != currentControl.Parent)
            {
                currentControl  = currentControl.Parent;
                chartAbsoluteX += currentControl.Location.X;
                chartAbsoluteY += currentControl.Location.Y;
            }
            int       formPositionX = chartAbsoluteX + parentChart.Width - this.Width / 2;
            int       formPositionY = chartAbsoluteY + parentChart.Height - this.Height;
            Rectangle workingArea   = Screen.GetWorkingArea(this);

            if (formPositionX + this.Width > workingArea.Width + workingArea.X)
            {
                formPositionX = workingArea.Width + workingArea.X - this.Width;
            }
            else if (formPositionX < 0)
            {
                formPositionX = 0;
            }

            if (formPositionY + this.Height > workingArea.Height + workingArea.Y)
            {
                formPositionY = workingArea.Height + workingArea.Y - this.Height;
            }
            else if (formPositionY < 0)
            {
                formPositionY = 0;
            }
            this.Location = new Point(formPositionX, formPositionY);
        }
Ejemplo n.º 2
0
 internal ChartViewManager(StripChartX parentChart, Chart plotChart, PlotManager plotManager)
 {
     this._parentChart = parentChart;
     this._plotChart   = plotChart;
     this._plotManager = plotManager;
     this.MainPlotArea = new StripChartXPlotArea(parentChart, plotChart.ChartAreas[0]);
     this.MainPlotArea.ChartArea.Position.Auto = true;
     this._layoutDirection  = LayoutDirection.LeftToRight;
     this._oneWayChartNum   = 3;
     this.UseMainAreaConfig = true;
     this.SplitPlotAreas    = new StripChartXPlotAreaCollection(parentChart, plotChart.ChartAreas);
     AdaptView();
 }
        /// <summary>
        /// TabCursor infomation form
        /// </summary>
        public StripTabCursorInfoForm(StripChartX parentChart)
        {
            InitializeComponent();
            this._cursors     = parentChart.TabCursors;
            this._parentChart = parentChart;
            RefreshCursorInfo();
            SetFormLocation(parentChart);
            const string formNameFormat = "{0} Tab Cursors";

            this.Text = string.Format(formNameFormat, parentChart.Name);
            this._isInternalOperation = false;

            RefreshSeriesNames();
            this._parentChart.TabCursorChanged += RefreshCursorValue;
            this._parentChart.AfterPlot        += RefreshCursorXYValue;
            // RunTimeEditable为false时,tabCursor的添加删除按钮不使能
            if (!parentChart.TabCursors.RunTimeEditable)
            {
                tableLayoutPanel_buttonPanel.Enabled = false;
            }
        }
Ejemplo n.º 4
0
        internal PlotManager(StripChartX parentChart, SeriesCollection plotSeries)
        {
            // LineSeries只是一个用于维护对外接口的属性
            this._fitType = StripChartX.FitType.Range;

            this.IsPlotting       = false;
            this._parentChart     = parentChart;
            this._plotSeriesCount = 1;

            this.PlotSeries       = plotSeries;
            this._plotSeriesCount = PlotSeries.Count;

            this.DataEntity = null;

            this._series    = new StripChartXSeriesCollection(plotSeries, parentChart);
            this.LineSeries = new StripChartXLineSeries(_series);

            this.DataCheckParams = new DataCheckParameters();

            this.DisplayPoints = Constants.DefaultDisplaySamples;

            this.MaxSeriesCount = Constants.DefaultMaxSeriesCount;
        }
 internal MiscellaneousConfiguration(StripChartX parentChart, ChartViewManager viewManager, PlotManager plotManager)
 {
     this._parentChart = parentChart;
     this._plotManager = plotManager;
     this._viewManager = viewManager;
 }