Пример #1
0
        public object Clone()
        {
            LiteralText LiteralText = new LiteralText();

            LiteralText.Text = this.Text;
            return(LiteralText);
        }
Пример #2
0
        public override bool StopEditing()
        {
            if (Element != null && Element.Value is LiteralText)
            {
                LiteralText literalText = Element.Value as LiteralText;
                textbox.Text = literalText.Text;
            }

            base.FireEditingStopped();

            return(true);
        }
Пример #3
0
        public override void StartEditing(EventArgs e, bool selectAll, bool autoClipboard)
        {
            selectAll = true;

            if (Element != null && Element.Value is LiteralText)
            {
                LiteralText literalText = Element.Value as LiteralText;
                textbox.Text = literalText.Text;
            }

            base.StartEditing(e, selectAll, autoClipboard);
        }
Пример #4
0
 public override void PaintCell(Graphics g, Rectangle r, FarPoint.Win.Spread.Appearance appearance, object value, bool isSelected, bool isLocked, float zoomFactor)
 {
     if (value != null && value is GridElement)
     {
         GridElement Element = value as GridElement;
         if (Element.Value is LiteralText)
         {
             LiteralText literalText = Element.Value as LiteralText;
             base.PaintCell(g, r, appearance, literalText.Text, isSelected, isLocked, zoomFactor);
         }
     }
     else
     {
         base.PaintCell(g, r, appearance, value, isSelected, isLocked, zoomFactor);
     }
 }
Пример #5
0
        public override void PaintCell(System.Drawing.Graphics g, System.Drawing.Rectangle r, FarPoint.Win.Spread.Appearance appearance, object value, bool isSelected, bool isLocked, float zoomFactor)
        {
            if (value is GridElement)
            {
                GridElement Element = value as GridElement;
                if (Element.Value is Slash) //绘出一个斜线单元格
                {
                    ReportElementDrawing.PaintSlash(g, r, appearance, Element);
                }
                else if (Element.Value is DataColumn) //绘出一个数据列
                {
                    ReportElementDrawing.PaintDataColumn(g, r, appearance, Element);
                }
                else if (Element.Value is Formula) //绘出一个公式
                {
                    ReportElementDrawing.PaintFormula(g, r, appearance, Element);
                }
                else if (Element.Value is Picture) //绘出一个图片
                {
                    ReportElementDrawing.PaintImage(g, r, appearance, Element);
                }
                else if (Element.Value is LiteralText)//绘出文本
                {
                    LiteralText literalText = Element.Value as LiteralText;
                    base.PaintCell(g, r, appearance, literalText.Text, isSelected, isLocked, zoomFactor);
                }
                else if (Element.Value is Variable)//绘出一个变量
                {
                    ReportElementDrawing.PaintVariable(g, r, appearance, Element);
                }
                else if (Element.Value is ChartPainter)//绘出一个图表
                {
                    ReportElementDrawing.PaintChart(g, r, appearance, Element);
                }
                else
                {
                    base.PaintCell(g, r, appearance, "", isSelected, isLocked, zoomFactor);
                }

                ReportElementDrawing.PaintPageBreak(g, r, appearance, Element);
            }
            else
            {
                base.PaintCell(g, r, appearance, value, isSelected, isLocked, zoomFactor);
            }
        }