public object Clone() { LiteralText LiteralText = new LiteralText(); LiteralText.Text = this.Text; return(LiteralText); }
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); }
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); }
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); } }
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); } }