Example #1
0
 int ICellViewer.GetFittedHeight( Cell cell, AutoHeightMode ahm )
 {
     return -1;
 }
        ///// <summary>
        ///// PaintCellBackground
        ///// </summary>
        ///// <param name="cell"></param>
        ///// <param name="e"></param>
        ///// <param name="handled"></param>
        //protected override void PaintCellBackground(Cell cell, GridPaintEventArgs e, ref bool handled)
        //{
        //    if (m_images.Count == 0)
        //    {
        //        return;
        //    }

        //    if ((cell.Value != null) && (cell.Value != DBNull.Value) && (cell.Value != cell.NullValue))
        //    {
        //        string[] ss = cell.Value.ToString().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
        //        foreach (string s in ss)
        //        {
        //            int height = e.DisplayRectangle.Height;
        //            int cnt = 0;
        //            if (m_images.ContainsKey(s))
        //            {
        //                int x = e.DisplayRectangle.X + height * cnt;
        //                int y = e.DisplayRectangle.Y; // +((e.DisplayRectangle.Height - m_images[s].Height) / 2);
        //                //int imageHeight = MultiImageViewer.m_Images[0].Height;

        //                e.Graphics.FillRectangle(new SolidBrush(Color.Red), x, y, height, height);

        //                e.Graphics.DrawImage(m_images[s], x, y, height, height);
        //                cnt++;
        //            }
        //        }
        //    }

        //    // Notify the cell that its background has been painted by the CellViewerManager.
        //    handled = true;
        //}

        ///// <summary>
        ///// PaintCellForeground
        ///// </summary>
        ///// <param name="cell"></param>
        ///// <param name="e"></param>
        ///// <param name="handled"></param>
        //protected override void PaintCellForeground(Cell cell, GridPaintEventArgs e, ref bool handled)
        //{
        //    // Notify the cell that its foreground has been painted by the CellViewerManager.
        //    handled = true;
        //}

        /// <summary>
        /// GetFittedHeightCore
        /// </summary>
        /// <param name="cell"></param>
        /// <param name="mode"></param>
        /// <param name="cellDisplayWidth"></param>
        /// <param name="graphics"></param>
        /// <param name="printing"></param>
        /// <returns></returns>
        protected override int GetFittedHeightCore(Cell cell, AutoHeightMode mode, int cellDisplayWidth,
                                                   Graphics graphics, bool printing)
        {
            return(imageHeight + 2);
        }
Example #3
0
 /// <summary>
 /// GetFittedHeightCore
 /// </summary>
 /// <param name="cell"></param>
 /// <param name="mode"></param>
 /// <param name="cellDisplayWidth"></param>
 /// <param name="graphics"></param>
 /// <param name="printing"></param>
 /// <returns></returns>
 protected override int GetFittedHeightCore(Cell cell, AutoHeightMode mode, int cellDisplayWidth,
                                            Graphics graphics, bool printing)
 {
     return(Math.Max(m_imageLeft.Height, m_imageRight.Height) + 2);
 }
Example #4
0
 protected override int GetFittedDisplayHeight(AutoHeightMode mode, Graphics graphics, bool printing)
 {
     return(this.DefaultHeight);
 }
 /// <summary>
 /// 
 /// </summary>
 /// <param name="mode"></param>
 /// <param name="cellDisplayWidth"></param>
 /// <param name="graphics"></param>
 /// <param name="printing"></param>
 /// <returns></returns>
 protected override int GetFittedDisplayHeight(AutoHeightMode mode, int cellDisplayWidth, Graphics graphics, bool printing)
 {
     // +4 is for the button's borders
     return (int)Math.Ceiling(this.Font.GetHeight()) + 4;
 }
Example #6
0
 /// <summary>
 /// GetFittedHeightCore
 /// </summary>
 /// <param name="control"></param>
 /// <param name="cell"></param>
 /// <param name="mode"></param>
 /// <param name="cellDisplayWidth"></param>
 /// <param name="graphics"></param>
 /// <param name="printing"></param>
 /// <returns></returns>
 protected override int GetFittedHeightCore(System.Windows.Forms.Control control, Cell cell, AutoHeightMode mode,
                                            int cellDisplayWidth, System.Drawing.Graphics graphics, bool printing)
 {
     return(20);
 }
 /// <summary>
 /// GetFittedHeightCore
 /// </summary>
 /// <param name="cell"></param>
 /// <param name="mode"></param>
 /// <param name="cellDisplayWidth"></param>
 /// <param name="graphics"></param>
 /// <param name="printing"></param>
 /// <returns></returns>
 protected override int GetFittedHeightCore(Cell cell, AutoHeightMode mode, int cellDisplayWidth,
                                            Graphics graphics, bool printing)
 {
     return 20;
 }
 /// <summary>
 /// GetFittedHeightCore
 /// </summary>
 /// <param name="control"></param>
 /// <param name="cell"></param>
 /// <param name="mode"></param>
 /// <param name="cellDisplayWidth"></param>
 /// <param name="graphics"></param>
 /// <param name="printing"></param>
 /// <returns></returns>
 protected override int GetFittedHeightCore(System.Windows.Forms.Control control, Cell cell, AutoHeightMode mode,
                                            int cellDisplayWidth, System.Drawing.Graphics graphics, bool printing)
 {
     return 20;
 }
Example #9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="mode"></param>
 /// <param name="cellDisplayWidth"></param>
 /// <param name="graphics"></param>
 /// <param name="printing"></param>
 /// <returns></returns>
 protected override int GetFittedDisplayHeight(AutoHeightMode mode, int cellDisplayWidth, Graphics graphics, bool printing)
 {
     // +4 is for the button's borders
     return((int)Math.Ceiling(this.Font.GetHeight()) + 4);
 }
 /// <summary>
 /// GetFittedHeightCore
 /// </summary>
 /// <param name="cell"></param>
 /// <param name="mode"></param>
 /// <param name="cellDisplayWidth"></param>
 /// <param name="graphics"></param>
 /// <param name="printing"></param>
 /// <returns></returns>
 protected override int GetFittedHeightCore(Cell cell, AutoHeightMode mode, int cellDisplayWidth,
                                            Graphics graphics, bool printing)
 {
     return Math.Max(m_imageLeft.Height, m_imageRight.Height) +2;
 }