Esempio n. 1
0
 internal void InsertSelected(wTreeNode node)
 {
     if (_selectedNodes.Contains(node) == false)
     {
         _selectedNodes.Add(node);
     }
 }
Esempio n. 2
0
 void TreeNodeChanged(wTreeNode node, wTreeNodeChangedEventArgs e)
 {
     if (E_TreeNodeChanged != null)
     {
         E_TreeNodeChanged(node, e);
     }
 }
Esempio n. 3
0
        public void RedrawNode(wTreeNode node)
        {
            node.DrawBuffer();
            Graphics g = Graphics.FromImage(ImageTempBufferToDrawForTree);

            node.DrawNode(g, node.Area.X, node.Area.Y);
        }
Esempio n. 4
0
 internal wTreeNodeDrawingArgs(wTreeNode nodeToDraw, Point startPoint)
 {
     _nodeToDraw = nodeToDraw;
     StartPoint  = startPoint;
     DrawnSize   = Size.Empty;
     _userDrawn  = false;
 }
Esempio n. 5
0
 internal wTreeNodeItem(wTreeNode ownerNode, WhiteSpaceTypes type)
 {
     _type           = wTreeNodeItemTypes.WhiteSpace;
     _whiteSpaceType = type;
     _ownerNode      = ownerNode;
     Init();
 }
Esempio n. 6
0
 /// <summary>
 /// 체크박스의 값을 toggle한다.
 /// </summary>
 /// <param name="node"></param>
 /// <param name="itemIndex"></param>
 internal void SetCheckboxIfItemIsCheckbox(wTreeNode node, int itemIndex)
 {
     if (node.Items[itemIndex] != null && node.Items[itemIndex].ItemType == wTreeNodeItemTypes.CheckBox)
     {
         wTreeNodeItem item  = node.Items[itemIndex];
         bool?         value = (bool?)item.Value;
         if (value == true)
         {
             item.Value = false;
         }
         else if (value == false)
         {
             item.Value = true;
         }
         else
         {
             item.Value = true; //중간상태일 때는 true로 바꿈.
         }
         bool newValue = (bool)item.Value;
         node.ControlChildChecks(itemIndex, newValue);
         node.ControlParentChecks(itemIndex);
         node.DrawBuffer();
         _ownerTree.wDrawHandler.ReDrawTree(false);
         if (E_CheckItemChanged != null)
         {
             E_CheckItemChanged(node, item, newValue);
         }
     }
 }
Esempio n. 7
0
 void TreeListChanged(wTreeNode node)
 {
     if (E_TreeListChanged != null)
     {
         E_TreeListChanged(node);
     }
 }
Esempio n. 8
0
 void TreeNodeChanged(wTreeNode node, int index)
 {
     if (E_TreeNodeChanged != null)
     {
         E_TreeNodeChanged(node, index);
     }
 }
Esempio n. 9
0
 internal void RemoveSelected(wTreeNode node)
 {
     if (_selectedNodes.Contains(node))
     {
         _selectedNodes.Remove(node);
     }
 }
Esempio n. 10
0
 void editor_E_EditorValueChangeCanceled(wTreeNode node, wTreeNodeItem item)
 {
     if (E_TreeNodeItemValueChangeCanceled != null)
     {
         E_TreeNodeItemValueChangeCanceled(node, item);
     }
 }
Esempio n. 11
0
 /// <summary>
 /// 체크박스.
 /// </summary>
 /// <param name="ownerNode">부모노드</param>
 /// <param name="check"></param>
 /// <param name="checkboxActiveAction"></param>
 internal wTreeNodeItem(wTreeNode ownerNode, bool?check, CheckboxActiveActions checkboxActiveAction)
 {
     _type                 = wTreeNodeItemTypes.CheckBox;
     _isChecked            = check;
     _ownerNode            = ownerNode;
     _checkBoxActiveAction = checkboxActiveAction;
     Init();
 }
Esempio n. 12
0
 internal wTreeNodeDrawingArgs(wTreeNode nodeToDraw, int x, int y)
 {
     _nodeToDraw = nodeToDraw;
     StartPoint  = new Point(x, y);
     DrawnSize   = Size.Empty;
     _userDrawn  = false;
     DrawnBuffer = nodeToDraw.ImageBufferToDraw;
 }
Esempio n. 13
0
 internal wTreeNodeItem(wTreeNode ownerNode, Control control)
 {
     _type               = wTreeNodeItemTypes.Control;
     _control            = control;
     _control.MouseDown += _control_MouseDown;
     _ownerNode          = ownerNode;
     Init();
 }
Esempio n. 14
0
        internal wTreeNodeItem(wTreeNode ownerNode, String text)
        {
            _type = wTreeNodeItemTypes.Text;
            _text = text;

            _ownerNode = ownerNode;
            Init();
        }
Esempio n. 15
0
 /// <summary>
 /// 부모노드가 wTreeNode라면 부모노드가 자식들의 check상태를 검사하여 자기자신을 바꾸도록 한다.
 /// </summary>
 /// <param name="itemIndex">체크박스가 존재하는 itemIndex</param>
 internal void ControlParentChecks(int itemIndex)
 {
     if (this.TreeParent is wTreeNode)
     {
         wTreeNode parent = this.TreeParent as wTreeNode;
         parent.SetCheckStateFromChildren(itemIndex);
         parent.ControlParentChecks(itemIndex);
     }
 }
Esempio n. 16
0
        internal wTreeNodeItem(wTreeNode ownerNode, Image image, int wid = -1, int height = -1)
        {
            _type        = wTreeNodeItemTypes.Image;
            _image       = image;
            _imageWidth  = wid;
            _imageHeight = height;
            _ownerNode   = ownerNode;

            Init();
        }
Esempio n. 17
0
 internal wTreeNodeDrawingArgs(wTreeNode nodeToDraw, Point startPoint)
 {
     _items = new List <wTreeNodeItem>();
     foreach (wTreeNodeItem item in nodeToDraw.Items)
     {
         _items.Add(item);
     }
     _nodeToDraw = nodeToDraw;
     StartPoint  = startPoint;
     DrawnSize   = Size.Empty;
     UserDrawn   = false;
 }
Esempio n. 18
0
 internal wTreeNodeItem(wTreeNode ownerNode, ICollection <String> texts, int initIndex = 0)
 {
     _type  = wTreeNodeItemTypes.TextArray;
     _texts = new List <String>();
     foreach (string str in texts)
     {
         _texts.Add(str);
     }
     _selectedIndex = initIndex;
     _ownerNode     = ownerNode;
     Init();
 }
Esempio n. 19
0
        /// <summary>
        /// 체크박스의 값을 toggle한다.
        /// </summary>
        /// <param name="parentNode"></param>
        /// <param name="itemIndex"></param>
        internal void SetCheckboxIfItemIsCheckbox(IwTreeNodeCollectionParent parentNode, int childStart, int childEnd, int itemIndex)
        {
            int min = childStart < childEnd ? childStart : childEnd;
            int max = childStart < childEnd ? childEnd : childStart;
            Dictionary <wTreeNodeItem, bool> itemValues = new Dictionary <wTreeNodeItem, bool>();

            for (int i = min; i <= max; i++)
            {
                if (i == childStart)
                {
                    continue;
                }
                wTreeNode child = parentNode.Children[i];

                if (child.Items[itemIndex] != null && child.Items[itemIndex].ItemType == wTreeNodeItemTypes.CheckBox)
                {
                    wTreeNodeItem item  = child.Items[itemIndex];
                    bool?         value = (bool?)item.Value;
                    if (value == true)
                    {
                        item.Value = false;
                    }
                    else if (value == false)
                    {
                        item.Value = true;
                    }
                    else
                    {
                        item.Value = true; //중간상태일 때는 true로 바꿈.
                    }
                    bool newValue = (bool)item.Value;
                    child.ControlChildChecks(itemIndex, newValue);
                    child.DrawBuffer();
                    itemValues.Add(item, newValue);//toggle이니까 무조건 바뀐다.
                }
            }
            parentNode.Children[0].ControlParentChecks(itemIndex);
            _ownerTree.wDrawHandler.ReDrawTree(false);
            if (itemValues.Count > 0)
            {
                if (E_CheckItemChanged != null)
                {
                    E_CheckItemsChanged(parentNode as wTreeNode, itemValues);
                }
            }
        }
Esempio n. 20
0
 /// <summary>
 /// 특정 값으로 체크박스를 셋팅한다.
 /// </summary>
 /// <param name="node"></param>
 /// <param name="itemIndex"></param>
 /// <param name="checkBoxValue"></param>
 internal void SetCheckboxValueIfItemIsCheckbox(wTreeNode node, int itemIndex, bool checkBoxValue)
 {
     if (node.Items[itemIndex] != null && node.Items[itemIndex].ItemType == wTreeNodeItemTypes.CheckBox)
     {
         wTreeNodeItem item = node.Items[itemIndex];
         item.Value = checkBoxValue;
         bool newValue = (bool)item.Value;
         node.ControlChildChecks(itemIndex, newValue);
         node.ControlParentChecks(itemIndex);
         node.DrawBuffer();
         _ownerTree.wDrawHandler.ReDrawTree(false);
         if (E_CheckItemChanged != null)
         {
             E_CheckItemChanged(node, item, newValue);
         }
     }
 }
Esempio n. 21
0
        /// <summary>
        /// MultiSelection모드에서 Selected된 모든 Nodes의 선택표시를 없앰..
        /// </summary>
        internal void ClearAllSelections()
        {
            List <wTreeNode> temp = new List <wTreeNode>(SelectedNodes);

            _beforeSelectedNodes = temp;
            _selectedNodes.Clear();
            foreach (wTreeNode node in temp)
            {
                node.DrawBuffer();
            }
            if (SelectedNode != null)
            {
                _beforeSelectedNodes.Add(SelectedNode);
                _beforeSelectedNode = SelectedNode;
            }
            SelectedNode = null;
        }
        /// <summary>
        /// 콘트롤 상에서의 point(e)를 넣으면 해당 포인트에 존재하는 노드를 리턴하고,
        /// Margin을 제외한 실제 컨트롤에서의 point를 리턴한다.
        /// </summary>
        /// <param name="e"></param>
        /// <param name="pt"></param>
        /// <returns></returns>
        public wTreeNode GetNodeFromPoint(Point e, out Point pt)
        {
            int index = 0;

            pt = new Point(e.X - Margin.Left, e.Y - Margin.Top);
            wTreeNode selectedNode = null;

            foreach (wTreeNode node in VisibleNodes)
            {
                if (node.ContainsPoint(pt, ContainsModes.Y))
                //if (node.Location.Y < pt.Y && node.Location.Y + node.ImageBufferToDraw.Height >= pt.Y)
                {
                    selectedNode = node;
                    break;
                }
                index++;
            }
            return(selectedNode);
        }
Esempio n. 23
0
        /// <summary>
        /// node를 선택하고, item을 선택하면 해당 Action을 한다. 이 함수의 결과로 SelectedItem이 바뀐다.
        /// </summary>
        /// <param name="selectedNode"></param>
        /// <param name="pt"></param>
        internal void SetNodeSelected(wTreeNode selectedNode, wTreeNodeItem item)
        {
            wTreeNodeItemSelectingArgs args = new wTreeNodeItemSelectingArgs();

            if (E_TreeNodeSelecting != null)
            {
                E_TreeNodeSelecting(SelectedNode, item, args);
            }
            if (args.IsCancel)
            {
                return;
            }
            //_pressedNode = selectedNode;
            if (selectedNode != null)
            {
                //selectedNode.IsExpaned = !selectedNode.IsExpaned;

                if (item != null)
                {
                    //_pressedItem = item;
                    //MessageBox.Show(item.ItemType.ToString());

                    if (item.ItemType == wTreeNodeItemTypes.PlusMinus)
                    {
                        selectedNode.IsExpanded = !selectedNode.IsExpanded;
                        selectedNode.ReDrawNode();
                        //_ownerTree.DrawHandler.ReDrawTree(true);
                    }
                }
                _selectedItem = item;

                if (E_TreeNodeSelected != null)
                {
                    E_TreeNodeSelected(SelectedNode, item);
                }
            }


            //this.Focus();
        }
Esempio n. 24
0
        /// <summary>
        /// 특정 값으로 체크박스를 셋팅한다.
        /// </summary>
        /// <param name="node"></param>
        /// <param name="itemIndex"></param>
        /// <param name="checkBoxValue"></param>
        internal void SetCheckboxValueIfItemIsCheckbox(IwTreeNodeCollectionParent parentNode, int childStart, int childEnd, int itemIndex, bool checkBoxValue)
        {
            int min = childStart < childEnd ? childStart : childEnd;
            int max = childStart < childEnd ? childEnd : childStart;
            Dictionary <wTreeNodeItem, bool> itemValues = new Dictionary <wTreeNodeItem, bool>();

            for (int i = min; i <= max; i++)
            {
                wTreeNode child = parentNode.Children[i];


                if (child.Items[itemIndex] != null && child.Items[itemIndex].ItemType == wTreeNodeItemTypes.CheckBox)
                {
                    wTreeNodeItem item     = child.Items[itemIndex];
                    bool?         oldValue = (bool?)item.Value;
                    if (checkBoxValue != oldValue)
                    {
                        item.Value = checkBoxValue;
                        bool newValue = (bool)item.Value;
                        child.ControlChildChecks(itemIndex, newValue);
                        child.DrawBuffer();
                        if (oldValue != newValue)
                        {
                            itemValues.Add(item, newValue);                      //값이 바뀔 때만 추가한다.
                        }
                    }
                }
            }
            parentNode.Children[0].ControlParentChecks(itemIndex);
            _ownerTree.wDrawHandler.ReDrawTree(false);
            if (itemValues.Count > 0)
            {
                if (E_CheckItemChanged != null)
                {
                    E_CheckItemsChanged(parentNode as wTreeNode, itemValues);
                }
            }
        }
Esempio n. 25
0
 internal void OnNodeItemValueChanged(wTreeNode node, wTreeNodeItem item, object oldValue, object newValue)
 {
     E_TreeNodeItemValueChanged(node, item, oldValue, newValue);
 }
Esempio n. 26
0
 internal void OnNodeItemValueChangeCanceled(wTreeNode node, wTreeNodeItem item)
 {
     E_TreeNodeItemValueChangeCanceled(node, item);
 }
        void wTree_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            Point pt;
            //= new Point(e.X - Margin.Left, e.Y - Margin.Top);
            wTreeNode              clickedNode = GetNodeFromPoint(e.Location, out pt);// _pressedNode;
            wTreeNodeItem          item        = clickedNode.GetItemFromPoint(pt);
            wTreeNodeItemMouseArgs args        = new wTreeNodeItemMouseArgs(e);

            if (E_TreeNodeDoubleClicked != null)
            {
                E_TreeNodeDoubleClicked(clickedNode, item, args);
            }

            if (args.IsCanceled)
            {
                return;
            }

            if (_lastMouseUpNode != null)
            {
                //selectedNode.IsExpaned = !selectedNode.IsExpaned;

                if (item != null)
                {
                    if (e.Button == System.Windows.Forms.MouseButtons.Left)
                    {
                        if (Control.ModifierKeys == Keys.None)
                        {
                            if (item.ItemType == wTreeNodeItemTypes.CheckBox && (item.CheckBoxActiveAction & CheckboxActiveActions.DoubleClick) == CheckboxActiveActions.DoubleClick)
                            {
                                SelectionHandler.SetCheckboxIfItemIsCheckbox(_lastMouseUpNode, item.ItemIndex);
                            }
                            else
                            {
                                if (item.EditorActivateAction == EditorActivateActions.DoubleClick)
                                {
                                    EditorHandler.ShowEditor(item, item.ItemArea);
                                }
                                else if (item.EditorActivateAction == EditorActivateActions.UseBasicSetting)
                                {
                                    if (EditorHandler.EditorActivateAction == EditorActivateBasicActions.DoubleClick)
                                    {
                                        EditorHandler.ShowEditor(item, item.ItemArea);
                                    }
                                }
                            }
                        }
                        else if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
                        {
                            if (item.EditorActivateAction == EditorActivateActions.CtrlDoubleClick)
                            {
                                EditorHandler.ShowEditor(item, item.ItemArea);
                            }
                            else if (item.EditorActivateAction == EditorActivateActions.UseBasicSetting)
                            {
                                if (EditorHandler.EditorActivateAction == EditorActivateBasicActions.CtrlDoubleClick)
                                {
                                    EditorHandler.ShowEditor(item, item.ItemArea);
                                }
                            }
                        }
                        else if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
                        {
                            if (item.EditorActivateAction == EditorActivateActions.ShiftDoubleClick)
                            {
                                EditorHandler.ShowEditor(item, item.ItemArea);
                            }
                            else if (item.EditorActivateAction == EditorActivateActions.UseBasicSetting)
                            {
                                if (EditorHandler.EditorActivateAction == EditorActivateBasicActions.ShiftDoubleClick)
                                {
                                    EditorHandler.ShowEditor(item, item.ItemArea);
                                }
                            }
                        }
                        else if ((Control.ModifierKeys & Keys.Alt) == Keys.Alt)
                        {
                            if (item.EditorActivateAction == EditorActivateActions.AltDoubleClick)
                            {
                                EditorHandler.ShowEditor(item, item.ItemArea);
                            }
                            else if (item.EditorActivateAction == EditorActivateActions.UseBasicSetting)
                            {
                                if (EditorHandler.EditorActivateAction == EditorActivateBasicActions.AltDoubleClick)
                                {
                                    EditorHandler.ShowEditor(item, item.ItemArea);
                                }
                            }
                        }
                    }
                }



                _doubleClicked = true;
            }
        }
        void _ownerTree_MouseClick(object sender, MouseEventArgs e)
        {
            if (e.Clicks != 1)
            {
                return;
            }

            Point pt;

            //= new Point(e.X - Margin.Left, e.Y - Margin.Top);
            wTreeNode              clickedNode = GetNodeFromPoint(e.Location, out pt);// _pressedNode;
            wTreeNodeItem          item        = (clickedNode == null)? null : clickedNode.GetItemFromPoint(pt);
            wTreeNodeItemMouseArgs args        = new wTreeNodeItemMouseArgs(new MouseEventArgs(e.Button, e.Clicks, pt.X, pt.Y, e.Delta));

            if (E_TreeNodeClicked != null)
            {
                E_TreeNodeClicked(clickedNode, item, args);
            }
            if (args.IsCanceled)
            {
                return;
            }

            if (clickedNode != null)
            {
                //selectedNode.IsExpaned = !selectedNode.IsExpaned;

                if (item != null)
                {
                    #region item is not null
                    if (e.Button == System.Windows.Forms.MouseButtons.Left)
                    {
                        if (Control.ModifierKeys == Keys.None)
                        {
                            if (item.ItemType == wTreeNodeItemTypes.CheckBox && (item.CheckBoxActiveAction & CheckboxActiveActions.Click) == CheckboxActiveActions.Click)
                            {
                                SelectionHandler.SetCheckboxIfItemIsCheckbox(clickedNode, item.ItemIndex);
                            }
                            else
                            {
                                if (clickedNode.IsSelected)
                                {
                                    if ((item.EditorActivateAction & EditorActivateActions.ClickOnSelection) == EditorActivateActions.ClickOnSelection)
                                    {
                                        EditorHandler.ShowEditor(item, item.ItemArea);
                                    }
                                    else if ((item.EditorActivateAction & EditorActivateActions.Click) == EditorActivateActions.Click)
                                    {
                                        EditorHandler.ShowEditor(item, item.ItemArea);
                                    }
                                    else if (item.EditorActivateAction == EditorActivateActions.UseBasicSetting)
                                    {
                                        if ((EditorHandler.EditorActivateAction & EditorActivateBasicActions.ClickOnSelection) == EditorActivateBasicActions.ClickOnSelection)
                                        {
                                            EditorHandler.ShowEditor(item, item.ItemArea);
                                        }
                                        else if ((EditorHandler.EditorActivateAction & EditorActivateBasicActions.Click) == EditorActivateBasicActions.Click)
                                        {
                                            EditorHandler.ShowEditor(item, item.ItemArea);
                                        }
                                    }
                                }
                                else
                                {
                                    if ((item.EditorActivateAction & EditorActivateActions.Click) == EditorActivateActions.Click)
                                    {
                                        EditorHandler.ShowEditor(item, item.ItemArea);
                                    }
                                }
                                _isShiftDown = false;

                                SelectionHandler.SelectedNode = clickedNode;
                                SelectionHandler.SetNodeSelected(clickedNode, item);
                            }
                        }
                        else if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
                        {
                            if (item.ItemType == wTreeNodeItemTypes.CheckBox && (item.CheckBoxActiveAction & CheckboxActiveActions.Click) == CheckboxActiveActions.Click)
                            {
                                if (clickedNode != null && clickedNode.TreeParent == clickedNode.TreeParent)
                                {
                                    int itemIndex = item.ItemIndex;
                                    int lastIndex = clickedNode.Index;


                                    SelectionHandler.SetCheckboxValueIfItemIsCheckbox(clickedNode.TreeParent, lastIndex, clickedNode.Index, itemIndex, true);
                                }
                                else
                                {
                                    if ((item.CheckBoxActiveAction & CheckboxActiveActions.Click) == CheckboxActiveActions.Click)
                                    {
                                        SelectionHandler.SetCheckboxValueIfItemIsCheckbox(clickedNode, item.ItemIndex, true);
                                    }
                                }
                            }
                            else
                            {
                                if (clickedNode.IsSelected)
                                {
                                    clickedNode.SetSelection(false);
                                    SelectedNode = null;
                                    clickedNode.DrawBuffer();
                                }
                                else
                                {
                                    clickedNode.SetSelection(true);
                                    SelectedNode = null;
                                    clickedNode.DrawBuffer();
                                }

                                if ((item.EditorActivateAction & EditorActivateActions.CtrlClick) == EditorActivateActions.CtrlClick)
                                {
                                    EditorHandler.ShowEditor(item, item.ItemArea);
                                }
                                else if (item.EditorActivateAction == EditorActivateActions.UseBasicSetting)
                                {
                                    if ((EditorHandler.EditorActivateAction & EditorActivateBasicActions.CtrlClick) == EditorActivateBasicActions.CtrlClick)
                                    {
                                        EditorHandler.ShowEditor(item, item.ItemArea);
                                    }
                                }
                            }
                        }
                        else if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
                        {
                            _isShiftDown = true;

                            if (item.ItemType == wTreeNodeItemTypes.CheckBox && (item.CheckBoxActiveAction & CheckboxActiveActions.Click) == CheckboxActiveActions.Click)
                            {
                                if (clickedNode != null && clickedNode.TreeParent == clickedNode.TreeParent)
                                {
                                    int itemIndex = item.ItemIndex;
                                    int lastIndex = (_oldClickedNode == null)? clickedNode.Index : _oldClickedNode.Index;

                                    SelectionHandler.SetCheckboxIfItemIsCheckbox(clickedNode.TreeParent, lastIndex, clickedNode.Index, itemIndex);
                                }
                                else
                                {
                                    if ((item.CheckBoxActiveAction & CheckboxActiveActions.Click) == CheckboxActiveActions.Click)
                                    {
                                        SelectionHandler.SetCheckboxIfItemIsCheckbox(clickedNode, item.ItemIndex);
                                    }
                                }
                            }
                            else
                            {
                                if ((item.EditorActivateAction & EditorActivateActions.ShiftClick) == EditorActivateActions.ShiftClick)
                                {
                                    EditorHandler.ShowEditor(item, item.ItemArea);
                                }
                                else if (item.EditorActivateAction == EditorActivateActions.UseBasicSetting)
                                {
                                    if ((EditorHandler.EditorActivateAction & EditorActivateBasicActions.ShiftClick) == EditorActivateBasicActions.ShiftClick)
                                    {
                                        EditorHandler.ShowEditor(item, item.ItemArea);
                                    }
                                }
                            }
                        }
                        else if ((Control.ModifierKeys & Keys.Alt) == Keys.Alt)
                        {
                            if (item.ItemType == wTreeNodeItemTypes.CheckBox && (item.CheckBoxActiveAction & CheckboxActiveActions.Click) == CheckboxActiveActions.Click)
                            {
                                if (clickedNode != null && clickedNode.TreeParent == clickedNode.TreeParent)
                                {
                                    int itemIndex = item.ItemIndex;
                                    int lastIndex = clickedNode.Index;
                                    SelectionHandler.SetCheckboxIfItemIsCheckbox(clickedNode.TreeParent, lastIndex, clickedNode.Index, itemIndex);
                                }
                                else
                                {
                                    if ((item.CheckBoxActiveAction & CheckboxActiveActions.Click) == CheckboxActiveActions.Click)
                                    {
                                        SelectionHandler.SetCheckboxValueIfItemIsCheckbox(clickedNode, item.ItemIndex, false);
                                    }
                                }
                            }
                            else
                            {
                                if ((item.EditorActivateAction & EditorActivateActions.AltClick) == EditorActivateActions.AltClick)
                                {
                                    EditorHandler.ShowEditor(item, item.ItemArea);
                                }
                                else if (item.EditorActivateAction == EditorActivateActions.UseBasicSetting)
                                {
                                    if ((EditorHandler.EditorActivateAction & EditorActivateBasicActions.AltClick) == EditorActivateBasicActions.AltClick)
                                    {
                                        EditorHandler.ShowEditor(item, item.ItemArea);
                                    }
                                }
                            }
                        }
                    }
                    #endregion
                }
                else // item is null
                {
                    if (e.Button == System.Windows.Forms.MouseButtons.Left)
                    {
                        if (Control.ModifierKeys == Keys.None)
                        {
                            _isShiftDown = false;

                            SelectionHandler.SelectedNode = clickedNode;
                            SelectionHandler.SetNodeSelected(clickedNode, item);
                        }
                        else if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
                        {
                            if (clickedNode.IsSelected)
                            {
                                clickedNode.SetSelection(false);
                                SelectedNode = null;
                                clickedNode.DrawBuffer();
                            }
                            else
                            {
                                clickedNode.SetSelection(true);
                                SelectedNode = null;
                                clickedNode.DrawBuffer();
                            }
                        }
                        else if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
                        {
                            _isShiftDown = true;
                        }
                        else if ((Control.ModifierKeys & Keys.Alt) == Keys.Alt)
                        {
                        }
                    }
                }


                _oldClickedNode = clickedNode;
            }
        }
        /// <summary>
        /// 마우스 키를 눌렀을 때
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void wTree_MouseDown(object sender, MouseEventArgs e)
        {
            Point     pt;
            wTreeNode selectedNode = GetNodeFromPoint(e.Location, out pt);
            //int index = 0;
            wTreeNodeItemMouseArgs args = new wTreeNodeItemMouseArgs(new MouseEventArgs(e.Button, e.Clicks, pt.X, pt.Y, e.Delta));
            wTreeNodeItem          item = (selectedNode == null) ? null : selectedNode.GetItemFromPoint(pt);

            if (E_TreeNodeMouseDown != null)
            {
                E_TreeNodeMouseDown(selectedNode, item, args);
            }
            if (args.IsCanceled)
            {
                return;
            }

            _pressedNode = selectedNode;
            _pressedItem = item;
            if (_pressedItem != null && _pressedItem.ItemType == wTreeNodeItemTypes.CheckBox)
            {
            }
            else
            {
                if ((ModifierKeys & Keys.Control) != Keys.Control)//Control을 안눌렀다면 이전의 선택부분을 모두 지움..
                {
                    if ((ModifierKeys & Keys.Shift) == Keys.Shift)
                    {
                        if (_isShiftDown)//이전에 shift를 누른 채 떼지 않았다면..
                        {
                            //_pressedNode = _lastMouseUp;//이전에 클릭했던 지점부터 시작..

                            //SelectedNode = _lastMouseUp;
                            int tempSelecting = VisibleNodes.IndexOf(selectedNode);
                            SelectionHandler.drawSelectingNodes(VisibleNodes.IndexOf(_lastMouseUpNode), tempSelecting);
                            _isShiftDown = true;
                        }
                        else
                        {
                            SelectionHandler.ClearAllSelections();

                            //_pressedNode = _lastMouseUp;//이전에 클릭했던 지점부터 시작..

                            //SelectedNode = _lastMouseUp;
                            int tempSelectingStart = VisibleNodes.IndexOf(_lastMouseUpNode);
                            int tempSelecting      = VisibleNodes.IndexOf(selectedNode);
                            SelectionHandler.drawSelectingNodes(tempSelectingStart, tempSelecting);
                            _isShiftDown = true;
                        }
                        DrawHandler.ReDrawTree(false);
                    }
                    else
                    {
                        SelectionHandler.ClearAllSelections();

                        //SetNodeSelected(selectedNode, pt);
                        DrawHandler.ReDrawTree(false);
                    }

                    //this.Focus();
                }
            }
            if (EditorHandler.ActivatedEditor != null || _ownerTree.Focused == false)
            {
                ReleaseFocus();
            }
        }
        /// <summary>
        /// 마우스키를 뗐을 때..
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void wTree_MouseUp(object sender, MouseEventArgs e)
        {
            if (_doubleClicked)
            {
                _doubleClicked = false;
                return;
            }


            Point pt;
            //= new Point(e.X - Margin.Left, e.Y - Margin.Top);
            wTreeNode mouseUpNode = GetNodeFromPoint(e.Location, out pt);// _pressedNode;

            //Point pt;
            //wTreeNode clickedNode = GetNodeFromPoint(e.Location, out pt);// _pressedNode;
            //wTreeNodeItem item = clickedNode.GetItemFromPoint(pt);
            //wTreeNodeItemMouseArgs args = new wTreeNodeItemMouseArgs(e);
            //if (E_TreeNodeDoubleClicked != null) E_TreeNodeDoubleClicked(clickedNode, item, args);

            wTreeNodeItem item = (mouseUpNode == null)? null : mouseUpNode.GetItemFromPoint(pt);

            wTreeNodeItemMouseArgs args = new wTreeNodeItemMouseArgs(new MouseEventArgs(e.Button, e.Clicks, pt.X, pt.Y, e.Delta));


            if (E_TreeNodeMouseUp != null)
            {
                E_TreeNodeMouseUp(mouseUpNode, mouseUpNode.GetItemFromPoint(pt), args);
            }
            if (args.IsCanceled)
            {
                return;
            }

            SelectionHandler.FixSelections();

            if (_pressedNode != null && mouseUpNode != null)
            {
                bool isDragging;
                if (_pressedNode != mouseUpNode)
                {
                    isDragging = true;
                }
                else
                {
                    isDragging = false;
                }
                if (EditorHandler.ActivatedEditor != null && EditorHandler.ActivatedEditor.ItemToEdit != item)
                {
                    EditorHandler.HideEditor();
                }

                if (e.Button == System.Windows.Forms.MouseButtons.Left)
                {
                    if ((ModifierKeys & Keys.Control) == Keys.Control)
                    {
                        if (isDragging)//selection
                        {
                        }
                        else //제자리 클릭..
                        {
                        }
                    }
                    else if ((ModifierKeys & Keys.Shift) == Keys.Shift)
                    {
                    }
                    else
                    {
                    }
                }
                if (item != null && isDragging == false)                    //item clicked or right clicked
                {
                    if (e.Button == System.Windows.Forms.MouseButtons.Left) //item clicked
                    {
                        if (Control.ModifierKeys == Keys.None)
                        {//click
                        }
                        else if ((Control.ModifierKeys & Keys.Control) == Keys.Control)
                        {
                        }
                        else if ((Control.ModifierKeys & Keys.Shift) == Keys.Shift)
                        {
                        }
                        else if ((Control.ModifierKeys & Keys.Alt) == Keys.Alt)
                        {
                        }
                    }
                }
            }

            _pressedNode = null;
            SelectionHandler.ReleaseTempSelection();

            _lastMouseUpNode = mouseUpNode;
            _lastMouseUpItem = item;
            DrawHandler.ReDrawTree(false);
            //SetNodeSelected(selectedNode, pt);
            //this.Focus();
        }