void RenderColumnHeader(IColumn c, Painter p, Node n)
		{
			p.SetPosition(c.Left);
			if (c.Left > 0)
				p.DrawSeparatorLine(Pens.Black);
			p.Pad(4);
			p.DrawString(c.Name, Font, Brushes.Black, 3, c.Left + c.Width);
		}
Beispiel #2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            Painter p = new Painter( e.Graphics, new Rectangle(0,3,ClientSize.Width, ClientSize.Height - 4) );

            p.Pad(4);
            p.DrawString(string.Format("({0}/{1})", currentPage % items.Count + 1, items.Count),
                Font, Brushes.Blue, 1, ClientSize.Width);

            foreach (Item i in items[ currentPage % items.Count ] )
                PaintItem(i, p);
        }
		protected override void OnPaint(PaintEventArgs e)
		{
			base.OnPaint(e);

			int a2 = Height / 4;
			int a1 = 3 * a2;

			e.Graphics.FillRectangle(Brushes.White, ClientRectangle);
			using (Brush b = new LinearGradientBrush(new Point(0, a1 - 1), 
				new Point(0, Height), Color.White, SystemColors.ButtonFace))
				e.Graphics.FillRectangle(b, 0, a1, Width, a2);

			Painter painter = new Painter(e.Graphics, new Rectangle(new Point(), ClientSize));
			src.RenderCustom(painter, null, RenderColumnHeader);

			e.Graphics.DrawLine(Pens.Black, 0, Height - 1, Width, Height - 1);
		}
Beispiel #4
0
 void PaintItem(Pair<string, string> item, Painter p)
 {
     p.Pad(4);
     p.DrawImage(imageProvider.GetImage(item.First));
     p.Pad(2);
     p.DrawString(item.Second, Font, SystemBrushes.ControlText, 1, ClientSize.Width);
     p.Pad(4);
 }
		public void RenderCustom(Painter p, Node n, Action<IColumn, Painter, Node> a)
		{
			foreach (IColumn c in columns)
				a(c, p, n);
		}
		public void Render(Painter p, Node n)
		{
			foreach (IColumn c in columns)
				c.Render(p, n);
		}
		public void Render(Painter p, Node n)
		{
			a(this, p, n);
		}