Source/AdvTree/Layout/NodeTreeLayout.cs
(开头部分) 12KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
using System.Collections;
using System.Drawing;
using System.Windows.Forms;
using System;
using System.Drawing.Drawing2D;
using System.Drawing.Text;
using DevComponents.DotNetBar;
namespace DevComponents.AdvTree.Layout
{
/// <summary>
/// Summary description for NodeTreeLayout.
/// </summary>
internal class NodeTreeLayout:NodeLayout
{
//private bool m_LayoutPerformed=false;
public NodeTreeLayout(AdvTree treeControl, Rectangle clientArea):base(treeControl,clientArea)
{
//m_ExpandAreaWidth=16;
//m_ExpandPartSize=new Size(9,9);
}
public override void UpdateTopLevelColumnsWidth()
{
if (this.Tree.Columns.Count > 0)
{
Rectangle columnsBounds = DevComponents.DotNetBar.ElementStyleLayout.GetInnerRect(this.Tree.BackgroundStyle, this.Tree.ClientRectangle);
if (this.Tree.VScrollBar != null) columnsBounds.Width -= this.Tree.VScrollBar.Width;
columnsBounds.Height = this.Tree.Columns.Bounds.Height;
if(this.Tree.Columns.Bounds.Width<columnsBounds.Width)
this.Tree.Columns.SetBounds(columnsBounds);
}
}
public override void PerformLayout()
{
this.PrepareStyles();
Rectangle area = Rectangle.Empty;
Graphics g=this.GetGraphics();
SmoothingMode sm = g.SmoothingMode;
TextRenderingHint th = g.TextRenderingHint;
if (m_Tree.AntiAlias)
{
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
//g.TextRenderingHint = DisplayHelp.AntiAliasTextRenderingHint;
}
NodeLayoutContextInfo layoutInfo = GetDefaultNodeLayoutContextInfo(g);
layoutInfo.ExpandPartAlignedLeft = true;
layoutInfo.Left = ClientArea.X;
layoutInfo.Top = ClientArea.Y;
CellLayout cellLayout = this.GetCellLayout();
cellLayout.ResetCheckBoxSize();
if (this.Tree.CheckBoxImageChecked != null)
cellLayout.CheckBoxSize = this.Tree.CheckBoxImageChecked.Size;
LayoutTopLevelColumns(layoutInfo);
后面还有 232 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。