Bless.Gui.Areas.Plugins.GroupedArea.RenderRowNormal C# (CSharp) Method

RenderRowNormal() protected method

protected RenderRowNormal ( int i, int p, int n, bool blank ) : void
i int
p int
n int
blank bool
return void
	protected override void RenderRowNormal(int i, int p, int n, bool blank)
	{
		int rx = 0 + x;
		int ry = i * drawer.Height + y;
		long roffset = areaGroup.Offset + i * bpr + p;
		bool odd;
		Gdk.GC backEvenGC = drawer.GetBackgroundGC(Drawer.RowType.Even, Drawer.HighlightType.Normal);
		Gdk.GC backOddGC = drawer.GetBackgroundGC(Drawer.RowType.Odd, Drawer.HighlightType.Normal);

		// odd row?
		odd = (((roffset / bpr) % 2) == 1);

		if (blank == true) {
			if (odd)
				backPixmap.DrawRectangle(backOddGC, true, rx, ry, width, drawer.Height);
			else
				backPixmap.DrawRectangle(backEvenGC, true, rx, ry, width, drawer.Height);
		}

		Drawer.ColumnType colType;
		Drawer.RowType rowType;

		if (odd)
			rowType = Drawer.RowType.Odd;
		else
			rowType = Drawer.RowType.Even;

		int pos = 0;
		// draw bytes
		while (true) {

			if (pos >= p) { //don't draw until we reach p
				if ((pos / grouping) % 2 == 0)
					colType = Drawer.ColumnType.Even;
				else
					colType = Drawer.ColumnType.Odd;

				drawer.DrawNormal(backEvenGC, backPixmap, rx, ry, areaGroup.GetCachedByte(roffset++), rowType, colType);
				if (--n <= 0)
					break;
			}

			// space if necessary
			if (pos % grouping == grouping - 1)
				rx = rx + (dpb + 1) * drawer.Width;
			else
				rx = rx + dpb * drawer.Width;

			pos++;
		}
	}