Inheritance: System.ComponentModel.Component
Beispiel #1
0
 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);
 }
Beispiel #2
0
 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;
 }
Beispiel #3
0
        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");
        }
Beispiel #4
0
 public ResizeColumnState(TreeViewAdv tree, TreeColumn column, Point p)
     : base(tree, column)
 {
     _initLocation = p;
     _initWidth    = column.Width;
 }
Beispiel #5
0
 public ColumnState(TreeViewAdv tree, TreeColumn column)
     : base(tree)
 {
     _column = column;
 }
Beispiel #6
0
 internal void OnColumnWidthChanged(TreeColumn column)
 {
     if (ColumnWidthChanged != null)
         ColumnWidthChanged(this, new TreeColumnEventArgs(column));
 }
Beispiel #7
0
 internal void OnColumnReordered(TreeColumn column)
 {
     if (ColumnReordered != null)
         ColumnReordered(this, new TreeColumnEventArgs(column));
 }
Beispiel #8
0
 internal void ChangeColumnWidth(TreeColumn column)
 {
     if (!(_input is ResizeColumnState))
     {
         FullUpdate();
         OnColumnWidthChanged(column);
     }
 }
Beispiel #9
0
 private void UpdateToolTip(MouseEventArgs e)
 {
     TreeColumn col = GetColumnAt(e.Location);
     if (col != null)
     {
         if (col != _tooltipColumn)
             SetTooltip(col.TooltipText);
     }
     else
         DisplayNodesTooltip(e);
     _tooltipColumn = col;
 }
Beispiel #10
0
 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;
 }
Beispiel #11
0
 public ClickColumnState(TreeViewAdv tree, TreeColumn column, Point location)
     : base(tree, column)
 {
     _location = location;
 }
Beispiel #12
0
 public TreeColumnEventArgs(TreeColumn column)
 {
     _column = column;
 }
Beispiel #13
0
 public ResizeColumnState(TreeViewAdv tree, TreeColumn column, Point p)
     : base(tree, column)
 {
     _initLocation = p;
     _initWidth = column.Width;
 }
Beispiel #14
0
 public ClickColumnState(TreeViewAdv tree, TreeColumn column, Point location)
     : base(tree, column)
 {
     _location = location;
 }
Beispiel #15
0
 public ColumnState(TreeViewAdv tree, TreeColumn column)
     : base(tree)
 {
     _column = column;
 }
Beispiel #16
0
 public TreeColumnEventArgs(TreeColumn column)
 {
     _column = column;
 }