first commit

This commit is contained in:
2025-04-07 07:44:27 -07:00
commit d6cde0c05e
512 changed files with 142392 additions and 0 deletions

View File

@@ -0,0 +1,69 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace Aga.Controls.Tree
{
internal class InputWithShift: NormalInputState
{
public InputWithShift(TreeViewAdv tree): base(tree)
{
}
protected override void FocusRow(TreeNodeAdv node)
{
Tree.SuspendSelectionEvent = true;
try
{
if (Tree.SelectionMode == TreeSelectionMode.Single || Tree.SelectionStart == null)
base.FocusRow(node);
else if (CanSelect(node))
{
SelectAllFromStart(node);
Tree.CurrentNode = node;
Tree.ScrollTo(node);
}
}
finally
{
Tree.SuspendSelectionEvent = false;
}
}
protected override void DoMouseOperation(TreeNodeAdvMouseEventArgs args)
{
if (Tree.SelectionMode == TreeSelectionMode.Single || Tree.SelectionStart == null)
{
base.DoMouseOperation(args);
}
else if (CanSelect(args.Node))
{
Tree.SuspendSelectionEvent = true;
try
{
SelectAllFromStart(args.Node);
}
finally
{
Tree.SuspendSelectionEvent = false;
}
}
}
protected override void MouseDownAtEmptySpace(TreeNodeAdvMouseEventArgs args)
{
}
private void SelectAllFromStart(TreeNodeAdv node)
{
Tree.ClearSelectionInternal();
int a = node.Row;
int b = Tree.SelectionStart.Row;
for (int i = Math.Min(a, b); i <= Math.Max(a, b); i++)
{
if (Tree.SelectionMode == TreeSelectionMode.Multi || Tree.RowMap[i].Parent == node.Parent)
Tree.RowMap[i].IsSelected = true;
}
}
}
}