public override GH_ObjectResponse RespondToMouseUp(GH_Canvas sender, GH_CanvasMouseEvent e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                GH_Component comp = Owner as GH_Component;
                if (drag)
                {
                    // if drag was true then we release it here:
                    scrollStartY += deltaY;
                    deltaY        = 0;
                    drag          = false;
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Release);
                }

                System.Drawing.RectangleF rec = BorderBound;
                if (rec.Contains(e.CanvasLocation))
                {
                    unfolded = !unfolded;
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }

                if (unfolded)
                {
                    System.Drawing.RectangleF rec3 = dropdownBound;
                    if (rec3.Contains(e.CanvasLocation))
                    {
                        for (int i = 0; i < dropdownlist.Count; i++)
                        {
                            System.Drawing.RectangleF rec4 = dropdownBounds[i];
                            if (rec4.Contains(e.CanvasLocation))
                            {
                                comp.RecordUndoEvent("Selected " + dropdownlist[i]);
                                displayText = dropdownlist[i]; //change what user sees to selected item
                                action(dropdownlist[i]);       // send selected item back to component
                                unfolded = !unfolded;          // close dropdown
                                comp.ExpireSolution(true);
                                return(GH_ObjectResponse.Handled);
                            }
                        }
                    }
                    else
                    {
                        unfolded = !unfolded;
                        comp.ExpireSolution(true);
                        return(GH_ObjectResponse.Handled);
                    }
                }
            }
            return(base.RespondToMouseUp(sender, e));
        }
Beispiel #2
0
        public override GH_ObjectResponse RespondToMouseMove(GH_Canvas sender, GH_CanvasMouseEvent e)
        {
            if (dragX)
            {
                GH_Component comp = Owner as GH_Component;

                deltaX = e.CanvasLocation.X - dragMouseStartX;

                Grasshopper.Instances.CursorServer.AttachCursor(sender, "GH_NumericSlider");

                comp.ExpireSolution(true);
                return(GH_ObjectResponse.Ignore);
            }

            RectangleF rec = GrabBound;

            if (rec.Contains(e.CanvasLocation))
            {
                mouseOver = true;
                Grasshopper.Instances.CursorServer.AttachCursor(sender, "GH_NumericSlider");
                return(GH_ObjectResponse.Capture);
            }

            if (mouseOver)
            {
                mouseOver = false;
                Grasshopper.Instances.CursorServer.ResetCursor(sender);
                return(GH_ObjectResponse.Release);
            }

            return(base.RespondToMouseMove(sender, e));
        }
        public override GH_ObjectResponse RespondToMouseMove(GH_Canvas sender, GH_CanvasMouseEvent e)
        {
            if (drag)
            {
                GH_Component comp = Owner as GH_Component;

                deltaY = e.CanvasLocation.Y - dragMouseStartY;

                comp.ExpireSolution(true);
                return(GH_ObjectResponse.Ignore);
            }

            for (int i = 0; i < ButtonBound.Count; i++)
            {
                if (ButtonBound[i].Contains(e.CanvasLocation))
                {
                    mouseOver     = true;
                    sender.Cursor = System.Windows.Forms.Cursors.Hand;
                    return(GH_ObjectResponse.Capture);
                }
            }
            if (mouseOver)
            {
                mouseOver = false;
                Grasshopper.Instances.CursorServer.ResetCursor(sender);
                return(GH_ObjectResponse.Release);
            }

            return(base.RespondToMouseMove(sender, e));
        }
Beispiel #4
0
 private void button_ok_Click(object sender, EventArgs e)
 {
     settings.ToolDiameter = (double)this.num_tooldiameter.Value;
     settings.StepDown     = (double)this.num_stepdown.Value;
     settings.StepOver     = (double)this.num_stepover.Value;
     component.ExpireSolution(true);
     this.Close();
     this.Dispose();
 }
        public static object GetOutput(GH_Component component, int index, int branch = 0, int item = 0)
        {
            if (component.Params.Output[index].VolatileDataCount == 0)
            {
                // run component calculation
                component.ExpireSolution(true);

                // read output data
                component.Params.Output[index].CollectData();
            }

            // set output data to Gsa-goo type
            return(component.Params.Output[index].VolatileData.get_Branch(branch)[item]);
        }
        public override GH_ObjectResponse RespondToMouseDown(GH_Canvas sender, GH_CanvasMouseEvent e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                GH_Component comp = Owner as GH_Component;

                if (xTxtBounds.Contains(e.CanvasLocation) | xBounds.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle X");
                    x = !x;
                    update(x, y, z, xx, yy, zz);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (yTxtBounds.Contains(e.CanvasLocation) | yBounds.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle Y");
                    y = !y;
                    update(x, y, z, xx, yy, zz);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (zTxtBounds.Contains(e.CanvasLocation) | zBounds.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle Z");
                    z = !z;
                    update(x, y, z, xx, yy, zz);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (xxTxtBounds.Contains(e.CanvasLocation) | xxBounds.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle XX");
                    xx = !xx;
                    update(x, y, z, xx, yy, zz);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (yyTxtBounds.Contains(e.CanvasLocation) | yyBounds.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle YY");
                    yy = !yy;
                    update(x, y, z, xx, yy, zz);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (zzTxtBounds.Contains(e.CanvasLocation) | zzBounds.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle ZZ");
                    zz = !zz;
                    update(x, y, z, xx, yy, zz);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
            }
            return(base.RespondToMouseDown(sender, e));
        }
Beispiel #7
0
        public override GH_ObjectResponse RespondToMouseDown(GH_Canvas sender, GH_CanvasMouseEvent e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                System.Drawing.RectangleF rec = GrabBound;
                GH_Component comp             = Owner as GH_Component;
                if (rec.Contains(e.CanvasLocation))
                {
                    dragMouseStartX = e.CanvasLocation.X;
                    dragX           = true;
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Capture);
                }

                for (int i = 0; i < dropdownlists.Count; i++)
                {
                    if (unfolded[i])
                    {
                        if (e.Button == System.Windows.Forms.MouseButtons.Left)
                        {
                            rec  = scrollBar;
                            comp = Owner as GH_Component;
                            if (rec.Contains(e.CanvasLocation))
                            {
                                dragMouseStartY = e.CanvasLocation.Y;
                                dragY           = true;
                                comp.ExpireSolution(true);
                                return(GH_ObjectResponse.Capture);
                            }
                        }
                    }
                }
            }

            return(base.RespondToMouseDown(sender, e));
        }
        private void button_ok_Click(object sender, EventArgs e)
        {
            settings.SafeZ  = (double)this.num_safez.Value;
            settings.RapidZ = (double)this.num_rapidz.Value;
            if (settings.RapidZ < settings.SafeZ)
            {
                settings.RapidZ = settings.SafeZ;
            }

            settings.FeedRate        = (double)this.num_feedrate.Value;
            settings.RapidRate       = (double)this.num_rapidrate.Value;
            settings.PlungeRate      = settings.FeedRate / 3;
            settings.UseExternalAxis = this.ext_axis_checkbox.Checked;
            component.ExpireSolution(true);
            this.Close();
            this.Dispose();
        }
Beispiel #9
0
 public override GH_ObjectResponse RespondToMouseUp(GH_Canvas sender, GH_CanvasMouseEvent e)
 {
     if (e.Button == System.Windows.Forms.MouseButtons.Left)
     {
         GH_Component comp = Owner as GH_Component;
         if (dragX)
         {
             // if drag was true then we release it here:
             scrollStartX += deltaX;
             deltaX        = 0;
             dragX         = false;
             comp.ExpireSolution(true);
             return(GH_ObjectResponse.Release);
         }
     }
     return(base.RespondToMouseUp(sender, e));
 }
Beispiel #10
0
        protected int FindFrameObject(IGH_DataAccess DA)
        {
            if (this.Params.Input[0].SourceCount == 0)
            {
                this.AddRuntimeMessage(GH_RuntimeMessageLevel.Remark, "Please input a NumberSlider or a VrayTimeLine to Input Frame.");
                return(int.MinValue);
            }

            FrameObject = this.Params.Input[0].Sources[0].Attributes.GetTopLevel.DocObject;
            if (FrameObject is GH_NumberSlider)
            {
                this.IsInputASlider = true;
                GH_NumberSlider frameSlider = FrameObject as GH_NumberSlider;

                if (frameSlider.Slider.Maximum != this.MaxFrame)
                {
                    frameSlider.Slider.Maximum = this.MaxFrame;
                }
                if (frameSlider.Slider.Minimum != 0)
                {
                    frameSlider.Slider.Minimum = 0;
                }
                frameSlider.Slider.Type = Grasshopper.GUI.Base.GH_SliderAccuracy.Integer;

                if (frameSlider.Slider.Value > frameSlider.Slider.Maximum)
                {
                    frameSlider.Slider.Value = frameSlider.Slider.Maximum;
                }
                else if (frameSlider.Slider.Value < frameSlider.Slider.Minimum)
                {
                    frameSlider.Slider.Value = frameSlider.Slider.Minimum;
                }

                frameSlider.NickName = "Frames";

                frameSlider.Expression = "X * " + this.FrameTimeLast.ToString() + " + " + (this.TimeInFrame * FrameTimeLast).ToString();

                this.SliderWidth = (float)(this.MaxTime * SliderMultiple) + 20;
                this.SliderWidth = SliderWidth > 120 ? SliderWidth : 120;

                float beforeWidth = frameSlider.Attributes.Bounds.Width;


                int SliderBigger = (int)SliderWidth - frameSlider.Slider.Bounds.Width;
                frameSlider.Attributes.Bounds = new RectangleF(frameSlider.Attributes.Bounds.X, frameSlider.Attributes.Bounds.Y,
                                                               frameSlider.Attributes.Bounds.Width + SliderBigger, frameSlider.Attributes.Bounds.Height);

                float afterWidth = frameSlider.Attributes.Bounds.Width;
                float X          = frameSlider.Attributes.Pivot.X - (afterWidth - beforeWidth);
                frameSlider.Attributes.Pivot = new PointF(X, frameSlider.Attributes.Pivot.Y);

                frameSlider.OnPingDocument().DestroyAttributeCache();
                frameSlider.Attributes.ExpireLayout();
                frameSlider.Attributes.PerformLayout();

                this.Params.Input[1].Optional = false;

                return((int)frameSlider.Slider.Value);
            }

            else if (FrameObject.GetType().ToString() == "VRayForGrasshopper.VRayTimelineComponent")
            {
                this.IsInputASlider = false;
                GH_Component VrayComponent = FrameObject as GH_Component;
                SliderWidth = VrayComponent.Attributes.Bounds.Width - VrayComponent.Params.InputWidth - VrayComponent.Params.OutputWidth - 4;
                if ((VrayComponent.Params.Input[0].VolatileData.AllData(true).ElementAt(0) as GH_Integer).Value != this.MaxFrame)
                {
                    VrayComponent.Params.Input[0].VolatileData.Clear();
                    VrayComponent.Params.Input[0].AddVolatileData(new Grasshopper.Kernel.Data.GH_Path(0), 0, this.MaxFrame);
                    VrayComponent.ExpireSolution(true);
                }
                this.Params.Input[1].Optional = true;

                this.Save = false;

                int inputFrame = 0;
                DA.GetData("Current Frame", ref inputFrame);
                return(inputFrame);
            }

            else
            {
                this.AddRuntimeMessage(GH_RuntimeMessageLevel.Error, "Only NumberSlider and VrayTimeLine are allowed for Input Frame!");
                FrameObject = null;
                return(int.MinValue);
            }
        }
Beispiel #11
0
        public override GH_ObjectResponse RespondToMouseDown(GH_Canvas sender, GH_CanvasMouseEvent e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                for (int i = 0; i < dropdownlists.Count; i++)
                {
                    System.Drawing.RectangleF rec = BorderBound[i];
                    GH_Component comp             = Owner as GH_Component;
                    if (rec.Contains(e.CanvasLocation))
                    {
                        unfolded[i] = !unfolded[i];
                        comp.ExpireSolution(true);
                        return(GH_ObjectResponse.Handled);
                    }

                    if (unfolded[i])
                    {
                        System.Drawing.RectangleF rec2 = dropdownBound[i];
                        if (rec2.Contains(e.CanvasLocation))
                        {
                            for (int j = 0; j < dropdownBounds[i].Count; j++)
                            {
                                System.Drawing.RectangleF rec3 = dropdownBounds[i][j];
                                if (rec3.Contains(e.CanvasLocation))
                                {
                                    if (displayTexts[i] != dropdownlists[i][j])
                                    {
                                        // record an undo event so that user can ctrl + z
                                        comp.RecordUndoEvent("Selected " + dropdownlists[i][j]);

                                        // change the displayed text on canvas
                                        displayTexts[i] = dropdownlists[i][j];

                                        // if initial texts exists then change all dropdowns below this one to the initial description
                                        if (initialTxts != null)
                                        {
                                            for (int k = i + 1; k < dropdownlists.Count; k++)
                                            {
                                                displayTexts[k] = initialTxts[k];
                                            }
                                        }

                                        // send the selected item back to component (i = dropdownlist index, j = selected item in that list)
                                        action(i, j);

                                        // close the dropdown
                                        unfolded[i] = !unfolded[i];

                                        // recalculate component
                                        comp.ExpireSolution(true);
                                    }
                                    else
                                    {
                                        unfolded[i] = !unfolded[i];
                                        comp.ExpireSolution(true);
                                    }
                                    return(GH_ObjectResponse.Handled);
                                }
                            }
                        }
                        else
                        {
                            unfolded[i] = !unfolded[i];
                            comp.ExpireSolution(true);
                            return(GH_ObjectResponse.Handled);
                        }
                    }
                }
            }
            return(base.RespondToMouseDown(sender, e));
        }
Beispiel #12
0
        public override GH_ObjectResponse RespondToMouseDown(GH_Canvas sender, GH_CanvasMouseEvent e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                for (int i = 0; i < dropdownlists.Count; i++)
                {
                    System.Drawing.RectangleF rec = BorderBound[i];
                    GH_Component comp             = Owner as GH_Component;
                    if (rec.Contains(e.CanvasLocation))
                    {
                        unfolded[i] = !unfolded[i];
                        comp.ExpireSolution(true);
                        return(GH_ObjectResponse.Handled);
                    }

                    if (unfolded[i])
                    {
                        System.Drawing.RectangleF rec2 = dropdownBound[i];
                        if (rec2.Contains(e.CanvasLocation))
                        {
                            for (int j = 0; j < dropdownBounds[i].Count; j++)
                            {
                                System.Drawing.RectangleF rec3 = dropdownBounds[i][j];
                                if (rec3.Contains(e.CanvasLocation))
                                {
                                    if (displayTexts[i] != dropdownlists[i][j])
                                    {
                                        // record an undo event so that user can ctrl + z
                                        comp.RecordUndoEvent("Selected " + dropdownlists[i][j]);

                                        // change the displayed text on canvas
                                        displayTexts[i] = dropdownlists[i][j];

                                        // if initial texts exists then change all dropdowns below this one to the initial description
                                        if (initialTxts != null)
                                        {
                                            for (int k = i + 1; k < dropdownlists.Count; k++)
                                            {
                                                displayTexts[k] = initialTxts[k];
                                            }
                                        }

                                        // send the selected item back to component (i = dropdownlist index, j = selected item in that list)
                                        action(i, j, isTapered, isHollow, isElliptical, isGeneral, isB2B);

                                        // close the dropdown
                                        unfolded[i] = !unfolded[i];

                                        // recalculate component
                                        comp.ExpireSolution(true);
                                    }
                                    else
                                    {
                                        unfolded[i] = !unfolded[i];
                                        comp.ExpireSolution(true);
                                    }
                                    return(GH_ObjectResponse.Handled);
                                }
                            }
                        }
                        else
                        {
                            unfolded[i] = !unfolded[i];
                            comp.ExpireSolution(true);
                            return(GH_ObjectResponse.Handled);
                        }
                    }
                }

                if (displayTexts[0] == "Standard")
                {
                    GH_Component comp = Owner as GH_Component;

                    if (taperBounds.Contains(e.CanvasLocation) || taperTxtBounds.Contains(e.CanvasLocation))
                    {
                        comp.RecordUndoEvent("Toggle Taper");
                        isTapered = !isTapered;
                        action(-1, -1, isTapered, isHollow, isElliptical, isGeneral, isB2B);
                        return(GH_ObjectResponse.Handled);
                    }

                    if (hollowBounds.Contains(e.CanvasLocation) || hollowTxtBounds.Contains(e.CanvasLocation))
                    {
                        comp.RecordUndoEvent("Toggle Hollow");
                        isHollow = !isHollow;
                        action(-1, -1, isTapered, isHollow, isElliptical, isGeneral, isB2B);
                        return(GH_ObjectResponse.Handled);
                    }

                    if (ellipBounds.Contains(e.CanvasLocation) || ellipTxtBounds.Contains(e.CanvasLocation))
                    {
                        comp.RecordUndoEvent("Toggle Elliptical");
                        isElliptical = !isElliptical;
                        action(-1, -1, isTapered, isHollow, isElliptical, isGeneral, isB2B);
                        return(GH_ObjectResponse.Handled);
                    }

                    if (genBounds.Contains(e.CanvasLocation) || genTxtBounds.Contains(e.CanvasLocation))
                    {
                        comp.RecordUndoEvent("Toggle General");
                        isGeneral = !isGeneral;
                        action(-1, -1, isTapered, isHollow, isElliptical, isGeneral, isB2B);
                        return(GH_ObjectResponse.Handled);
                    }

                    if (b2bBounds.Contains(e.CanvasLocation) || b2bTxtBounds.Contains(e.CanvasLocation))
                    {
                        comp.RecordUndoEvent("Toggle BackToBack");
                        isB2B = !isB2B;
                        action(-1, -1, isTapered, isHollow, isElliptical, isGeneral, isB2B);
                        return(GH_ObjectResponse.Handled);
                    }
                }
            }
            return(base.RespondToMouseDown(sender, e));
        }
Beispiel #13
0
        /*******************************************/

        private static void GlobalSearch_ItemSelected(object sender, oM.UI.ComponentRequest request)
        {
            try
            {
                GH_Canvas canvas = GH.Instances.ActiveCanvas;

                System.Drawing.PointF location = canvas.CursorCanvasPosition;
                if (request != null && request.Location != null)
                {
                    location = new System.Drawing.Point((int)request.Location.X, (int)request.Location.Y);
                }

                Caller node = null;
                if (request != null && request.CallerType != null)
                {
                    node = Activator.CreateInstance(request.CallerType) as Caller;
                }

                bool componentCreated = false;

                if (node != null)
                {
                    string initCode = "";
                    if (request.SelectedItem != null)
                    {
                        initCode = request.SelectedItem.ToJson();
                    }

                    componentCreated = canvas.InstantiateNewObject(node.Id, initCode, canvas.CursorCanvasPosition, true);
                }
                else if (request.SelectedItem is CustomItem)
                {
                    CustomItem item = request.SelectedItem as CustomItem;
                    if (item != null && item.Content is IGH_ObjectProxy)
                    {
                        IGH_ObjectProxy proxy = item.Content as IGH_ObjectProxy;
                        componentCreated = canvas.InstantiateNewObject(proxy.Guid, canvas.CursorCanvasPosition, true);
                    }
                }

                if (componentCreated && m_LastWire != null && m_LastWire.Source != null)
                {
                    GH_Component component = canvas.Document.Objects.Last() as GH_Component;
                    if (component != null)
                    {
                        Connect(component, m_LastWire);
                    }
                    else
                    {
                        IGH_Param param = canvas.Document.Objects.Last() as IGH_Param;
                        Connect(param, m_LastWire);
                    }

                    canvas.Invalidate();
                    if (component != null)
                    {
                        component.ExpireSolution(true);
                    }
                }

                Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss") + "- Item Selected : " + ((request != null && request.CallerType != null) ? request.CallerType.Name : "null") + ((m_LastWire != null) ? ". Used wire." : ""));
            }
            catch (Exception e)
            {
                Debug.WriteLine(DateTime.Now.ToString("HH:mm:ss") + "- Error with item selection : " + e.Message);
            }

            m_LastWire = null;
        }
Beispiel #14
0
        public override GH_ObjectResponse RespondToMouseDown(GH_Canvas sender, GH_CanvasMouseEvent e)
        {
            if (e.Button == System.Windows.Forms.MouseButtons.Left)
            {
                GH_Component comp = Owner as GH_Component;

                if (xTxtBounds1.Contains(e.CanvasLocation) | xBounds1.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle X1");
                    x1 = !x1;
                    update(x1, y1, z1, xx1, yy1, zz1, x2, y2, z2, xx2, yy2, zz2);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (yTxtBounds1.Contains(e.CanvasLocation) | yBounds1.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle Y1");
                    y1 = !y1;
                    update(x1, y1, z1, xx1, yy1, zz1, x2, y2, z2, xx2, yy2, zz2);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (zTxtBounds1.Contains(e.CanvasLocation) | zBounds1.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle Z1");
                    z1 = !z1;
                    update(x1, y1, z1, xx1, yy1, zz1, x2, y2, z2, xx2, yy2, zz2);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (xxTxtBounds1.Contains(e.CanvasLocation) | xxBounds1.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle XX1");
                    xx1 = !xx1;
                    update(x1, y1, z1, xx1, yy1, zz1, x2, y2, z2, xx2, yy2, zz2);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (yyTxtBounds1.Contains(e.CanvasLocation) | yyBounds1.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle YY1");
                    yy1 = !yy1;
                    update(x1, y1, z1, xx1, yy1, zz1, x2, y2, z2, xx2, yy2, zz2);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (zzTxtBounds1.Contains(e.CanvasLocation) | zzBounds1.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle ZZ1");
                    zz1 = !zz1;
                    update(x1, y1, z1, xx1, yy1, zz1, x2, y2, z2, xx2, yy2, zz2);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }

                if (xTxtBounds2.Contains(e.CanvasLocation) | xBounds2.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle X2");
                    x2 = !x2;
                    update(x1, y1, z1, xx1, yy1, zz1, x2, y2, z2, xx2, yy2, zz2);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (yTxtBounds2.Contains(e.CanvasLocation) | yBounds2.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle Y2");
                    y2 = !y2;
                    update(x1, y1, z1, xx1, yy1, zz1, x2, y2, z2, xx2, yy2, zz2);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (zTxtBounds2.Contains(e.CanvasLocation) | zBounds2.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle Z2");
                    z2 = !z2;
                    update(x1, y1, z1, xx1, yy1, zz1, x2, y2, z2, xx2, yy2, zz2);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (xxTxtBounds2.Contains(e.CanvasLocation) | xxBounds2.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle XX2");
                    xx2 = !xx2;
                    update(x1, y1, z1, xx1, yy1, zz1, x2, y2, z2, xx2, yy2, zz2);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (yyTxtBounds2.Contains(e.CanvasLocation) | yyBounds2.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle YY2");
                    yy2 = !yy2;
                    update(x1, y1, z1, xx1, yy1, zz1, x2, y2, z2, xx2, yy2, zz2);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
                if (zzTxtBounds2.Contains(e.CanvasLocation) | zzBounds2.Contains(e.CanvasLocation))
                {
                    comp.RecordUndoEvent("Toggle ZZ2");
                    zz2 = !zz2;
                    update(x1, y1, z1, xx1, yy1, zz1, x2, y2, z2, xx2, yy2, zz2);
                    comp.ExpireSolution(true);
                    return(GH_ObjectResponse.Handled);
                }
            }
            return(base.RespondToMouseDown(sender, e));
        }