Beispiel #1
0
 public void UpdateValues()
 {
     foreach (ControlTreeNode node in Nodes)
     {
         if (node.Name == "Axis")
         {
             TreeNodeArray axNode = (TreeNodeArray)node;
             axNode.UpdateValue(_linkedRotation.Axis);
         }
         if (node.Name == "Angle")
         {
             TreeNodeFloat angNode = (TreeNodeFloat)node;
             angNode.UpdateValue(_linkedRotation.Angle);
         }
         if (node.Name == "Origin")
         {
             TreeNodeVector3 orNode = (TreeNodeVector3)node;
             orNode.UpdateValue(_linkedRotation.Origin);
         }
         if (node.Name == "Rescale")
         {
             TreeNodeBool rescaleNode = (TreeNodeBool)node;
             rescaleNode.UpdateValue(_linkedRotation.Rescale);
         }
     }
 }
 public void UpdateValues()
 {
     this.UpdateValue(_linkedBox.Name);
     foreach (ControlTreeNode node in Nodes)
     {
         if (node.Name == "Faces")
         {
             foreach (TreeNodeFace faceNode in node.Nodes)
             {
                 faceNode.UpdateValues();
             }
         }
         if (node.Name == "Shade")
         {
             TreeNodeBool shadeNode = (TreeNodeBool)node;
             shadeNode.UpdateValue(_linkedBox.Shade);
         }
         if (node.Name == "From")
         {
             TreeNodeVector3 fromNode = (TreeNodeVector3)node;
             fromNode.UpdateValue(_linkedBox.From);
         }
         if (node.Name == "To")
         {
             TreeNodeVector3 toNode = (TreeNodeVector3)node;
             toNode.UpdateValue(_linkedBox.To);
         }
         if (node.Name == "Rotation")
         {
             TreeNodeRotation rotNode = (TreeNodeRotation)node;
             rotNode.UpdateValues();
         }
     }
 }
        private void Configurate()
        {
            this.ImageIndex       = 2;
            base.ValueChanged    += new TreeNodeValueChangedHandler(On_Name_Changed);
            base.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);

            ContextMenuStrip  menuStripBox = new ContextMenuStrip();
            ToolStripMenuItem removeBox    = new ToolStripMenuItem("Remove Element");

            removeBox.Click += new EventHandler(On_Remove_Box_Click);
            menuStripBox.Items.Add(removeBox);
            ContextMenuStrip = menuStripBox;

            ControlTreeNode facesNode = new ControlTreeNode("Faces");

            facesNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);
            for (int i = 0; i < _linkedBox.Faces.Count; i++)
            {
                TreeNodeFace faceNode = _linkedBox.Faces[i].TreeNode;
                facesNode.Nodes.Add(faceNode);
            }

            TreeNodeBool shadeNode = new TreeNodeBool("Shade", _linkedBox.Shade);

            shadeNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);
            shadeNode.ValueChanged    += new TreeNodeValueChangedHandler(On_Shade_Changed);

            TreeNodeVector3 fromNode = new TreeNodeVector3("From", _linkedBox.From, -16, 32, 2);

            fromNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);
            fromNode.ValueChanged    += new TreeNodeValueChangedHandler(On_From_Changed);

            TreeNodeVector3 toNode = new TreeNodeVector3("To", _linkedBox.To, -16, 32, 2);

            toNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);
            toNode.ValueChanged    += new TreeNodeValueChangedHandler(On_To_Changed);

            TreeNodeRotation rotNode = _linkedBox.Rotation.TreeNode;

            rotNode.SelectedChanged += new TreeNodeSelectedChangedHandler(On_Selected_Changed);

            Nodes.Add(facesNode);
            Nodes.Add(fromNode);
            Nodes.Add(toNode);
            Nodes.Add(shadeNode);
            Nodes.Add(rotNode);
        }
Beispiel #4
0
        private void Configurate()
        {
            TreeNodeArray axisNode = new TreeNodeArray("Axis", _linkedRotation.Axis, Enum.GetValues(typeof(Axis)));

            axisNode.ValueChanged += new TreeNodeValueChangedHandler(On_Axis_Changed);

            TreeNodeFloat angleNode = new TreeNodeFloat("Angle", _linkedRotation.Angle, -45, 45, 22.5f);

            angleNode.ValueChanged += new TreeNodeValueChangedHandler(On_Angle_Changed);

            TreeNodeVector3 originNode = new TreeNodeVector3("Origin", _linkedRotation.Origin);

            originNode.ValueChanged += new TreeNodeValueChangedHandler(On_Origin_Changed);

            TreeNodeBool rescaleNode = new TreeNodeBool("Rescale", _linkedRotation.Rescale);

            rescaleNode.ValueChanged += new TreeNodeValueChangedHandler(On_Rescale_Changed);

            Nodes.Add(axisNode);
            Nodes.Add(angleNode);
            Nodes.Add(originNode);
            Nodes.Add(rescaleNode);
        }