Esempio n. 1
0
        private void Draw(Graphics g, RTreeNode node)
        {
            var drawString = "[" + (node.IsEmpty() ? " " : node.Collapsed ? "+" : "-") + "]" + node.Name;

            node.Drawn = true;
            g.FillRectangle(new SolidBrush(Color.FromArgb(Math.Min(218 + 10 * node.Depth, 255), Math.Min(165 + 30 * node.Depth, 255), Math.Min(32 + 50 * node.Depth, 255))), new Rectangle(node.Location, node.Size));
            g.DrawString(drawString, DefaultFont, Brushes.Black, node.Location.X, node.Location.Y);
        }
Esempio n. 2
0
        private void MouseUpOnElem(RTreeNode node, MouseEventArgs e)
        {
            if (!node.IsEmpty() && !LastClickDrag)
            {
                node.Collapsed = !node.Collapsed;
                HardRefresh();
            }

            LastClickDrag  = false;
            NodeBeingMoved = null;
        }