Inheritance: System.EventArgs
Exemple #1
0
        internal override void OnRangePaint(RangePaintEventArgs e)
        {
            //[email protected]: In general this method will not be hit if smoothscrolling is enabled. This is like a double protection.
            if (!EnableSmoothScrolling)
            {
                mDrawnRange.Clear();
            }

            base.OnRangePaint(e);
        }
Exemple #2
0
		protected override void OnRangePaint(RangePaintEventArgs e)
		{
			mDrawnRange.Clear();

			base.OnRangePaint(e);
		}
Exemple #3
0
		protected virtual void OnRangePaint(RangePaintEventArgs e)
		{
			Rectangle drawRectangle = RangeToRectangle(e.DrawingRange);

			System.Drawing.Drawing2D.GraphicsState state = e.GraphicsCache.Graphics.Save();

			try
			{
				e.GraphicsCache.Graphics.SetClip(drawRectangle);

				int top = drawRectangle.Top;
				int width;
				int height;
				foreach (var r in m_Rows.HiddenRowsCoordinator.LoopVisibleRows(e.DrawingRange.Start.Row, e.DrawingRange.End.Row - e.DrawingRange.Start.Row))
					//for (int r = e.DrawingRange.Start.Row; r <= e.DrawingRange.End.Row; r++)
				{
					if (Rows.IsRowVisible(r) == false)
						throw new SourceGridException("Incorrect internal state. This rows must have been visible");
					height = Rows.GetHeight(r);

					int left = drawRectangle.Left;
					for (int c = e.DrawingRange.Start.Column; c <= e.DrawingRange.End.Column; c++)
					{
						width = Columns.GetWidth(c);
						if (Columns.IsColumnVisible(c) == false)
							continue;

						Position position = new Position(r, c);

						Cells.ICellVirtual cell = GetCell(position);
						if (cell != null)
						{
							Rectangle drawRect = new Rectangle(left, top, width, height);

							//Draw the cell only if inside the ClipRectangle
							if (e.GraphicsCache.ClipRectangle.IsEmpty ||
							    e.GraphicsCache.ClipRectangle.IntersectsWith(drawRect))
							{
								CellContext cellContext = new CellContext(this, position, cell);
								PaintCell(e.GraphicsCache, cellContext, drawRect);
							}
						}

						left += width;
					}

					top += height;
				}

				//Draw the decorators
				foreach (SourceGrid.Decorators.DecoratorBase dec in Decorators)
				{
					if (dec.IntersectWith(e.DrawingRange))
						dec.Draw(e);
				}

				if (RangePaint != null)
					RangePaint(this, e);
			}
			finally
			{
				e.GraphicsCache.Graphics.Restore(state);
			}
		}
 void Grid_RangePaint(GridVirtual sender, RangePaintEventArgs e)
 {
     DrawHighlight(e.GraphicsCache, e.DrawingRange);
 }
        protected override void OnRangePaint(RangePaintEventArgs e)
        {
            mDrawnRange.Clear();

            base.OnRangePaint(e);
        }
Exemple #6
0
        protected virtual void OnRangePaint(RangePaintEventArgs e)
        {
            Rectangle drawRectangle = RangeToRectangle(e.DrawingRange);

            System.Drawing.Drawing2D.GraphicsState state = e.GraphicsCache.Graphics.Save();

            try
            {
                e.GraphicsCache.Graphics.SetClip(drawRectangle);

                int top = drawRectangle.Top;
                int width;
                int height;
                for (int r = e.DrawingRange.Start.Row; r <= e.DrawingRange.End.Row; r++)
                {
                    height = Rows.GetHeight(r);

                    int left = drawRectangle.Left;
                    for (int c = e.DrawingRange.Start.Column; c <= e.DrawingRange.End.Column; c++)
                    {
                        width = Columns.GetWidth(c);

                        Position position = new Position(r, c);

                        Cells.ICellVirtual cell = GetCell(position);
                        if (cell != null)
                        {
                            CellContext cellContext = new CellContext(this, position, cell);
                            Rectangle drawRect = new Rectangle(left, top, width, height);

                            PaintCell(e.GraphicsCache, cellContext, drawRect);
                        }

                        left += width;
                    }

                    top += height;
                }

                //Draw the decorators
                foreach (SourceGrid.Decorators.DecoratorBase dec in Decorators)
                {
                    if (dec.IntersectWith(e.DrawingRange))
                        dec.Draw(e);
                }

                if (RangePaint != null)
                    RangePaint(this, e);
            }
            finally
            {
                e.GraphicsCache.Graphics.Restore(state);
            }
        }
Exemple #7
0
 void Grid_RangePaint(GridVirtual sender, RangePaintEventArgs e)
 {
     DrawHighlight(e.GraphicsCache, e.DrawingRange);
 }