Beispiel #1
0
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            {
                Alt.GUI.Temporary.Gwen.Control.TreeControl ctrl = new Alt.GUI.Temporary.Gwen.Control.TreeControl(this);

                ctrl.AddNode("Node One");
                Alt.GUI.Temporary.Gwen.Control.TreeNode node = ctrl.AddNode("Node Two");
                node.AddNode("Node Two Inside");
                node.AddNode("Eyes");
                node.AddNode("Brown").AddNode("Node Two Inside").AddNode("Eyes").AddNode("Brown");
                node.AddNode("More");
                node.AddNode("Nodes");
                ctrl.AddNode("Node Three");

                ctrl.SetBounds(30, 30, 200, 200);
                ctrl.ExpandAll();

                ctrl.Selected  += NodeSelected;
                ctrl.Expanded  += NodeExpanded;
                ctrl.Collapsed += NodeCollapsed;
            }

            {
                Alt.GUI.Temporary.Gwen.Control.TreeControl ctrl = new Alt.GUI.Temporary.Gwen.Control.TreeControl(this);

                ctrl.AllowMultiSelect = true;

                ctrl.AddNode("Node One");
                Alt.GUI.Temporary.Gwen.Control.TreeNode node = ctrl.AddNode("Node Two");
                node.AddNode("Node Two Inside");
                node.AddNode("Eyes");
                Alt.GUI.Temporary.Gwen.Control.TreeNode nodeTwo = node.AddNode("Brown").AddNode("Node Two Inside").AddNode("Eyes");
                nodeTwo.AddNode("Brown");
                nodeTwo.AddNode("Green");
                nodeTwo.AddNode("Slime");
                nodeTwo.AddNode("Grass");
                nodeTwo.AddNode("Pipe");
                node.AddNode("More");
                node.AddNode("Nodes");

                ctrl.AddNode("Node Three");

                ctrl.SetBounds(240, 30, 200, 200);
                ctrl.ExpandAll();

                ctrl.Selected  += NodeSelected;
                ctrl.Expanded  += NodeExpanded;
                ctrl.Collapsed += NodeCollapsed;
            }
        }
        void BuildPrimaryTree()
        {
            //foreach (string name in Enum.GetNames(typeof(DemoType)))
            foreach (string name in EnumHelper.GetNames <DemoType>())
            {
                DemoType type = (DemoType)EnumHelper.Parse(typeof(DemoType), name);

                Alt.GUI.Temporary.Gwen.Control.TreeNode node = m_ExamplesTreeView.AddNode(TypeToName(type));

                node.NormalTextColor = GroupColor;
                node.HoverTextColor  = HoverColor;

                node.IsSelectable = false;

                typeToNodeTable[type] = node;
            }
        }
Beispiel #3
0
        protected void RegisterExampleCategory(string category)
        {
            if (!string.IsNullOrEmpty(category))
            {
                foreach (Alt.GUI.Temporary.Gwen.Control.TreeNode node in m_ExamplesTreeView.Children)
                {
                    if (node != null &&
                        string.Equals(node.Text, category))
                    {
                        return;
                    }
                }
            }

            Alt.GUI.Temporary.Gwen.Control.TreeNode categoryNode = m_ExamplesTreeView.AddNode(category);
            categoryNode.NormalTextColor = GroupColor;
            categoryNode.HoverTextColor  = HoverColor;
            categoryNode.IsSelectable    = false;
        }
        void InitTree()
        {
            Alt.GUI.Temporary.Gwen.Control.TreeNode node = null;
            foreach (var ex in vm.Examples)
            {
                if (node == null ||
                    node.Text != ex.Category)
                {
                    node = m_ExamplesTreeView.AddNode(ex.Category);

                    node.NormalTextColor = GroupColor;
                    node.HoverTextColor  = HoverColor;

                    node.IsSelectable = false;
                }

                Alt.GUI.Temporary.Gwen.Control.TreeNode n = node.AddNode(ex.Title);
                n.Tag               = ex;
                n.NormalTextColor   = NormalColor;
                n.SelectedTextColor = SelectedColor;
                n.HoverTextColor    = HoverColor;
            }
            InitPlot();
        }