Exemple #1
0
        /// <summary>
        /// Draw the image and the displaystring of the specified cell.
        /// </summary>
        /// <param name="p_Cell"></param>
        /// <param name="p_CellPosition"></param>
        /// <param name="e">Paint arguments</param>
        /// <param name="p_ClientRectangle">Rectangle position where draw the current cell, relative to the current view,</param>
        /// <param name="p_Status"></param>
        protected override void DrawCell_ImageAndText(Cells.ICellVirtual p_Cell,
                                                      Position p_CellPosition,
                                                      PaintEventArgs e,
                                                      Rectangle p_ClientRectangle,
                                                      DrawCellStatus p_Status)
        {
            RectangleBorder l_Border    = Border;
            Color           l_ForeColor = ForeColor;

            if (p_Status == DrawCellStatus.Focus)
            {
                l_Border    = FocusBorder;
                l_ForeColor = FocusForeColor;
            }
            else if (p_Status == DrawCellStatus.Selected)
            {
                l_Border    = SelectionBorder;
                l_ForeColor = SelectionForeColor;
            }

            Font l_CurrentFont = GetCellFont();

            //Image and Text
            Utility.PaintImageAndText(e.Graphics,
                                      p_ClientRectangle,
                                      Image,
                                      ImageAlignment,
                                      ImageStretch,
                                      p_Cell.GetDisplayText(p_CellPosition),
                                      StringFormat,
                                      AlignTextToImage,
                                      l_Border,
                                      l_ForeColor,
                                      l_CurrentFont);
        }
Exemple #2
0
 /// <summary>
 /// Returns the minimum required size of the current cell, calculating using the
 /// current DisplayString, Image and Borders information.
 /// </summary>
 /// <param name="p_Graphics">GDI+ drawing surface</param>
 /// <param name="p_Cell">The cell.</param>
 /// <param name="p_CellPosition">The cell position.</param>
 /// <returns></returns>
 public override SizeF GetRequiredSize(Graphics p_Graphics,
                                       Cells.ICellVirtual p_Cell,
                                       Position p_CellPosition)
 {
     return(VisualModelBase.CalculateRequiredSize(
                p_Graphics,
                p_Cell.GetDisplayText(p_CellPosition),
                StringFormat,
                GetCellFont(),
                this.cellImage,
                this.imageAlignment,
                this.doAlignTextToImage,
                this.doImageStretch,
                Border));
 }
        /// <summary>
        /// Write the content of the tag specified
        /// </summary>
        /// <param name="p_Cell"></param>
        /// <param name="p_Position"></param>
        /// <param name="p_Export"></param>
        /// <param name="p_Writer"></param>
        /// <param name="p_ElementTagName"></param>
        protected virtual void ExportHTML_Element(Cells.ICellVirtual p_Cell, Position p_Position, IHTMLExport p_Export, System.Xml.XmlTextWriter p_Writer, string p_ElementTagName)
        {
            if (p_ElementTagName == "td")
            {
                #region Font
                p_Writer.WriteStartElement("font");

                ExportHTML_Attributes(p_Cell, p_Position, p_Export, p_Writer, "font");
                ExportHTML_Element(p_Cell, p_Position, p_Export, p_Writer, "font");

                //font
                p_Writer.WriteEndElement();
                #endregion
            }
            else if (p_ElementTagName == "font")
            {
                Utility.ExportHTML_Element_Font(p_Writer, p_Cell.GetDisplayText(p_Position), GetCellFont());
            }
        }
Exemple #4
0
 /// <summary>
 /// Returns the minimum required size of the current cell, calculating using the current DisplayString, Image and Borders informations.
 /// </summary>
 /// <param name="p_Graphics"></param>
 /// <param name="p_Cell"></param>
 /// <param name="p_CellPosition"></param>
 /// <returns></returns>
 public override SizeF GetRequiredSize(Graphics p_Graphics,
                                       Cells.ICellVirtual p_Cell,
                                       Position p_CellPosition)
 {
     return(Utility.CalculateRequiredSize(p_Graphics, p_Cell.GetDisplayText(p_CellPosition), StringFormat, GetCellFont(), m_Image, m_ImageAlignment, m_AlignTextToImage, m_imgStretch, Border));
 }
 /// <summary>
 /// Returns the minimum required size of the current cell, calculating using the current DisplayString, Image and Borders informations.
 /// </summary>
 /// <param name="p_Graphics"></param>
 /// <param name="p_Cell"></param>
 /// <param name="p_CellPosition"></param>
 /// <returns></returns>
 public virtual SizeF GetRequiredSize(Graphics p_Graphics,
                                      Cells.ICellVirtual p_Cell,
                                      Position p_CellPosition)
 {
     return(Utility.CalculateRequiredSize(p_Graphics, p_Cell.GetDisplayText(p_CellPosition), m_StringFormat, GetCellFont(), null, ContentAlignment.MiddleCenter, false, false, Border));
 }