public wTree() { InitializeComponent(); UseCustomDrawing = false; _children = new wTreeNodeCollection(this); _children.E_TreeListChanged += TreeListChanged; _children.E_TreeNodeChanged += TreeNodeChanged; }
private Size RePaint(Graphics g, wTreeNodeCollection children, Point startPoint) { Size totalSize = new Size(0, 0); foreach (wTreeNode node in children) { Size drawnSize = DrawNode(g, node, startPoint); totalSize.Width += drawnSize.Width; totalSize.Height += drawnSize.Height; startPoint.Y += drawnSize.Height; if (node.IsExpaned) { Point drawingPoint = new Point(startPoint.X + _levelSize, startPoint.Y); drawnSize = RePaint(g, node.Children, drawingPoint); totalSize.Width += drawnSize.Width; totalSize.Height += drawnSize.Height; startPoint.Y += drawnSize.Height; } } return(totalSize); }
public wTree() { InitializeComponent(); _children = new wTreeNodeCollection(this, this); _children.E_TreeExpandChanged += _children_E_TreeExpandChanged; _children.E_TreeListChanged += _children_E_TreeListChanged; _children.E_TreeNodeChanged += _children_E_TreeNodeChanged; //this.BackgroundImage = _imageBufferToDraw; //this.BackgroundImageLayout = ImageLayout.None; this.SizeChanged += wTree_SizeChanged; B_FocusGetter.SetBounds(-1000, 0, 0, 0, BoundsSpecified.Location); _editorHandler = new EditorHandlerClass(this); _editorHandler.InitEditors(); _drawHandler = new DrawHandler(this); _selHandler = new wTreeSelections(this); _scrolls = new wTreeScroll(this, Scroll_Vertical, Scroll_Horizontal); this.SetScrollState(0, true); _mouseHandler = new wTreeMouseEventsHandler(this); B_FocusGetter.KeyDown += B_FocusGetter_KeyDown; }