Exemple #1
0
		public static void EnterKeyDown(TreeGX tree, KeyEventArgs e)
		{
			if(tree.SelectedNode!=null && tree.SelectedNode.Nodes.Count>0)
			{
				tree.SelectedNode.Toggle(eTreeAction.Keyboard);
			}
		}
Exemple #2
0
		public static void KeyDown(TreeGX tree, KeyEventArgs e)
		{
			switch(e.KeyCode)
			{
				case Keys.Enter:
					{
						EnterKeyDown(tree, e);
						e.Handled = true;
						break;
					}
				case Keys.Up:
				case Keys.Down:
				case Keys.Left:
				case Keys.Right:
					{
						NavigateKeyDown(tree, e);
						e.Handled = true;
						break;
					}
			}
		}
Exemple #3
0
		/// <summary>
		/// Initializes control with default settings for connectors and nodes.
		/// </summary>
		/// <param name="tree">Control to initialize.</param>
		/// <param name="factory">Factory to use to create new instances of objects.</param>
		internal static void InitializeTree(TreeGX tree, ComponentFactory factory)
		{
			tree.RootConnector=factory.CreateComponent(typeof(NodeConnector)) as NodeConnector;
			tree.RootConnector.LineWidth=5;
			tree.RootConnector.LineColor=SystemColors.Highlight;
			tree.NodesConnector=factory.CreateComponent(typeof(NodeConnector)) as NodeConnector;
			tree.NodesConnector.LineWidth=5;
			tree.NodesConnector.LineColor=SystemColors.Highlight;

			eStyleBorderType border=eStyleBorderType.Solid;
			ElementStyle style=factory.CreateComponent(typeof(ElementStyle)) as ElementStyle;
			
			style.BackColorSchemePart=eColorSchemePart.BarBackground;
			style.BackColor2SchemePart=eColorSchemePart.BarBackground2;
			style.BackColorGradientAngle=90;
			style.CornerDiameter=4;
			style.CornerType=eCornerType.Rounded;
			style.BorderLeft=border;
			style.BorderLeftWidth=1;
			style.BorderTop=border;
			style.BorderTopWidth=1;
			style.BorderBottom=border;
			style.BorderBottomWidth=1;
			style.BorderRight=border;
			style.BorderRightWidth=1;
			style.BorderColorSchemePart=eColorSchemePart.BarDockedBorder;
			style.PaddingBottom=3;
			style.PaddingLeft=3;
			style.PaddingRight=3;
			style.PaddingTop=3;
			style.TextColor=Color.FromArgb(0,0,128);
			style.Font=tree.Font;
			tree.Styles.Add(style);

			tree.NodeStyle=style;
		}
Exemple #4
0
		/// <summary>
		/// Saves Nodes to specified file.
		/// </summary>
		/// <param name="tree">TreeGX to save</param>
		/// <param name="fileName">Target file name</param>
		public static void Save(TreeGX tree, string fileName)
		{
			XmlDocument document=Save(tree);
			document.Save(fileName);
		}
Exemple #5
0
		/// <summary>
		/// Saves Nodes to stream.
		/// </summary>
		/// <param name="tree">TreeGX to save</param>
		/// <param name="outStream">Stream to save nodes to.</param>
		public static void Save(TreeGX tree, Stream outStream)
		{
			XmlDocument document=Save(tree);
			document.Save(outStream);
		}
Exemple #6
0
		/// <summary>
		/// Load TreeGX from XmlDocument that was created by Save method.
		/// </summary>
		/// <param name="tree">Tree Control to load</param>
		/// <param name="document">XmlDocument to load control from</param>
		public static void Load(TreeGX tree, XmlDocument document)
		{
			foreach(XmlNode xmlNode in document.ChildNodes)
			{
				if(xmlNode.Name==XmlTreeGXName && xmlNode is XmlElement)
				{
					Load(tree, xmlNode as XmlElement);
					break;
				}
			}
		}
Exemple #7
0
		/// <summary>
		/// Load nodes from XmlElement.
		/// </summary>
		/// <param name="tree">Reference to TreeGX to be populated.</param>
		/// <param name="parent">XmlElement that tree was serialized to.</param>
		public static void Load(TreeGX tree, XmlElement parent)
		{
			tree.BeginUpdate();
			tree.DisplayRootNode = null;
			tree.Nodes.Clear();
			
			NodeSerializationContext context = new NodeSerializationContext();
			context.TreeGX = tree;
			context.HasDeserializeNodeHandlers  = tree.HasDeserializeNodeHandlers;
			context.HasSerializeNodeHandlers = tree.HasSerializeNodeHandlers;
			
			try
			{
				foreach(XmlNode xmlNode in parent.ChildNodes)
				{
					if(xmlNode.Name==XmlNodeName && xmlNode is XmlElement)
					{
						Node node=new Node();
						tree.Nodes.Add(node);
						context.RefXmlElement = xmlNode as XmlElement;
						LoadNode(node, context);
					}
				}
			}
			finally
			{
				tree.EndUpdate();
			}
		}
Exemple #8
0
		public static void NavigateKeyDown(TreeGX tree, KeyEventArgs e)
		{
			if(tree.SelectedNode==null)
			{
				if(tree.DisplayRootNode!=null)
					tree.SelectNode(tree.DisplayRootNode, eTreeAction.Keyboard);
				else if(tree.Nodes.Count>0)
					tree.SelectNode(tree.Nodes[0], eTreeAction.Keyboard);
				return;
			}
			
			Node node=tree.SelectedNode;
			
			if(e.KeyCode == Keys.Down || e.KeyCode == Keys.Right && NodeOperations.GetVisibleChildNodesCount(node) == 0)
			{
                int currentCell = 0;

                if (node != null && node.SelectedCell != null) currentCell = node.Cells.IndexOf(node.SelectedCell);

                Node nextNode = NodeOperations.GetNextVisibleNode(node);

                //// Adjust nextNode so the multi-selection is proper
                //if ((e.KeyData & Keys.Shift) == Keys.Shift && tree.MultiSelect && tree.SelectedNodes.Count > 1)
                //{
                //    if (tree.SelectedNodes[0].Bounds.Y > tree.SelectedNodes[tree.SelectedNodes.Count - 1].Bounds.Y)
                //        nextNode = tree.SelectedNodes[tree.SelectedNodes.Count - 1];
                //}

                if (nextNode != null)
                {
                    if (!nextNode.CanSelect)
                    {
                        int counter = 0;
                        while (nextNode != null && counter < 100)
                        {
                            nextNode = NodeOperations.GetNextVisibleNode(nextNode);
                            if (nextNode != null && nextNode.CanSelect) break;
                        }
                    }
                    //if ((e.KeyData & Keys.Shift) == Keys.Shift && tree.MultiSelect && tree.SelectedNodes.Count > 0)
                    //{
                    //    if (tree.MultiSelectRule == eMultiSelectRule.SameParent && tree.SelectedNodes[0].Parent != nextNode.Parent) return true;

                    //    if (nextNode.IsSelected)
                    //        tree.SelectedNodes.Remove(nextNode, eTreeAction.Keyboard);
                    //    else
                    //        tree.SelectedNodes.Add(nextNode, eTreeAction.Keyboard);
                    //    nextNode.EnsureVisible();
                    //}
                    //else
                    {
                        tree.SelectNode(nextNode, eTreeAction.Keyboard);
                        //if (tree.SelectionPerCell && currentCell < nextNode.Cells.Count && currentCell > 0)
                        //    nextNode.SetSelectedCell(nextNode.Cells[currentCell], eTreeAction.Keyboard);
                    }
                }
			}
			else if(e.KeyCode == Keys.Up || e.KeyCode == Keys.Left && node.Parent == null)
			{
                int currentCell = 0;
                if (node != null && node.SelectedCell != null) currentCell = node.Cells.IndexOf(node.SelectedCell);

                Node prevNode = NodeOperations.GetPreviousVisibleNode(node);
                if (prevNode != null)
                {
                    if (!prevNode.CanSelect)
                    {
                        int counter = 0;
                        while (prevNode != null && counter < 100)
                        {
                            prevNode = NodeOperations.GetPreviousVisibleNode(prevNode);
                            if (prevNode != null && prevNode.CanSelect) break;
                        }
                    }
                    //if ((e.KeyData & Keys.Shift) == Keys.Shift && tree.MultiSelect && tree.SelectedNodes.Count > 0)
                    //{
                    //    if (tree.MultiSelectRule == eMultiSelectRule.SameParent && tree.SelectedNodes[0].Parent != prevNode.Parent) return true;
                    //    if (prevNode.IsSelected)
                    //    {
                    //        tree.SelectedNodes.Remove(tree.SelectedNodes[tree.SelectedNodes.Count - 1], eTreeAction.Keyboard);
                    //    }
                    //    else
                    //        tree.SelectedNodes.Add(prevNode, eTreeAction.Keyboard);
                    //    prevNode.EnsureVisible();
                    //}
                    //else 
                    if (prevNode != null)
                    {
                        tree.SelectNode(prevNode, eTreeAction.Keyboard);
                        //if (tree.SelectionPerCell && currentCell < prevNode.Cells.Count && currentCell > 0)
                        //    prevNode.SetSelectedCell(prevNode.Cells[currentCell], eTreeAction.Keyboard);
                    }
                }
			}
			else if(e.KeyCode == Keys.Right)
			{
				Node childNode = NodeOperations.GetFirstVisibleChildNode(node);
				if(childNode!=null)
					tree.SelectNode(childNode, eTreeAction.Keyboard);
			}
			else if(e.KeyCode == Keys.Left)
			{
				if(node.Parent!=null)
					tree.SelectNode(node.Parent, eTreeAction.Keyboard);
			}
		}
Exemple #9
0
        /// <summary>
        /// Returns last rendered node on screen.
        /// </summary>
        /// <param name="tree">Tree control.</param>
        /// <returns>Last rendered node or null</returns>
        public static Node GetLastDisplayedNode(TreeGX tree)
        {
            Rectangle r = tree.ClientRectangle;
            Node node = tree.SelectedNode;
            if (node == null) node = GetFirstVisibleNode(tree);
            Point scrollPos = Point.Empty;
            if (tree.AutoScroll)
                scrollPos = tree.GetAutoScrollPositionOffset();

            // Find last fully rendered node
            Node lastNode = null;
            if (r.Contains(node.Bounds))
                lastNode = node;
            while (node != null)
            {
                node = NodeOperations.GetNextVisibleNode(node);
                if (node != null && node.Selectable)
                {
                    Rectangle nodeRect = NodeDisplay.GetNodeRectangle(eNodeRectanglePart.NodeContentBounds, node, scrollPos);
                    if (r.Contains(nodeRect))
                        lastNode = node;
                    else if (nodeRect.Y > r.Bottom)
                        break;
                }
            }

            return lastNode;
        }
Exemple #10
0
		/// <summary>
		/// Saves TreeGX to an existing XmlDocument. New node TreeGX is created in document and Nodes are serialized into it.
		/// </summary>
		/// <param name="tree">TreeGX to serialize</param>
		/// <param name="document">XmlDocument instance.</param>
		public static void Save(TreeGX tree, XmlDocument document)
		{
			XmlElement parent = document.CreateElement(XmlTreeGXName);
			document.AppendChild(parent);
			TreeSerializer.Save(tree, parent);
		}
Exemple #11
0
		/// <summary>
		/// Returns true if node passed is considered root node for display purposes.
		/// </summary>
		/// <param name="tree">Reference to the tree control.</param>
		/// <param name="node">Node to test.</param>
		/// <returns>true if node is root node for display purposes otherwise false.</returns>
		public static bool IsRootNode(TreeGX tree, Node node)
		{
			if(node.Parent==null || node==tree.DisplayRootNode)
				return true;
			return false;
		}
Exemple #12
0
		/// <summary>
		/// Initializes control with default settings for connectors and nodes.
		/// </summary>
		/// <param name="tree">Control to initialize.</param>
		public static void InitializeTree(TreeGX tree)
		{
			InitializeTree(tree,new ComponentFactory());
		}
Exemple #13
0
		/// <summary>
		/// Saves nodes to XmlWriter.
		/// </summary>
		/// <param name="tree">TreeGX to save</param>
		/// <param name="writer">XmlWriter to write nodes to</param>
		public static void Save(TreeGX tree, XmlWriter writer)
		{
			XmlDocument document=Save(tree);
			document.Save(writer);
		}
Exemple #14
0
		/// <summary>
		/// Returns reference to a node that is hosting given control.
		/// </summary>
		/// <param name="tree">Reference to the TreeGX control instance</param>
		/// <param name="c">Control instance to look for</param>
		/// <returns>Reference to a node hosting control or null if node could not be found</returns>
		public static Node FindNodeForControl(TreeGX tree, System.Windows.Forms.Control c)
		{
			if(tree==null || c==null || tree.Nodes.Count==0)
				return null;
			
			Node node = tree.Nodes[0];
			while(node!=null)
			{
				foreach(Cell cell in node.Cells)
				{
					if(cell.HostedControl==c)
						return node;
				}
				node = node.NextVisibleNode;
			}
			
			return null;
		}
Exemple #15
0
		public static TreeAreaInfo GetTreeAreaInfo(TreeGX tree, int x, int y)
		{
			TreeAreaInfo areaInfo=new TreeAreaInfo();

            if (tree.Nodes.Count == 0 || !tree.DisplayRectangle.Contains(x, y) && tree.Zoom == 1)
				return null;

			Node node=tree.Nodes[0];
			if(tree.DisplayRootNode!=null)
				node = tree.DisplayRootNode;
			
			Node dragNode = tree.GetDragNode();
			Rectangle dragNodeBounds=NodeDisplay.GetNodeRectangle(eNodeRectanglePart.NodeBounds,dragNode,tree.NodeDisplay.Offset);
			if(dragNodeBounds.Contains(x,y))
			{
				areaInfo.NodeAt=dragNode;
				return areaInfo;
			}

			int dragNodeWidth = dragNode.BoundsRelative.Width;
			Node previousNode = null;
			Rectangle previousRect=Rectangle.Empty;
			
			if(tree.DisplayRootNode!=null)
				node=tree.DisplayRootNode;
			while(node!=null)
			{
				if(!node.IsDisplayed)
				{
					node = node.NextVisibleNode;
					continue;
				}
				Rectangle r=NodeDisplay.GetNodeRectangle(eNodeRectanglePart.NodeBounds,node,tree.NodeDisplay.Offset);
				if(r.Contains(x,y))
				{
					areaInfo.NodeAt = node;
					break;
				}
				
				if(previousNode!=null && node.Parent==previousNode.Parent)
				{
					Rectangle totalArea;
					if(r.Width<dragNodeWidth || previousRect.Width<dragNodeWidth)
					{
						totalArea =
							Rectangle.Union(new Rectangle(r.Location, new Size(dragNodeWidth, r.Height)),
							                new Rectangle(previousRect.Location, new Size(dragNodeWidth, previousRect.Height)));
					}
					else
						totalArea=Rectangle.Union(r,previousRect);
					if(totalArea.Contains(x,y))
					{
						Rectangle r1 = r;
						Rectangle r2 = previousRect;
						if(totalArea.Width>r1.Width) r1.Width = totalArea.Width;
						if(totalArea.Width>r2.Width) r2.Width = totalArea.Width;
						if(!r1.Contains(x,y) && !r2.Contains(x,y))
						{
							areaInfo.PreviousNode = previousNode;
							areaInfo.NextNode = node;
							areaInfo.NodeAt = null;
							areaInfo.ParentAreaNode = node.Parent;
							break;
						}
					}
				}
				
				previousNode = node;
				previousRect = r;
				
                //r=NodeDisplay.GetNodeRectangle(eNodeRectanglePart.ChildNodeBounds,node,tree.NodeDisplay.Offset);

                //if (!r.Contains(x, y))
                //    node = GetNextVisibleSibling(node);
                //else
				node = node.NextVisibleNode;
			}
			return areaInfo;
		}
Exemple #16
0
		/// <summary>
		/// Retrieves the tree node that is at the specified location.
		/// </summary>
		/// <returns>The TreeNode at the specified location, in tree view coordinates.</returns>
		/// <remarks>
		/// 	<para>You can pass the MouseEventArgs.X and MouseEventArgs.Y coordinates of the
		///     MouseDown event as the x and y parameters.</para>
		/// </remarks>
		/// <param name="x">The X position to evaluate and retrieve the node from.</param>
		/// <param name="y">The Y position to evaluate and retrieve the node from.</param>
		/// <param name="tree">Tree control to find node at.</param>
		public static Node GetNodeAt(TreeGX tree, int x, int y)
		{
            if (tree.Nodes.Count == 0 || !tree.DisplayRectangle.Contains(x, y) && tree.Zoom == 1)
                return null;

			Node node=tree.Nodes[0];
			Node retNode=null;
			if(tree.DisplayRootNode!=null)
				node=tree.DisplayRootNode;
			while(node!=null)
			{
				Rectangle r=NodeDisplay.GetNodeRectangle(eNodeRectanglePart.NodeBounds,node,tree.NodeDisplay.Offset);
				if(r.Contains(x,y))
				{
					retNode=node;
					break;
				}
				r=NodeDisplay.GetNodeRectangle(eNodeRectanglePart.ChildNodeBounds,node,tree.NodeDisplay.Offset);
				if(!r.Contains(x,y))
					node = GetNextVisibleSibling(node);
				else
					node=node.NextVisibleNode;
			}

			return retNode;
		}
Exemple #17
0
		/// <summary>
		/// Retrieves the tree node that is at the specified location.
		/// </summary>
		/// <returns>The Node at the specified point, in tree view coordinates.</returns>
		/// <remarks>
		/// 	<para>You can pass the MouseEventArgs.X and MouseEventArgs.Y coordinates of the
		///     MouseDown event as the x and y parameters.</para>
		/// </remarks>
		/// <param name="p">The Point to evaluate and retrieve the node from.</param>
		/// <param name="tree">Tree control to find node at.</param>
		public static Node GetNodeAt(TreeGX tree, Point p)
		{
			return GetNodeAt(tree,p.X,p.Y);
		}
Exemple #18
0
        /// <summary>
        /// Gets first visible node.
        /// </summary>
        /// <param name="tree">Reference to tree.</param>
        /// <returns>Last visible node found or null</returns>
        public static Node GetFirstVisibleNode(TreeGX tree)
        {
            if (tree.Nodes.Count == 0) return null;

            Node node = tree.DisplayRootNode == null ? tree.Nodes[0] : tree.DisplayRootNode;
            if (node.Visible)
                return node;
            return GetNextVisibleNode(node);
        }
Exemple #19
0
		/// <summary>
		/// Creates new XmlDocument and serializes TreeGX into it.
		/// </summary>
		/// <param name="tree">TreeGX to serialize</param>
		/// <returns>New instance of XmlDocument/returns>
		public static XmlDocument Save(TreeGX tree)
		{
			XmlDocument document=new XmlDocument();
			Save(tree, document);
			return document;
		}
Exemple #20
0
        void newtab()
        {
            TabItem tabitem = new TabItem();
            TabControlPanel tabpanel = new TabControlPanel();
            TreeGX newmmap = new TreeGX();

            newmmap.AllowDrop = true;
            newmmap.AutoScrollMinSize = new System.Drawing.Size(60, 33);
            newmmap.BackColor = System.Drawing.Color.White;
            newmmap.CellEdit = true;
            newmmap.CommandBackColorGradientAngle = 90;
            newmmap.CommandMouseOverBackColor2SchemePart = DevComponents.Tree.eColorSchemePart.ItemHotBackground2;
            newmmap.CommandMouseOverBackColorGradientAngle = 90;
            newmmap.Dock = System.Windows.Forms.DockStyle.Fill;
            newmmap.ExpandLineColorSchemePart = DevComponents.Tree.eColorSchemePart.BarDockedBorder;
            newmmap.Font = new System.Drawing.Font("YouYuan", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            newmmap.Location = new System.Drawing.Point(1, 1);
            newmmap.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            newmmap.Name = "新文件";
            newmmap.NodesConnector = this.nodeConnector2;
            newmmap.NodeStyle = this.elementStyle1;
            newmmap.PathSeparator = ";";
            newmmap.RootConnector = this.nodeConnector1;
            newmmap.Size = new System.Drawing.Size(944, 409);
            newmmap.Styles.Add(this.elementStyle1);
            newmmap.Styles.Add(this.elementStyle2);
            newmmap.Styles.Add(this.elementStyle3);
            newmmap.Styles.Add(this.elementStyle4);
            newmmap.SuspendPaint = false;
            newmmap.TabIndex = 0;
            newmmap.Tag = tabs;
            newmmap.Text = "新文件";
            newmmap.AfterNodeSelect += new DevComponents.Tree.TreeGXNodeEventHandler(mindmap_AfterNodeSelect);

            tabitem.AttachedControl = tabpanel;
            tabitem.Name = "tabitem";
            tabitem.Tag = tabs++;
            tabitem.Text = "新文件";
            tabitem.Click += new System.EventHandler(tabitem_Click);

            tabpanel.Controls.Add(newmmap);
            tabpanel.DisabledBackColor = Color.Empty;
            tabpanel.Dock = System.Windows.Forms.DockStyle.Fill;
            tabpanel.Location = new System.Drawing.Point(0, 0);
            tabpanel.Name = "tabpanel";
            tabpanel.Padding = new System.Windows.Forms.Padding(1);
            tabpanel.Size = new System.Drawing.Size(946, 411);
            tabpanel.Style.BackColor1.Color = System.Drawing.Color.White;
            tabpanel.Style.Border = eBorderType.SingleLine;
            tabpanel.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(211)))), ((int)(((byte)(211)))), ((int)(((byte)(211)))));
            tabpanel.Style.BorderSide = ((DevComponents.DotNetBar.eBorderSide)(((DevComponents.DotNetBar.eBorderSide.Left | DevComponents.DotNetBar.eBorderSide.Right)
            | DevComponents.DotNetBar.eBorderSide.Top)));
            tabpanel.Style.GradientAngle = -90;
            tabpanel.TabItem = tabitem;

            tabv.Tabs.Add(tabitem);
            tabv.SelectedTab = tabitem;

            Gib.nowmmap = newmmap;
        }
Exemple #21
0
		/// <summary>
		/// Serializes TreeGX object to XmlElement object.
		/// </summary>
		/// <param name="tree">Instance of TreeGX to serialize.</param>
		/// <param name="parent">XmlElement to serialize to.</param>
		public static void Save(TreeGX tree, XmlElement parent)
		{
			NodeSerializationContext context = new NodeSerializationContext();
			context.RefXmlElement = parent;
			context.TreeGX = tree;
			context.HasSerializeNodeHandlers = tree.HasSerializeNodeHandlers;
			context.HasDeserializeNodeHandlers = tree.HasDeserializeNodeHandlers;
			
			foreach(Node node in tree.Nodes)
			{
				Save(node, context);
			}
		}
Exemple #22
0
		/// <summary>
		/// Load TreeGX Nodes from file.
		/// </summary>
		/// <param name="tree">Reference to TreeGX to populate</param>
		/// <param name="fileName">File name.</param>
		public static void Load(TreeGX tree, string fileName)
		{
			XmlDocument document=new XmlDocument();
			document.Load(fileName);
			Load(tree, document);
		}
Exemple #23
0
		/// <summary>
		/// Load TreeGX Nodes from stream.
		/// </summary>
		/// <param name="tree">Reference to TreeGX to populate</param>
		/// <param name="inStream">Reference to stream</param>
		public static void Load(TreeGX tree, Stream inStream)
		{
			XmlDocument document=new XmlDocument();
			document.Load(inStream);
			Load(tree, document);
		}
Exemple #24
0
		/// <summary>
		/// Load TreeGX Nodes from reader.
		/// </summary>
		/// <param name="tree">Reference to TreeGX to populate</param>
		/// <param name="reader">Reference to reader.</param>
		public static void Load(TreeGX tree, XmlReader reader)
		{
			XmlDocument document=new XmlDocument();
			document.Load(reader);
			Load(tree, document);
		}
Exemple #25
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 private void InitializeComponent()
 {
     this.treeGX1          = new DevComponents.Tree.TreeGX();
     this.node1            = new DevComponents.Tree.Node();
     this.nodeConnector1   = new DevComponents.Tree.NodeConnector();
     this.nodeConnector2   = new DevComponents.Tree.NodeConnector();
     this.elementStyle1    = new DevComponents.Tree.ElementStyle();
     this.nodeCustomRender = new DevComponents.Tree.Node();
     this.node3            = new DevComponents.Tree.Node();
     ((System.ComponentModel.ISupportInitialize)(this.treeGX1)).BeginInit();
     this.SuspendLayout();
     //
     // treeGX1
     //
     this.treeGX1.AllowDrop         = true;
     this.treeGX1.AutoScrollMinSize = new System.Drawing.Size(44, 22);
     //
     // treeGX1.BackgroundStyle
     //
     this.treeGX1.BackgroundStyle.BackColor2SchemePart   = DevComponents.Tree.eColorSchemePart.BarBackground2;
     this.treeGX1.BackgroundStyle.BackColorGradientAngle = 90;
     this.treeGX1.BackgroundStyle.BackColorSchemePart    = DevComponents.Tree.eColorSchemePart.BarBackground;
     this.treeGX1.CommandBackColorGradientAngle          = 90;
     this.treeGX1.CommandMouseOverBackColor2SchemePart   = DevComponents.Tree.eColorSchemePart.ItemHotBackground2;
     this.treeGX1.CommandMouseOverBackColorGradientAngle = 90;
     this.treeGX1.Dock = System.Windows.Forms.DockStyle.Fill;
     this.treeGX1.ExpandLineColorSchemePart = DevComponents.Tree.eColorSchemePart.BarDockedBorder;
     this.treeGX1.Location = new System.Drawing.Point(0, 0);
     this.treeGX1.Name     = "treeGX1";
     this.treeGX1.Nodes.AddRange(new DevComponents.Tree.Node[] {
         this.node1
     });
     this.treeGX1.NodesConnector = this.nodeConnector2;
     this.treeGX1.NodeStyle      = this.elementStyle1;
     this.treeGX1.PathSeparator  = ";";
     this.treeGX1.RootConnector  = this.nodeConnector1;
     this.treeGX1.Size           = new System.Drawing.Size(328, 222);
     this.treeGX1.Styles.Add(this.elementStyle1);
     this.treeGX1.SuspendPaint = false;
     this.treeGX1.TabIndex     = 0;
     this.treeGX1.Text         = "treeGX1";
     //
     // node1
     //
     this.node1.CellPartLayout = DevComponents.Tree.eCellPartLayout.Default;
     this.node1.Expanded       = true;
     this.node1.Name           = "node1";
     this.node1.Nodes.AddRange(new DevComponents.Tree.Node[] {
         this.nodeCustomRender,
         this.node3
     });
     this.node1.Text = "node1";
     //
     // nodeConnector1
     //
     this.nodeConnector1.LineWidth = 5;
     //
     // nodeConnector2
     //
     this.nodeConnector2.LineWidth = 5;
     //
     // elementStyle1
     //
     this.elementStyle1.BackColor2SchemePart   = DevComponents.Tree.eColorSchemePart.BarBackground2;
     this.elementStyle1.BackColorGradientAngle = 90;
     this.elementStyle1.BackColorSchemePart    = DevComponents.Tree.eColorSchemePart.BarBackground;
     this.elementStyle1.BorderBottom           = DevComponents.Tree.eStyleBorderType.Solid;
     this.elementStyle1.BorderBottomWidth      = 1;
     this.elementStyle1.BorderColorSchemePart  = DevComponents.Tree.eColorSchemePart.BarDockedBorder;
     this.elementStyle1.BorderLeft             = DevComponents.Tree.eStyleBorderType.Solid;
     this.elementStyle1.BorderLeftWidth        = 1;
     this.elementStyle1.BorderRight            = DevComponents.Tree.eStyleBorderType.Solid;
     this.elementStyle1.BorderRightWidth       = 1;
     this.elementStyle1.BorderTop      = DevComponents.Tree.eStyleBorderType.Solid;
     this.elementStyle1.BorderTopWidth = 1;
     this.elementStyle1.CornerDiameter = 4;
     this.elementStyle1.CornerType     = DevComponents.Tree.eCornerType.Rounded;
     this.elementStyle1.Font           = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
     this.elementStyle1.Name           = "elementStyle1";
     this.elementStyle1.PaddingBottom  = 3;
     this.elementStyle1.PaddingLeft    = 3;
     this.elementStyle1.PaddingRight   = 3;
     this.elementStyle1.PaddingTop     = 3;
     this.elementStyle1.TextColor      = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(128)));
     //
     // nodeCustomRender
     //
     this.nodeCustomRender.CellPartLayout = DevComponents.Tree.eCellPartLayout.Default;
     this.nodeCustomRender.Expanded       = true;
     this.nodeCustomRender.Name           = "nodeCustomRender";
     this.nodeCustomRender.Text           = "Custom Rendered Node";
     //
     // node3
     //
     this.node3.CellPartLayout = DevComponents.Tree.eCellPartLayout.Default;
     this.node3.Expanded       = true;
     this.node3.Name           = "node3";
     this.node3.Text           = "node3";
     //
     // Form1
     //
     this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
     this.ClientSize        = new System.Drawing.Size(328, 222);
     this.Controls.Add(this.treeGX1);
     this.Name  = "Form1";
     this.Text  = "Custom Redering";
     this.Load += new System.EventHandler(this.Form1_Load);
     ((System.ComponentModel.ISupportInitialize)(this.treeGX1)).EndInit();
     this.ResumeLayout(false);
 }
Exemple #26
0
		//private bool m_LayoutPerformed=false;

		public NodeTreeLayout(TreeGX treeControl, Rectangle clientArea):base(treeControl,clientArea)
		{
			//m_ExpandAreaWidth=16;
			m_ExpandPartSize=new Size(9,9);
		}