Beispiel #1
0
        private bool CheckMouseDown(UITreeRow pTree, int x, int y, MouseEventArgs mevent)
        {
            if (pTree.RExpand.Contains(x, y))
            {
                SetExpanded(pTree, mevent.Button);
                return(true);
            }

            if (pTree.RText.Contains(x, y))
            {
                RvSelected?.Invoke(pTree, mevent);

                Selected = pTree;
                Refresh();
                return(true);
            }

            return(false);
        }
Beispiel #2
0
        private bool CheckMouseUp(RvFile pTree, int x, int y, MouseEventArgs mevent)
        {
            if (!Working && ((UiTree)pTree.Tree.UiObject).RChecked.Contains(x, y))
            {
                RvChecked?.Invoke(pTree, mevent);

                bool shiftPressed = (ModifierKeys & Keys.Shift) == Keys.Shift;

                if (mevent.Button == MouseButtons.Right)
                {
                    _mousehit = true;
                    if (pTree.FileStatusIs(FileStatus.PrimaryToSort) || pTree.FileStatusIs(FileStatus.CacheToSort))
                    {
                        return(true);
                    }

                    SetChecked(pTree, RvTreeRow.TreeSelect.Locked, Working, shiftPressed);
                    return(true);
                }

                _mousehit = true;
                SetChecked(pTree, pTree.Tree.Checked == RvTreeRow.TreeSelect.Selected ? RvTreeRow.TreeSelect.UnSelected : RvTreeRow.TreeSelect.Selected, Working, shiftPressed);
                return(true);
            }

            if (((UiTree)pTree.Tree.UiObject).RExpand.Contains(x, y))
            {
                _mousehit = true;
                SetExpanded(pTree, mevent.Button == MouseButtons.Right, Working);
                return(true);
            }

            if (((UiTree)pTree.Tree.UiObject).RText.Contains(x, y))
            {
                _mousehit = true;

                RvSelected?.Invoke(pTree, mevent);

                Selected = pTree;
                return(true);
            }

            if (!pTree.Tree.TreeExpanded)
            {
                return(false);
            }

            for (int i = 0; i < pTree.ChildCount; i++)
            {
                RvFile rDir = pTree.Child(i);
                if (!rDir.IsDir || rDir.Tree == null)
                {
                    continue;
                }

                if (CheckMouseUp(rDir, x, y, mevent))
                {
                    return(true);
                }
            }

            return(false);
        }