Source/AdvTree/Layout/ColumnHeaderLayout.cs

(开头部分) 4KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Drawing;
using DevComponents.DotNetBar;

namespace DevComponents.AdvTree.Layout
{
	/// <summary>
	/// Class that is used to layout column header.
	/// </summary>
	internal class ColumnHeaderLayout
	{
		public ColumnHeaderLayout()
		{
		}

		// Assumes that layoutInfo is up-to-date and that Node that is connected with
		// columns is already processed and it's size and location calculated.
		// layoutInfo.Top member reflects the next position below the node
		// layoutInfo.LevelOffset should reflect the X offset for the child nodes.
		public static int LayoutColumnHeader(NodeLayoutContextInfo layoutInfo,int x, int y, int clientWidth, int cellHorizontalSpacing)
		{
            ColumnHeaderCollection columns = null;
			Node node=layoutInfo.ContextNode;
            if (node == null)
                columns = layoutInfo.TreeColumns;
            else
                columns = node.NodesColumns;
            columns.UsesRelativeSize = false;
            int height=0;
            bool adjustHeight = false;
            Rectangle totalBounds = Rectangle.Empty;
            ColumnHeader lastVisibleColumn = null;
            bool allRelative = true;
            bool firstVisible = true;
            foreach (ColumnHeader col in columns)
			{
                col.IsLastVisible = false;
				if(!col.Visible)
					continue;
                col.IsFirstVisible = firstVisible;
                firstVisible = false;
				//if(col.SizeChanged)
				{
					// Column for child nodes is always placed below the current node and
					// is not included in the node's rectangle
					Rectangle bounds=Rectangle.Empty;
					bounds.X=x;
					bounds.Y=y;
                    if (col.Width.AutoSize)
                    {
                        bounds.Width = col.Width.AutoSizeWidth;
                        allRelative = false;
                    }
                    else if (col.Width.Absolute > 0)
                    {
                        bounds.Width = col.Width.Absolute;
                        allRelative = false;
                    }
                    else if (col.Width.Absolute == -1)
                    {
后面还有 73 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。