コード例 #1
0
        public TimeSeriesChart() : base()
        {
            //SetStyle(ControlStyles.OptimizedDoubleBuffer, true); //the PlotPane is already dbl buffered
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); //no ERASE BACKGROUND

            SetStyle(ControlStyles.UserMouse, true);

            UpdateStyles();

            m_TimeScalePane        = new TimeScalePane(this);
            m_TimeScalePane.Parent = this;
            m_TimeScalePane.Height = 25;
            m_TimeScalePane.Dock   = DockStyle.Bottom;
            ShowTimeGaps           = true;

            m_ChartPanel           = new Panel();
            m_ChartPanel.Parent    = this;
            m_ChartPanel.KeyDown  += (s, e) => OnKeyDown(e);
            m_ChartPanel.KeyUp    += (s, e) => OnKeyUp(e);
            m_ChartPanel.KeyPress += (s, e) => OnKeyPress(e);

            Controls.Add(m_ChartPanel);
            Controls.Add(m_TimeScalePane);

            m_ChartPanel.Dock = DockStyle.Fill;

            Style                = new Style(this, null);
            GridLineStyle        = new LineStyle();
            SplitterStyle        = new Style(this, null);
            RulerStyle           = new Style(this, null);
            PlotStyle            = new Style(this, null);
            TimeScaleStyle       = new Style(this, null);
            TimeScaleSelectStyle = new Style(this, null);
            LastPriceMarkerStyle = new Style(this, null);

            BuildDefaultStyle();

            ZoomStepPercent   = 5;
            TimeLineTickSpace = TimeScalePane.DEFAULT_TICK_SPACE;

            m_ControllerNotificationTimer          = new Timer();
            m_ControllerNotificationTimer.Interval = REBUILD_TIMEOUT_MS;
            m_ControllerNotificationTimer.Enabled  = false;
            m_ControllerNotificationTimer.Tick    += (o, e) =>
            {
                //todo ETO NUJNO DLYA DRAG/DROP   if (m_RepositioningColumn!=null || m_ResizingColumn!=null ) return;//while grid is being manipulated dont flush timer just yet

                m_ControllerNotificationTimer.Stop();
                rebuildChart();
            };
        }
コード例 #2
0
 protected internal TimeCursorElement(TimeScalePane host) : base(host)
 {
     this.Region = new Rectangle(0, 0, Pane.Chart.TimeLineTickSpace, host.Height);
 }