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.ColumnHeaderHeight), tree.Font); }
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; }
private void DrawColumnHeaders(Graphics gr) { PerformanceAnalyzer.Start("DrawColumnHeaders"); ReorderColumnState reorder = Input as ReorderColumnState; int x = 0; TreeColumn.DrawBackground(gr, new Rectangle(0, 0, ClientRectangle.Width + 2, ColumnHeaderHeight - 1), false, false); gr.TranslateTransform(-OffsetX, 0); foreach (TreeColumn c in Columns) { if (c.IsVisible) { if (x >= OffsetX && x - OffsetX < this.Bounds.Width) // skip invisible columns { Rectangle rect = new Rectangle(x, 0, c.Width, ColumnHeaderHeight - 1); gr.SetClip(rect); bool pressed = ((Input is ClickColumnState || reorder != null) && ((Input as ColumnState).Column == c)); c.Draw(gr, rect, Font, pressed, _hotColumn == c); gr.ResetClip(); if (reorder != null && reorder.DropColumn == c) { TreeColumn.DrawDropMark(gr, rect); } } x += c.Width; } } if (reorder != null) { if (reorder.DropColumn == null) { TreeColumn.DrawDropMark(gr, new Rectangle(x, 0, 0, ColumnHeaderHeight)); } gr.DrawImage(reorder.GhostImage, new Point(reorder.Location.X + +reorder.DragOffset, reorder.Location.Y)); } PerformanceAnalyzer.Finish("DrawColumnHeaders"); }
public ResizeColumnState(TreeViewAdv tree, TreeColumn column, Point p) : base(tree, column) { _initLocation = p; _initWidth = column.Width; }
public ColumnState(TreeViewAdv tree, TreeColumn column) : base(tree) { _column = column; }
internal void OnColumnWidthChanged(TreeColumn column) { if (ColumnWidthChanged != null) ColumnWidthChanged(this, new TreeColumnEventArgs(column)); }
internal void OnColumnReordered(TreeColumn column) { if (ColumnReordered != null) ColumnReordered(this, new TreeColumnEventArgs(column)); }
internal void ChangeColumnWidth(TreeColumn column) { if (!(_input is ResizeColumnState)) { FullUpdate(); OnColumnWidthChanged(column); } }
private void UpdateToolTip(MouseEventArgs e) { TreeColumn col = GetColumnAt(e.Location); if (col != null) { if (col != _tooltipColumn) SetTooltip(col.TooltipText); } else DisplayNodesTooltip(e); _tooltipColumn = col; }
internal int GetColumnX(TreeColumn column) { int x = -OffsetX; foreach (TreeColumn col in Columns) { if (col.IsVisible) { if (column == col) return x; else x += col.Width; } } return x; }
public ClickColumnState(TreeViewAdv tree, TreeColumn column, Point location) : base(tree, column) { _location = location; }
public TreeColumnEventArgs(TreeColumn column) { _column = column; }