JD2022-TU1/main/extern/ITNetwork/gear/private/tools/Ubi.Tools.GearConfigTool/GEARTreeColumn.cs

51 lines
1.2 KiB
C#

using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using System.Windows.Forms;
namespace Ubi.Tools.GearConfigTool
{
//TODO: Line that display the tree hierarchy could be added in front of each line.
// It would then become the same as a real treeview.
// The different state a row can have.
public enum TreeState
{
TreeNoChildren = 0,
TreeClosed = 1,
TreeOpened = 2
}
/**
* Declare a new column type for a DataGridView that add some treeview functionality to
* a grid.
*/
public class GEARTreeColumn : DataGridViewTextBoxColumn
{
private ImageList m_TreeStyles = null;
public GEARTreeColumn(ImageList treestyles, GEARTreeViewCell cellTemplate)
{
this.CellTemplate = cellTemplate;
m_TreeStyles = treestyles;
}
public override object Clone()
{
GEARTreeColumn c = base.Clone() as GEARTreeColumn;
c.m_TreeStyles = this.m_TreeStyles;
return c;
}
public ImageList TreeStyles
{
get { return this.m_TreeStyles; }
}
}
}