moel@345: using System;
moel@345: using System.Collections.Generic;
moel@345: using System.Text;
moel@345: using System.Windows.Forms;
moel@345: using System.Drawing;
moel@345: 
moel@345: namespace Aga.Controls.Tree
moel@345: {
moel@345: 	internal class ClickColumnState : ColumnState
moel@345: 	{
moel@345: 		private Point _location;
moel@345: 
moel@345: 		public ClickColumnState(TreeViewAdv tree, TreeColumn column, Point location)
moel@345: 			: base(tree, column)
moel@345: 		{
moel@345: 			_location = location;
moel@345: 		}
moel@345: 
moel@345: 		public override void KeyDown(KeyEventArgs args)
moel@345: 		{
moel@345: 		}
moel@345: 
moel@345: 		public override void MouseDown(TreeNodeAdvMouseEventArgs args)
moel@345: 		{
moel@345: 		}
moel@345: 
moel@345: 		public override bool MouseMove(MouseEventArgs args)
moel@345: 		{
moel@345: 			if (TreeViewAdv.Dist(_location, args.Location) > TreeViewAdv.ItemDragSensivity
moel@345: 				&& Tree.AllowColumnReorder)
moel@345: 			{
moel@345: 				Tree.Input = new ReorderColumnState(Tree, Column, args.Location);
moel@345: 				Tree.UpdateView();
moel@345: 			}
moel@345: 			return true;
moel@345: 		}
moel@345: 
moel@345: 		public override void MouseUp(TreeNodeAdvMouseEventArgs args)
moel@345: 		{
moel@345: 			Tree.ChangeInput();
moel@345: 			Tree.UpdateView();
moel@345: 			Tree.OnColumnClicked(Column);
moel@345: 		}
moel@345: 	}
moel@345: }