External/Aga.Controls/Tree/Input/ClickColumnState.cs
changeset 345 0c551e8818e0
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/External/Aga.Controls/Tree/Input/ClickColumnState.cs	Sun May 27 15:16:19 2012 +0000
     1.3 @@ -0,0 +1,45 @@
     1.4 +using System;
     1.5 +using System.Collections.Generic;
     1.6 +using System.Text;
     1.7 +using System.Windows.Forms;
     1.8 +using System.Drawing;
     1.9 +
    1.10 +namespace Aga.Controls.Tree
    1.11 +{
    1.12 +	internal class ClickColumnState : ColumnState
    1.13 +	{
    1.14 +		private Point _location;
    1.15 +
    1.16 +		public ClickColumnState(TreeViewAdv tree, TreeColumn column, Point location)
    1.17 +			: base(tree, column)
    1.18 +		{
    1.19 +			_location = location;
    1.20 +		}
    1.21 +
    1.22 +		public override void KeyDown(KeyEventArgs args)
    1.23 +		{
    1.24 +		}
    1.25 +
    1.26 +		public override void MouseDown(TreeNodeAdvMouseEventArgs args)
    1.27 +		{
    1.28 +		}
    1.29 +
    1.30 +		public override bool MouseMove(MouseEventArgs args)
    1.31 +		{
    1.32 +			if (TreeViewAdv.Dist(_location, args.Location) > TreeViewAdv.ItemDragSensivity
    1.33 +				&& Tree.AllowColumnReorder)
    1.34 +			{
    1.35 +				Tree.Input = new ReorderColumnState(Tree, Column, args.Location);
    1.36 +				Tree.UpdateView();
    1.37 +			}
    1.38 +			return true;
    1.39 +		}
    1.40 +
    1.41 +		public override void MouseUp(TreeNodeAdvMouseEventArgs args)
    1.42 +		{
    1.43 +			Tree.ChangeInput();
    1.44 +			Tree.UpdateView();
    1.45 +			Tree.OnColumnClicked(Column);
    1.46 +		}
    1.47 +	}
    1.48 +}