mirror of
https://github.com/mirror/processhacker
synced 2026-06-08 16:03:24 +00:00
b02427417c
git-svn-id: svn://svn.code.sf.net/p/processhacker/code@5614 21ef857c-d57f-4fe0-8362-d861dc6d29cd
54 lines
1.1 KiB
C#
54 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
using System.Security.Permissions;
|
|
using System.Drawing;
|
|
|
|
namespace Aga.Controls.Tree
|
|
{
|
|
internal class ResizeColumnState: ColumnState
|
|
{
|
|
private Point _initLocation;
|
|
private int _initWidth;
|
|
|
|
public ResizeColumnState(TreeViewAdv tree, TreeColumn column, Point p)
|
|
: base(tree, column)
|
|
{
|
|
_initLocation = p;
|
|
_initWidth = column.Width;
|
|
}
|
|
|
|
public override void KeyDown(KeyEventArgs args)
|
|
{
|
|
args.Handled = true;
|
|
if (args.KeyCode == Keys.Escape)
|
|
FinishResize();
|
|
}
|
|
|
|
public override void MouseDown(TreeNodeAdvMouseEventArgs args)
|
|
{
|
|
}
|
|
|
|
public override void MouseUp(TreeNodeAdvMouseEventArgs args)
|
|
{
|
|
FinishResize();
|
|
}
|
|
|
|
private void FinishResize()
|
|
{
|
|
Tree.ChangeInput();
|
|
Tree.FullUpdate();
|
|
Tree.OnColumnWidthChanged(Column);
|
|
}
|
|
|
|
public override bool MouseMove(MouseEventArgs args)
|
|
{
|
|
Column.Width = _initWidth + args.Location.X - _initLocation.X;
|
|
Tree.UpdateView();
|
|
Tree.Invalidate();
|
|
return true;
|
|
}
|
|
}
|
|
}
|