コード例 #1
0
		public void PaintSelection(SelectionRendererEventArgs info)
		{
			Rectangle inside=info.Bounds;
			inside.Inflate(1,1);
			inside.Width--;
			inside.Height--;
			Rectangle outside=info.Bounds;
			outside.Inflate(info.Width,info.Width);
			outside.Width--;
			outside.Height--;

			if(!info.BorderColor.IsEmpty)
			{
				using(Pen pen=new Pen(info.BorderColor,1))
				{
					info.Graphics.DrawRectangle(pen,inside);
					info.Graphics.DrawRectangle(pen,outside);
				}
			}

			if(!info.FillColor.IsEmpty)
			{
				using(SolidBrush brush=new SolidBrush(info.FillColor))
				{
					Region region=new Region(outside);
					region.Exclude(inside);
					info.Graphics.FillRegion(brush,region);
				}
			}
		}
コード例 #2
0
		public void PaintSelection(SelectionRendererEventArgs info)
		{
            if (info.SelectionBoxStyle == eSelectionStyle.HighlightCells)
                PaintHighlightCellsSelectionStyle(info);
            else if (info.SelectionBoxStyle == eSelectionStyle.FullRowSelect)
                PaintFullRowSelectSelectionStyle(info);
            else if (info.SelectionBoxStyle == eSelectionStyle.NodeMarker)
                PaintNodeMarkerSelectionStyle(info);
			
		}
コード例 #3
0
 private void PaintHighlightCellsSelectionStyle(SelectionRendererEventArgs info)
 {
     // Full row is just a rectangle with the background...
     Shape[] fullRowShapes = GetHighlightCellsShapes(info.TreeActive);
     Graphics g = info.Graphics;
     Rectangle bounds = info.Bounds;
     bounds.Width--;
     bounds.Height--;
     foreach (Shape shape in fullRowShapes)
     {
         shape.Paint(g, bounds);
     }
 }
コード例 #4
0
 public void PaintHotTracking(SelectionRendererEventArgs info)
 {
     // Full row is just a rectangle with the background...
     Shape[] fullRowShapes = GetHotTrackingShapes();
     Graphics g = info.Graphics;
     Rectangle bounds = info.Bounds;
     bounds.Width--;
     bounds.Height--;
     foreach (Shape shape in fullRowShapes)
     {
         shape.Paint(g, bounds);
     }
 }
コード例 #5
0
ファイル: TreeRenderer.cs プロジェクト: huamanhtuyen/VNACCS
 /// <summary>
 /// Raises RenderHotTracking event.
 /// </summary>
 /// <param name="e">Event data.</param>
 protected virtual void OnRenderHotTracking(SelectionRendererEventArgs e)
 {
     if (RenderHotTracking != null)
         RenderHotTracking(this, e);
 }
コード例 #6
0
ファイル: TreeRenderer.cs プロジェクト: huamanhtuyen/VNACCS
 /// <summary>
 /// Draws hot-tracking marker for mouse over node. 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 OnRenderHotTracking method so events can occur.
 /// </summary>
 /// <param name="e">Information provided for rendering.</param>
 public virtual void DrawHotTracking(SelectionRendererEventArgs e)
 {
     OnRenderHotTracking(e);
 }
コード例 #7
0
ファイル: TreeRenderer.cs プロジェクト: huamanhtuyen/VNACCS
		/// <summary>
		/// Raises RenderSelection event.
		/// </summary>
		/// <param name="e">Event data.</param>
		protected virtual void OnRenderSelection(SelectionRendererEventArgs e)
		{
			if(RenderSelection!=null)
				RenderSelection(this, e);
		}
コード例 #8
0
ファイル: TreeRenderer.cs プロジェクト: huamanhtuyen/VNACCS
		/// <summary>
		/// Draws selection for SelectedNode. 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 OnRenderSelection method so events can occur.
		/// </summary>
		/// <param name="e">Information provided for rendering.</param>
		public virtual void DrawSelection(SelectionRendererEventArgs e)
		{
			OnRenderSelection(e);
		}
コード例 #9
0
		/// <summary>
		/// Draws selection for SelectedNode. 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 OnRenderSelection method so events can occur.
		/// </summary>
		/// <param name="e">Information provided for rendering.</param>
		public override void DrawSelection(SelectionRendererEventArgs e)
		{
			m_SelectionDisplay.PaintSelection(e);
			base.DrawSelection(e);
		}
コード例 #10
0
        private void PaintNodeMarkerSelectionStyle(SelectionRendererEventArgs info)
        {
            Rectangle inside = info.Bounds;
            int borderWidth = 4;
            inside.Inflate(1, 1);
            inside.Width--;
            inside.Height--;
            Rectangle outside = info.Bounds;
            outside.Inflate(borderWidth, borderWidth);
            outside.Width--;
            outside.Height--;

            SelectionColorTable colorTable = info.TreeActive ? _SelectionColors.NodeMarker : _SelectionColors.NodeMarkerInactive;

            if (colorTable.Border != null)
            {
                Pen pen = colorTable.Border.CreatePen();
                if (pen != null)
                {
                    info.Graphics.DrawRectangle(pen, inside);
                    info.Graphics.DrawRectangle(pen, outside);
                    pen.Dispose();
                }
            }

            if (colorTable.Fill != null)
            {
                Brush brush = colorTable.Fill.CreateBrush(outside);
                if (brush != null)
                {
                    Region region = new Region(outside);
                    region.Exclude(inside);
                    info.Graphics.FillRegion(brush, region);
                    brush.Dispose();
                }
            }
        }