Exemplo n.º 1
0
        public void DrawCursor(Graphics g, FormulaChart fc, FormulaArea Area, float X)
        {
            if (!this.LastCursorRect.IsEmpty)
            {
                fc.RestoreMemBmp(g, this.LastCursorRect);
            }
            FormulaLabel label     = Area.Labels[2];
            int          cursorPos = fc.CursorPos;

            if ((Object)fdDate != null && cursorPos >= 0)
            {
                if (cursorPos < this.fdDate.Length)
                {
                    string text = DateTime.FromOADate(this.fdDate[cursorPos]).ToString(this.CursorFormat,
                                                                                       DateTimeFormatInfo.InvariantInfo);
                    SizeF      ef   = g.MeasureString(text, this.LabelFont);
                    RectangleF rect = new RectangleF(X - fc.Rect.X, (float)this.Rect.Y, ef.Width,
                                                     (float)(this.Rect.Height - 1));
                    this.LastCursorRect = rect;
                    this.LastCursorRect.Inflate(2f, 1f);
                    rect.Offset((PointF)fc.Rect.Location);
                    label.DrawString(g, text, this.LabelFont, label.TextBrush, VerticalAlign.Bottom, FormulaAlign.Left,
                                     rect, false);
                }
            }
        }
Exemplo n.º 2
0
        public void DrawCursor(Graphics g, FormulaChart fc, FormulaArea Area, float Y, double d)
        {
            if (!this.LastCursorRect.IsEmpty)
            {
                fc.RestoreMemBmp(g, this.LastCursorRect);
            }
            FormulaLabel label = Area.Labels[2];
            string       text  = d.ToString(this.Format);
            SizeF        ef    = g.MeasureString(text, this.LabelFont);
            RectangleF   rect  = new RectangleF((float)this.Rect.Left, Y - fc.Rect.Y, (this.Rect.Width - 1) - this.Back.RightPen.Width, ef.Height);

            this.LastCursorRect = rect;
            this.LastCursorRect.Inflate(2f, 1f);
            rect.Offset((PointF)fc.Rect.Location);
            label.DrawString(g, text, this.LabelFont, label.TextBrush, VerticalAlign.Bottom, FormulaAlign.Left, rect, false);
        }