Beispiel #1
0
		public static void PaintCell(NodeCellRendererEventArgs ci)
		{
			if(ci.Cell.CheckBoxVisible)
				CellDisplay.PaintCellCheckBox(ci);
			if(!ci.Cell.Images.LargestImageSize.IsEmpty)
				CellDisplay.PaintCellImage(ci);
			CellDisplay.PaintText(ci);
		}
Beispiel #2
0
		public static void PaintCellCheckBox(NodeCellRendererEventArgs ci)
		{
			if(!ci.Cell.CheckBoxVisible)
				return;
			Rectangle r=ci.Cell.CheckBoxBoundsRelative;
			r.Offset(ci.CellOffset);
			System.Windows.Forms.ButtonState state=System.Windows.Forms.ButtonState.Normal;
			if(ci.Cell.Checked)
				state=System.Windows.Forms.ButtonState.Checked;
            System.Windows.Forms.ControlPaint.DrawCheckBox(ci.Graphics,r,state);

		}
Beispiel #3
0
		public static void PaintCellImage(NodeCellRendererEventArgs ci)
		{
			if(ci.Cell.Images.LargestImageSize.IsEmpty)
				return;
			Rectangle r=ci.Cell.ImageBoundsRelative;
			r.Offset(ci.CellOffset);
			
			Image image = CellDisplay.GetCellImage(ci.Cell);
			
			if(image!=null)
			{
				ci.Graphics.DrawImage(image,r.X+(r.Width-image.Width)/2,
				                      r.Y+(r.Height-image.Height)/2);
			}
		}
Beispiel #4
0
		public static void PaintText(NodeCellRendererEventArgs ci)
		{
			Cell cell=ci.Cell;
			if(cell.HostedControl==null && (cell.Text=="" || ci.Style.TextColor.IsEmpty) || cell.TextContentBounds.IsEmpty )
				return;
			Rectangle bounds=ci.Cell.TextContentBounds;
			bounds.Offset(ci.CellOffset);
			
			if(cell.HostedControl!=null)
			{
//				if(ci.Graphics.Transform!=null)
//				{
//					Point[] p=new Point[] {new Point(bounds.X, bounds.Y), new Point(bounds.Right, bounds.Bottom)};
//					ci.Graphics.Transform.TransformPoints(p);
//					bounds = new Rectangle(p[0].X, p[0].Y, p[1].X-p[0].X, p[1].Y-p[0].Y);
//				}
//				if(cell.HostedControl.Bounds!=bounds)
//				{
//					cell.IgnoreHostedControlSizeChange = true;
//					cell.HostedControl.Bounds=bounds;
//					cell.IgnoreHostedControlSizeChange = false;
//				}
				if(!cell.HostedControl.Visible)
					cell.HostedControl.Visible = true;
				return;
			}

			Font font=ci.Style.Font;
			bounds.Inflate(1,1);
			if (cell.TextMarkupBody == null)
				TextDrawing.DrawString(ci.Graphics , cell.Text, font, ci.Style.TextColor, bounds, ci.Style.TextFormat);
			else
			{
				TextMarkup.MarkupDrawContext d = new TextMarkup.MarkupDrawContext(ci.Graphics, font, ci.Style.TextColor, false);
				d.HotKeyPrefixVisible = !((ci.Style.TextFormat & eTextFormat.HidePrefix) == eTextFormat.HidePrefix);
				Rectangle mr = new Rectangle(bounds.X, bounds.Y + (bounds.Height - cell.TextMarkupBody.Bounds.Height) / 2, cell.TextMarkupBody.Bounds.Width, cell.TextMarkupBody.Bounds.Height);
				mr.Offset((bounds.Width - mr.Width) / 2, 0);
				cell.TextMarkupBody.Bounds = mr;
				cell.TextMarkupBody.Render(d);
			}
		}
Beispiel #5
0
		/// <summary>
		/// Draws cell text. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
		/// do not want default rendering to occur do not call the base implementation. You can call OnRenderCellText method so events can occur.
		/// </summary>
		/// <param name="e">Information provided for rendering.</param>
		public override void DrawCellText(NodeCellRendererEventArgs e)
		{
			CellDisplay.PaintText(e);
			base.DrawCellText(e);
		}
Beispiel #6
0
		/// <summary>
		/// Draws cell image. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
		/// do not want default rendering to occur do not call the base implementation. You can call OnRenderCellImage method so events can occur.
		/// </summary>
		/// <param name="e">Information provided for rendering.</param>
		public override void DrawCellImage(NodeCellRendererEventArgs e)
		{
			CellDisplay.PaintCellImage(e);
			base.DrawCellImage(e);
		}
Beispiel #7
0
		/// <summary>
		/// Draws cell background. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
		/// do not want default rendering to occur do not call the base implementation. You can call OnRenderCellBackground method so events can occur.
		/// </summary>
		/// <param name="e">Information provided for rendering.</param>
		public override void DrawCellBackground(NodeCellRendererEventArgs e)
		{
			ElementStyleDisplayInfo di=GetElementStyleDisplayInfo(e.Style,e.Graphics,DisplayHelp.GetDrawRectangle(e.CellBounds));
			ElementStyleDisplay.Paint(di);
			
			base.DrawCellBackground(e);
		}
Beispiel #8
0
		/// <summary>
		/// Raises RenderCellImage event.
		/// </summary>
		/// <param name="e">Event arguments</param>
		protected virtual void OnRenderCellText(NodeCellRendererEventArgs e)
		{
			if(RenderCellText!=null)
				RenderCellText(this, e);
		}
Beispiel #9
0
		/// <summary>
		/// Raises RenderCellImage event.
		/// </summary>
		/// <param name="e">Event arguments</param>
		protected virtual void OnRenderCellImage(NodeCellRendererEventArgs e)
		{
			if(RenderCellImage!=null)
				RenderCellImage(this, e);
		}
Beispiel #10
0
		/// <summary>
		/// Draws cell text. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
		/// do not want default rendering to occur do not call the base implementation. You can call OnRenderCellText method so events can occur.
		/// </summary>
		/// <param name="e">Information provided for rendering.</param>
		public virtual void DrawCellText(NodeCellRendererEventArgs e)
		{
			OnRenderCellText(e);
		}
Beispiel #11
0
		/// <summary>
		/// Draws cell image. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
		/// do not want default rendering to occur do not call the base implementation. You can call OnRenderCellImage method so events can occur.
		/// </summary>
		/// <param name="e">Information provided for rendering.</param>
		public virtual void DrawCellImage(NodeCellRendererEventArgs e)
		{
			OnRenderCellImage(e);
		}
Beispiel #12
0
		/// <summary>
		/// Raises RenderCellCheckBox event.
		/// </summary>
		/// <param name="e">Event arguments</param>
		protected virtual void OnRenderCellCheckBox(NodeCellRendererEventArgs e)
		{
			if(RenderCellCheckBox!=null)
				RenderCellCheckBox(this, e);
		}
Beispiel #13
0
		/// <summary>
		/// Draws cell check box.  If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
		/// do not want default rendering to occur do not call the base implementation. You can call OnRenderCellCheckBox method so events can occur.
		/// </summary>
		/// <param name="e">Information provided for rendering.</param>
		public virtual void DrawCellCheckBox(NodeCellRendererEventArgs e)
		{
			OnRenderCellCheckBox(e);
		}
Beispiel #14
0
		/// <summary>
		/// Raises RenderCellBackground event.
		/// </summary>
		/// <param name="e">Event arguments</param>
		protected virtual void OnRenderCellBackground(NodeCellRendererEventArgs e)
		{
			if(RenderCellBackground!=null)
				RenderCellBackground(this, e);
		}
Beispiel #15
0
		/// <summary>
		/// Draws cell background. If you need to provide custom rendering this is the method that you should override in your custom rendered. If you
		/// do not want default rendering to occur do not call the base implementation. You can call OnRenderCellBackground method so events can occur.
		/// </summary>
		/// <param name="e">Information provided for rendering.</param>
		public virtual void DrawCellBackground(NodeCellRendererEventArgs e)
		{
			OnRenderCellBackground(e);
		}