Example #1
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, ActualColumnHeaderHeight - 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, ActualColumnHeaderHeight - 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, ActualColumnHeaderHeight));
                }
                gr.DrawImage(reorder.GhostImage, new Point(reorder.Location.X +  +reorder.DragOffset, reorder.Location.Y));
            }
            PerformanceAnalyzer.Finish("DrawColumnHeaders");
        }
 public ColumnState(TreeViewAdv tree, TreeColumn column)
     : base(tree)
 {
     _column = column;
 }
Example #3
0
 public ClickColumnState(TreeViewAdv tree, TreeColumn column, Point location)
     : base(tree, column)
 {
     _location = location;
 }
 public ResizeColumnState(TreeViewAdv tree, TreeColumn column, Point p)
     : base(tree, column)
 {
     _initLocation = p;
     _initWidth    = column.Width;
 }
Example #5
0
 public TreeColumnEventArgs(TreeColumn column)
 {
     _column = column;
 }