本文整理汇总了C#中Aga.Controls.Tree.TreeColumn类的典型用法代码示例。如果您正苦于以下问题:C# TreeColumn类的具体用法?C# TreeColumn怎么用?C# TreeColumn使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TreeColumn类属于Aga.Controls.Tree命名空间,在下文中一共展示了TreeColumn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResizeColumnState
public ResizeColumnState(TreeViewAdv tree, TreeColumn column, Point p)
: base(tree)
{
_column = column;
_initLocation = p;
_initWidth = column.Width;
}
示例2: AutoSizeColumn
public void AutoSizeColumn(TreeColumn column)
{
if (!Columns.Contains(column))
throw new ArgumentException("column");
DrawContext context = new DrawContext();
context.Graphics = Graphics.FromImage(new Bitmap(1, 1));
context.Font = this.Font;
int res = 0;
for (int row = 0; row < RowCount; row++)
{
if (row < RowMap.Count)
{
int w = 0;
TreeNodeAdv node = RowMap[row];
foreach (NodeControl nc in NodeControls)
{
if (nc.ParentColumn == column)
w += nc.GetActualSize(node, _measureContext).Width;
}
res = Math.Max(res, w);
}
}
if (res > 0)
column.Width = res;
}
示例3: ProcessTree
public ProcessTree()
{
InitializeComponent();
var column = new TreeColumn("CPU History", 60);
column.IsVisible = false;
column.MinColumnWidth = 10;
treeProcesses.Columns.Add(column);
treeProcesses.NodeControls.Add(new ProcessHacker.Components.NodePlotter()
{
DataPropertyName = "CpuHistory",
ParentColumn = column
});
column = new TreeColumn("I/O History", 60);
column.IsVisible = false;
column.MinColumnWidth = 10;
treeProcesses.Columns.Add(column);
treeProcesses.NodeControls.Add(new ProcessHacker.Components.NodePlotter()
{
DataPropertyName = "IoHistory",
ParentColumn = column
});
treeProcesses.KeyDown += new KeyEventHandler(ProcessTree_KeyDown);
treeProcesses.MouseDown += new MouseEventHandler(treeProcesses_MouseDown);
treeProcesses.MouseUp += new MouseEventHandler(treeProcesses_MouseUp);
treeProcesses.DoubleClick += new EventHandler(treeProcesses_DoubleClick);
nodeName.ToolTipProvider = _tooltipProvider = new ProcessToolTipProvider(this);
// make it draw when we want it to draw :)
treeProcesses.BeginUpdate();
}
示例4: OnColumnReordered
internal void OnColumnReordered(TreeColumn column)
{
this.InvalidateNodeControlCache();
if (ColumnReordered != null)
ColumnReordered(this, new TreeColumnEventArgs(column));
}
示例5: ReorderColumnState
public ReorderColumnState(TreeViewAdv tree, TreeColumn column, Point initialMouseLocation)
: base(tree, column)
{
_location = new Point(initialMouseLocation.X + Tree.OffsetX, 0);
_dragOffset = tree.GetColumnX(column) - initialMouseLocation.X;
_ghostImage = column.CreateGhostImage(new Rectangle(0, 0, column.Width, tree.ActualColumnHeaderHeight), tree.Font);
}
示例6: MouseMove
public override bool MouseMove(MouseEventArgs args)
{
_dropColumn = null;
_location = new Point(args.X + Tree.OffsetX, 0);
int x = 0;
foreach (TreeColumn c in Tree.Columns)
{
if (c.IsVisible)
{
if (_location.X < x + c.Width / 2)
{
_dropColumn = c;
break;
}
x += c.Width;
}
}
Tree.UpdateHeaders();
return true;
}
示例7: ProcessTree
public ProcessTree()
{
InitializeComponent();
TreeColumn column = new TreeColumn("CPU History", 60)
{
IsVisible = false,
MinColumnWidth = 10
};
treeProcesses.Columns.Add(column);
treeProcesses.NodeControls.Add(new Components.NodePlotter
{
DataPropertyName = "CpuHistory",
ParentColumn = column
});
column = new TreeColumn("I/O History", 60)
{
IsVisible = false,
MinColumnWidth = 10
};
treeProcesses.Columns.Add(column);
treeProcesses.NodeControls.Add(new Components.NodePlotter
{
DataPropertyName = "IoHistory",
ParentColumn = column
});
treeProcesses.KeyDown += this.ProcessTree_KeyDown;
treeProcesses.MouseDown += this.treeProcesses_MouseDown;
treeProcesses.MouseUp += this.treeProcesses_MouseUp;
treeProcesses.DoubleClick += this.treeProcesses_DoubleClick;
nodeName.ToolTipProvider = _tooltipProvider = new ProcessToolTipProvider(this);
// make it draw when we want it to draw :)
treeProcesses.BeginUpdate();
}
示例8: ReorderColumnState
public ReorderColumnState(TreeViewAdv tree, TreeColumn column, Point p)
: base(tree, column)
{
_location = _initLocation = new Point(p.X, 0);
_ghostImage = column.CreateGhostImage(new Rectangle(0, 0, column.Width, tree.ColumnHeaderHeight), tree.Font);
}
示例9: InitializeColumnHeaders
private void InitializeColumnHeaders()
{
//
// tcProcessIcon
//
_tcProcessIcon = new TreeColumn
{
Header = "Process",
SortOrder = SortOrder.None,
TooltipText = null,
Width = 250
};
//
// tcProcessPid
//
_tcProcessPid = new TreeColumn
{
Header = "Pid",
SortOrder = SortOrder.None,
TooltipText = null
};
}
示例10: ReconfigureTreeColumns
public void ReconfigureTreeColumns() {
if (!DataLayer.IsConnected) {
return;
}
tvWorkitems.HideEditor();
tvWorkitems.Columns.Clear();
tvWorkitems.NodeControls.Clear();
columnToAttributeMappings.Clear();
foreach (var column in configuration.GridSettings.Columns) {
if (column.EffortTracking && !DataLayer.EffortTracking.TrackEffort) {
continue;
}
var columnName = DataLayer.LocalizerResolve(column.Name);
var dataPropertyName = columnName.Replace(" ", string.Empty);
columnToAttributeMappings.Add(dataPropertyName, column.Attribute);
var treeColumn = new TreeColumn(columnName, column.Width) { SortOrder = SortOrder.None, TooltipText = dataPropertyName };
switch(column.Type) {
case "String":
case "Effort":
var textEditor = new CustomNodeTextBox();
ConfigureEditor(textEditor, dataPropertyName);
textEditor.EditEnabled = !textEditor.IsReadOnly;
textEditor.IsColumnReadOnly = column.ReadOnly;
textEditor.ParentColumn = treeColumn;
textEditor.IsEditEnabledValueNeeded += CheckCellEditability;
tvWorkitems.NodeControls.Add(textEditor);
textEditor.KeyTextBoxDown += tvWorkitems_PreviewKeyDown;
break;
case "List":
var listEditor = new NodeComboBox();
ConfigureEditor(listEditor, dataPropertyName);
listEditor.EditEnabled = !column.ReadOnly;
listEditor.ParentColumn = treeColumn;
listEditor.IsEditEnabledValueNeeded += CheckCellEditability;
tvWorkitems.NodeControls.Add(listEditor);
listEditor.KeyComboBoxDown += tvWorkitems_PreviewKeyDown;
break;
case "Multi":
var listBoxEditor = new NodeListBox {ParentTree = tvWorkitems};
ConfigureEditor(listBoxEditor, dataPropertyName);
listBoxEditor.EditEnabled = !column.ReadOnly;
listBoxEditor.ParentColumn = treeColumn;
listBoxEditor.IsEditEnabledValueNeeded += CheckCellEditability;
tvWorkitems.NodeControls.Add(listBoxEditor);
listBoxEditor.KeyListBoxDown += tvWorkitems_PreviewKeyDown;
break;
default:
throw new NotSupportedException();
}
tvWorkitems.Columns.Add(treeColumn);
}
AddStateIcon();
}
示例11: TreeColumnEventArgs
public TreeColumnEventArgs(TreeColumn column)
{
_column = column;
}
示例12: TreeColumnEventArgs
public TreeColumnEventArgs(TreeColumn column, MouseButtons button)
{
_column = column;
Button = button;
}
示例13: ColumnState
public ColumnState(TreeViewAdv tree, TreeColumn column)
: base(tree)
{
_column = column;
}
示例14: InvertSortOrderOf
private void InvertSortOrderOf(TreeColumn aColun)
{
aColun.SortOrder = aColun.SortOrder == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending;
}
示例15: OnColumnWidthChanged
internal void OnColumnWidthChanged(TreeColumn column)
{
if (ColumnWidthChanged != null)
ColumnWidthChanged(this, new TreeColumnEventArgs(column));
}