Exemplo n.º 1
0
        public override void AppendAdditionalMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            ToolStripMenuItem toolStripMenuItem = GH_DocumentObject.Menu_AppendItem(menu, "Create Accent List", createAccentList);

            toolStripMenuItem.ToolTipText = "Click this to create a pre-populated list of available accent colors.";
            base.AppendAdditionalMenuItems(menu);
        }
Exemplo n.º 2
0
        public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
        {
            base.AppendAdditionalMenuItems(menu);

            OptionalPropDropdown = GH_DocumentObject.Menu_AppendItem(menu, "Overwrite Custom Properties");
            OptionalPropDropdown.DropDownItems.AddRange(OptionalPropsItems.ToArray());
            OptionalPropDropdown.DropDown.Closing += (sender, e) =>
            {
                if (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked)
                {
                    e.Cancel = true;
                }
            };

            Menu_AppendSeparator(menu);

            var subMenus   = new Dictionary <Assembly, ToolStripDropDownMenu>();
            var types      = SpeckleCore.SpeckleInitializer.GetTypes();
            var assemblies = SpeckleCore.SpeckleInitializer.GetAssemblies().Where(ass => types.Any(t => t.Assembly == ass));

            foreach (Assembly assembly in assemblies)
            {
                menu.Items.Add(assembly.GetName().Name);
                var addedMenuItem = menu.Items[menu.Items.Count - 1];

                subMenus[assembly] = ( ToolStripDropDownMenu )addedMenuItem.GetType().GetProperty("DropDown").GetValue(addedMenuItem);
            }

            foreach (Type type in types)
            {
                subMenus[type.Assembly].Items.Add(type.Name, null, (sender, e) => SwitchToType(type));
            }
        }
Exemplo n.º 3
0
        /*******************************************/

        private void AppendMenuHintItems(ToolStripDropDown menu)
        {
            ToolStripMenuItem hintItem = GH_DocumentObject.Menu_AppendItem(menu, "Type hint");

            foreach (IGH_TypeHint type in PossibleHints)
            {
                if (type != null)
                {
                    if (type is GH_HintSeparator)
                    {
                        GH_DocumentObject.Menu_AppendSeparator(hintItem.DropDown);
                    }
                    else if (!string.IsNullOrEmpty(type.TypeName))
                    {
                        bool @checked = false;
                        if (SelectedHint != null)
                        {
                            @checked = type.HintID == SelectedHint.HintID;
                        }
                        ToolStripMenuItem item = GH_DocumentObject.Menu_AppendItem(hintItem.DropDown, type.TypeName, TypeSelected, true, @checked);
                        item.Tag = type;
                    }
                }
            }
        }
Exemplo n.º 4
0
        // append additional items in menu
        public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
        {
            menu.Items.Add("Histogram", null, menuItemHisto);
            menu.Items.Add("Smooth", null, menuItemSmooth);
            // Rui
            // additional dropdown menu for custom PD
            ToolStripMenuItem PDDropdown = GH_DocumentObject.Menu_AppendItem(menu, "Custom PD");

            string displayText = "";

            for (int i = 0; i < this.Probabilities.Count; i++)
            {
                displayText += this.Probabilities[i].ToString();
                if (i != this.Probabilities.Count - 1)
                {
                    displayText += " , ";
                }
            }

            Menu_AppendTextItem(PDDropdown.DropDown,
                                displayText,
                                null,
                                new GH_MenuTextBox.TextChangedEventHandler(updatePD),
                                true);

            PDDropdown.DropDown.Items[1].Click += (obj, e) => OK_Click(obj, e);
            PDDropdown.DropDown.Items[2].Click += (obj, e) => Cancel_Click(obj, e);

            base.AppendAdditionalMenuItems(menu);
        }
Exemplo n.º 5
0
        public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
        {
            ToolStripMenuItem item2 = Menu_AppendItem(menu, "暴力解密", Menu_AbsoluteClicked2, true, Absolute2);

            // Specifically assign a tooltip text to the menu item.
            item2.ToolTipText = "暴力破解,针对不能双击的打包电池.";



            //  base.AppendAdditionalMenuItems(menu);
            // ToolStripMenuItem item = Menu_AppendItem(menu, "Absolute", Menu_AbsoluteClicked,true);
            // Specifically assign a tooltip text to the menu item.
            // item.ToolTipText = "When checked, values are made absolute prior to sorting.";


            GH_DocumentObject.Menu_AppendItem(menu, "Feature Type:", new EventHandler(this.FeatureType_Clicked));
            this.tsComboBox = new ToolStripComboBox();
            this.tsComboBox.ComboBox.DropDownStyle         = ComboBoxStyle.DropDownList;
            this.tsComboBox.ComboBox.BindingContext        = new BindingContext();
            this.tsComboBox.ComboBox.Width                 = 230;
            this.tsComboBox.ComboBox.DataSource            = this.featureTypes;
            this.tsComboBox.ComboBox.SelectedIndexChanged += this.Feature_SelectedIndexChanged;
            this.tsComboBox.ComboBox.SelectedIndex         = this.featureTypes.IndexOf("aerialway");
            menu.Items.Add(this.tsComboBox);

            //       GH_DocumentObject.Menu_AppendItem(menu, "Fuzzy Blobs", new EventHandler(this.Menu_FuzzySpriteClicked), true, this.m_spriteType == 0);
            //         GH_DocumentObject.Menu_AppendItem(menu, "Blurry Blobs", new EventHandler(this.Menu_BlurrySpriteClicked), true, this.m_spriteType == 1);
        }
Exemplo n.º 6
0
        protected override void AppendAdditionComponentMenuItems(ToolStripDropDown menu)
        {
            ToolStripMenuItem exceptionsItem = new ToolStripMenuItem(GetTransLation(new string[] { "Exceptions", "除去项" }), Properties.Resources.ExceptionIcon, exceptionClick);

            exceptionsItem.ToolTipText = GetTransLation(new string[] { "Except for the following selected component.", "除了以下选中的运算器。" });
            exceptionsItem.Font        = GH_FontServer.StandardBold;
            exceptionsItem.ForeColor   = Color.FromArgb(19, 34, 122);

            void exceptionClick(object sender, EventArgs e)
            {
                CreateWindow();
            }

            menu.Items.Add(exceptionsItem);

            GH_DocumentObject.Menu_AppendSeparator(menu);

            WinFormPlus.AddNumberBoxItem(menu, this, GetTransLation(new string[] { "Set Name FontSize", "设置命名字体大小" }), GetTransLation(new string[] { "Set the name box's font size.", "设置名称气泡框的字体大小。" }),
                                         ArchiTed_Grasshopper.Properties.Resources.TextIcon, true, _nameBoxFontSizeDefault, 4, 50, _nameBoxFontSize);

            WinFormPlus.ItemSet <Color>[] sets = new WinFormPlus.ItemSet <Color>[] {
                new WinFormPlus.ItemSet <Color>(GetTransLation(new string[] { "Text Color", "文字颜色" }), GetTransLation(new string[] { "Adjust text color.", "调整文字颜色。" }),
                                                null, true, _textColorDefault, _textColor),

                new WinFormPlus.ItemSet <Color>(GetTransLation(new string[] { "Background Color", "背景颜色" }), GetTransLation(new string[] { "Adjust background color.", "调整背景颜色。" }),
                                                null, true, _backgroundColorDefault, _backgroundColor),

                new WinFormPlus.ItemSet <Color>(GetTransLation(new string[] { "Boundary Color", "边框颜色" }),
                                                GetTransLation(new string[] { "Adjust boundary color.", "调整边框颜色。" }), null, true,
                                                _boundaryColorDefault, _boundaryColor),
            };
            WinFormPlus.AddColorBoxItems(menu, this, GetTransLation(new string[] { "Colors", "颜色" }),
                                         GetTransLation(new string[] { "Adjust color.", "调整颜色。" }), ArchiTed_Grasshopper.Properties.Resources.ColorIcon, true, sets);
        }
Exemplo n.º 7
0
 public static void SetMenuToggle(GH_DocumentObject obj, ToolStrip menu, string name, Func <bool> getValue, Action <bool> setValue)
 {
     GH_DocumentObject.Menu_AppendItem(menu, name, (s, e) => {
         obj.RecordUndoEvent($"Change {name}");
         setValue(!getValue());
         obj.ExpireSolution(true);
     }, true, getValue());
 }
Exemplo n.º 8
0
 public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
 {
     base.AppendAdditionalMenuItems(menu);
     GH_DocumentObject.Menu_AppendItem(menu, @"Save current state", (sender, e) =>
     {
         mySender.saveToHistory();
     });
 }
Exemplo n.º 9
0
        public override void AppendAdditionalMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            ToolStripMenuItem maintainItem = GH_DocumentObject.Menu_AppendItem(menu, "Toggle Maintain Path", new EventHandler(this.Menu_MaintainPath), true);
            //base.AppendAdditionalMenuItems(menu);
            ToolStripMenuItem sortItem = GH_DocumentObject.Menu_AppendItem(menu, "Toggle Sort By Tree Order", new EventHandler(this.Menu_SortIndex), true);

            base.AppendAdditionalMenuItems(menu);
        }
Exemplo n.º 10
0
 protected override void AppendAdditionalComponentMenuItems(ToolStripDropDown menu)
 {
     base.AppendAdditionalComponentMenuItems(menu);
     GH_DocumentObject.Menu_AppendItem(menu, @"Save current configuration as default", (sender, e) =>
     {
         //mySender.StreamCustomUpdate(this.NickName, GetLayers(), GetData());
     });
 }
Exemplo n.º 11
0
        protected override void AppendAdditionalComponentMenuItems(ToolStripDropDown menu)
        {
            ToolStripMenuItem item  = GH_DocumentObject.Menu_AppendItem(menu, "Areas", new EventHandler(this.Menu_AreaClicked), true, this.areaMode == AreaMode.Areas);
            ToolStripMenuItem item2 = GH_DocumentObject.Menu_AppendItem(menu, "Rooms", new EventHandler(this.Menu_RoomClicked), true, this.areaMode == AreaMode.Rooms);

            item.ToolTipText  = "Create Revit Areas.";
            item2.ToolTipText = "Create Revit Rooms.";
        }
Exemplo n.º 12
0
        public SunglassesMenuItem()
            : base("Sunglasses", Properties.Resources.sunglasses, ClickHandler)
        {
            Name        = "SunglassesMenuItem";
            Size        = new Size(200, 30);
            ToolTipText = "Draw the name above the component, so that it can be used in icon mode.";
            Checked     = Settings.DisplayNames;
            //var slider = new GH_DigitScroller
            //{
            //    MinimumValue = 3,
            //    MaximumValue = 256,
            //    DecimalPlaces = 1,
            //    Value = (decimal)Settings.FontSize,
            //    Size = new Size(200, 24)
            //};
            //slider.ValueChanged += Slider_ValueChanged;
            //GH_DocumentObject.Menu_AppendCustomItem(DropDown, slider);
            GH_DocumentObject.Menu_AppendItem(DropDown, "Select font", SelectFontHandler);

            GH_DocumentObject.Menu_AppendItem(DropDown, "Display nicknames",
                                              DisplayNicknamesHandler, true, Settings.DisplayNicknames)
            .ToolTipText = "Draw the nickname instead of the name of the objects.";

            GH_DocumentObject.Menu_AppendItem(DropDown, "Hide on low zoom",
                                              HideOnLowZoomHandler, true, Settings.HideOnLowZoom)
            .ToolTipText = "If checked, the name disappears when the canvas zoom is very low.";

            var filter = GH_DocumentObject.Menu_AppendItem(DropDown, "Filter objects");

            filter.ToolTipText = "Select in which objects to draw the name.";

            GH_DocumentObject.Menu_AppendItem(filter.DropDown, "Components", FilterComponentHandler, true, Settings.FilterComponents)
            .ToolTipText = "If checked, draw the name of components.";
            GH_DocumentObject.Menu_AppendItem(filter.DropDown, "Parameters", FilterParameterHandler, true, Settings.FilterParameters)
            .ToolTipText = "If checked, draw the name of parameters.";
            GH_DocumentObject.Menu_AppendItem(filter.DropDown, "Special", FilterSpecialHandler, true, Settings.FilterSpecial)
            .ToolTipText = "If checked, draw the name of special objects, like Number Slider, Panel, Gradient...";
            GH_DocumentObject.Menu_AppendItem(filter.DropDown, "Graphics", FilterGraphicHandler, true, Settings.FilterGraphic)
            .ToolTipText = "If checked, draw the name of graphic objects, like Group, Scribble, Jump...";
            var customFilter = GH_DocumentObject.Menu_AppendItem(filter.DropDown, "Exclusions");

            customFilter.ToolTipText = "Insert the names of the objects, separated by commas, that you want to exclude.";
            //GH_DocumentObject.Menu_AppendTextItem(customFilter.DropDown, Utils.FilterCustom, FilterCustomKeyDownHandler, FilterCustomTextChangedHandler, true);
            var textBox = new ToolStripTextBox()
            {
                Size        = new Size(200, 24),
                Text        = Settings.FilterCustom,
                BorderStyle = BorderStyle.FixedSingle
            };

            textBox.TextChanged += TextBox_TextChanged;
            customFilter.DropDownItems.Add(textBox);

            GH_DocumentObject.Menu_AppendSeparator(DropDown);
            var riched = GH_DocumentObject.Menu_AppendItem(DropDown, "Riched capsules", DisplayRichedAttributesHandler, true, Settings.DisplayRichedCapsules);

            riched.ToolTipText = "Shows all the information within a component when zoomed in. ";
        }
Exemplo n.º 13
0
        public static void AddComboBoxItemMulty(ToolStripDropDown menu, LanguagableComponent component, ItemSet <bool> set)
        {
            GH_DocumentObject.Menu_AppendItem(menu, set.itemName, click, set.itemIcon, set.enable, component.GetValuePub(set.valueName, set.Default)).ToolTipText = set.itemTip;

            void click(object sender, EventArgs e)
            {
                component.SetValuePub(set.valueName, true);
            }
        }
Exemplo n.º 14
0
 protected override void AppendAdditionalComponentMenuItems(ToolStripDropDown menu)
 {
     GH_DocumentObject.Menu_AppendItem(menu, "Click Action:");
     GH_DocumentObject.Menu_AppendItem(menu, "None", NoneClicked, true, clickMode == ClickableShapeGrid.ClickMode.None);
     GH_DocumentObject.Menu_AppendItem(menu, "Button Mode", ButtonModeClicked, true, clickMode == ClickableShapeGrid.ClickMode.ButtonMode);
     GH_DocumentObject.Menu_AppendItem(menu, "Toggle Mode", ToggleModeClicked, true, clickMode == ClickableShapeGrid.ClickMode.ToggleMode);
     GH_DocumentObject.Menu_AppendItem(menu, "Picker Mode", PickerModeClicked, true, clickMode == ClickableShapeGrid.ClickMode.PickerMode);
     base.AppendAdditionalComponentMenuItems(menu);
 }
Exemplo n.º 15
0
        protected override void AppendAdditionalComponentMenuItems(ToolStripDropDown menu)
        {
            GH_DocumentObject.Menu_AppendTextItem(menu, "Time step in ms", null, null, false, 0, false);
            var timeStep = GH_DocumentObject.Menu_AppendTextItem(menu, timestep.ToString(), null, Menu_SetSteps, false);;

            timeStep.ToolTipText = "Root Mode Steps";

            menu.Closed += contextMenuStrip_Closing;
        }
Exemplo n.º 16
0
        protected override void AppendAdditionalComponentMenuItems(ToolStripDropDown menu)
        {
            base.AppendAdditionalComponentMenuItems(menu);

            var timeStepItem = GH_DocumentObject.Menu_AppendTextItem(menu, timeStep.ToString(), null, timeStepUpdate, false);

            timeStepItem.ToolTipText = "Time step for iterations";
            timeStepItem.Tag         = "timestep";
        }
Exemplo n.º 17
0
        public static void AddComboBoxItemSingle(ToolStripDropDown menu, LanguagableComponent component, ItemSet <bool> set, string valueName, int index)
        {
            GH_DocumentObject.Menu_AppendItem(menu, set.itemName, click, set.itemIcon, set.enable, component.GetValuePub(valueName, 0) == index).ToolTipText = set.itemTip;

            void click(object sender, EventArgs e)
            {
                component.SetValuePub(valueName, index);
            }
        }
Exemplo n.º 18
0
        public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
        {
            //IL_01f1: Unknown result type (might be due to invalid IL or missing references)
            //IL_01f8: Expected O, but got Unknown
            //IL_02c4: Unknown result type (might be due to invalid IL or missing references)
            //IL_02cb: Expected O, but got Unknown
            base.AppendAdditionalMenuItems(menu);
            bool flag = false;

            if (Container != null)
            {
                flag = Container.LockGrips;
            }
            GH_DocumentObject.Menu_AppendItem((ToolStrip)menu, "Locked", (EventHandler)Menu_LockClicked, Graph != null, flag);
            GH_DocumentObject.Menu_AppendItem((ToolStrip)menu, "Default", (EventHandler)Menu_DefaultClicked, Graph != null, false);
            GH_DocumentObject.Menu_AppendItem((ToolStrip)menu, "Remap", (EventHandler)Menu_RemapClicked, true, RemapToTarget).ToolTipText = "Remap output values to target domain";
            GH_DocumentObject.Menu_AppendItem((ToolStrip)menu, "Draw domains", (EventHandler)Menu_DrawDomainsClicked, Graph != null, ((RichGraphMapperAttributes)(object)((GH_DocumentObject)this).Attributes).DrawDomainsTags);
            IList <GH_GraphProxy> graphProxies      = Instances.ComponentServer.GraphProxies;
            ToolStripMenuItem     toolStripMenuItem = GH_DocumentObject.Menu_AppendItem((ToolStrip)menu, "Graph types");

            GH_DocumentObject.Menu_AppendItem((ToolStrip)toolStripMenuItem.DropDown, "None", (EventHandler)Menu_NoGraphItemClicked, true, Graph == null);
            Guid a = Guid.Empty;
            InterpolatedGraph interpolatedGraph = new InterpolatedGraph();
            PolylineGraph     polylineGraph     = new PolylineGraph();

            if (Graph != null)
            {
                a = Graph.GraphTypeID;
            }
            foreach (GH_GraphProxy item in graphProxies)
            {
                if (!(item.GUID == ((GH_AbstractGraph)interpolatedGraph).GraphTypeID) && !(item.GUID == ((GH_AbstractGraph)polylineGraph).GraphTypeID))
                {
                    ToolStripMenuItem toolStripMenuItem2 = GH_DocumentObject.Menu_AppendItem((ToolStrip)toolStripMenuItem.DropDown, item.Name, (EventHandler)Menu_GraphTypeItemClicked, item.Icon, true, a == item.GUID);
                    toolStripMenuItem2.Tag = item.GUID;
                }
            }
            GH_GraphProxy     val = (GH_GraphProxy)(object)new GH_GraphProxy((IGH_Graph)(object)interpolatedGraph, typeof(InterpolatedGraph));
            ToolStripMenuItem toolStripMenuItem3 = GH_DocumentObject.Menu_AppendItem((ToolStrip)toolStripMenuItem.DropDown, val.Name, (EventHandler)Menu_FreeFormGraphClicked, val.Icon, true, a == val.GUID);

            toolStripMenuItem3.Tag = 5;
            for (int i = 3; i <= 10; i++)
            {
                ToolStripMenuItem toolStripMenuItem4 = GH_DocumentObject.Menu_AppendItem((ToolStrip)toolStripMenuItem3.DropDown, val.Name + " " + i + " points", (EventHandler)Menu_FreeFormGraphClicked, val.Icon, true, false);
                toolStripMenuItem4.Tag = i;
            }
            val = (GH_GraphProxy)(object)new GH_GraphProxy((IGH_Graph)(object)polylineGraph, typeof(PolylineGraph));
            ToolStripMenuItem toolStripMenuItem5 = GH_DocumentObject.Menu_AppendItem((ToolStrip)toolStripMenuItem.DropDown, val.Name, (EventHandler)Menu_PolylineGraphClicked, val.Icon, true, a == val.GUID);

            toolStripMenuItem5.Tag = 5;
            for (int j = 3; j <= 10; j++)
            {
                ToolStripMenuItem toolStripMenuItem6 = GH_DocumentObject.Menu_AppendItem((ToolStrip)toolStripMenuItem5.DropDown, val.Name + " " + j + " points", (EventHandler)Menu_PolylineGraphClicked, val.Icon, true, false);
                toolStripMenuItem6.Tag = j;
            }
        }
Exemplo n.º 19
0
        protected override void AppendAdditionalComponentMenuItems(ToolStripDropDown menu)
        {
            ToolStripMenuItem item  = GH_DocumentObject.Menu_AppendItem(menu, "Ref Points", new EventHandler(this.Menu_PointsClicked), true, this.loftMode == LoftMode.Points);
            ToolStripMenuItem item2 = GH_DocumentObject.Menu_AppendItem(menu, "Lines", new EventHandler(this.Menu_LinesClicked), true, this.loftMode == LoftMode.Lines);
            ToolStripMenuItem item3 = GH_DocumentObject.Menu_AppendItem(menu, "Surface", new EventHandler(this.Menu_LoftClicked), true, this.loftMode == LoftMode.Loft);

            item.ToolTipText  = "Create Revit Reference Points";
            item2.ToolTipText = "Create Revit Curve by Points";
            item3.ToolTipText = "Create Revit Surface by Curves on Points";
        }
Exemplo n.º 20
0
 /// <summary>
 /// Adds the button style options to the component right-click menu.
 /// </summary>
 /// <param name="menu"></param>
 protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
 {
     System.Windows.Forms.ToolStripMenuItem toolStripMenuItem = GH_DocumentObject.Menu_AppendItem(menu, "Default Style", new System.EventHandler(this.menu_makeDefaultStyle), true, bs == buttonStyle.Default);
     toolStripMenuItem.ToolTipText = "Use the default button style.";
     System.Windows.Forms.ToolStripMenuItem toolStripMenuItem1 = GH_DocumentObject.Menu_AppendItem(menu, "Square Style", new System.EventHandler(this.menu_makeSquareStyle), true, bs == buttonStyle.Square);
     toolStripMenuItem1.ToolTipText = "Use a flat, square button style.";
     System.Windows.Forms.ToolStripMenuItem toolStripMenuItem2 = GH_DocumentObject.Menu_AppendItem(menu, "Circle Style", new System.EventHandler(this.menu_makeCircleStyle), true, bs == buttonStyle.Circle);
     toolStripMenuItem2.ToolTipText = "Use a circle (or ellipse) button style.";
     System.Windows.Forms.ToolStripMenuItem toolStripMenuItem3 = GH_DocumentObject.Menu_AppendItem(menu, "Borderless Style", new System.EventHandler(this.menu_makeBorderless), true, bs == buttonStyle.Borderless);
     toolStripMenuItem3.ToolTipText = "Use a borderless button style.";
 }
Exemplo n.º 21
0
        private void AddAnItem(ToolStripMenuItem menu, int i)
        {
            GH_DocumentObject.Menu_AppendItem(menu.DropDown, viewList[i].Name, viewClick, true, GetValue("View" + i.ToString(), false))
            .ToolTipText = GetTransLation(new string[] { "Click to go to view " + viewList[i].Name, "点击以跳转至视图" + viewList[i].Name });

            void viewClick(object sender, EventArgs e)
            {
                viewIndex = i;
                Update();
            }
        }
        public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
        {
            base.AppendAdditionalMenuItems(menu);
            ToolStripMenuItem mItem = GH_DocumentObject.Menu_AppendItem(menu, "Modify Main Model", new EventHandler(this.Menu_MainModelClicked),
                                                                        true, GrasshopperManager.Instance.AutoBake);

            mItem.ToolTipText =
                "If checked, Salamander Grasshopper components will automatically bake to and update the primary Salamander model.  " + Environment.NewLine +
                "Otherwise, changes will be written only to a temporary background model and will not have an effect on the main " + Environment.NewLine
                + "model.  This is a global setting which applies to *all* Salamander components in the document.";
        }
Exemplo n.º 23
0
        /// <summary>
        /// Adds to the context menu an option to create a pre-populated list of common REST Raster sources
        /// </summary>
        /// <param name="menu"></param>
        /// https://discourse.mcneel.com/t/generated-valuelist-not-working/79406/6?u=hypar
        public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
        {
            var           rasterSourcesJson = rasterJson["REST Raster"].Select(x => x["source"]).Distinct();
            List <string> rasterSources     = rasterSourcesJson.Values <string>().ToList();

            foreach (var src in rasterSourcesJson)
            {
                ToolStripMenuItem root = GH_DocumentObject.Menu_AppendItem(menu, "Create " + src.ToString() + " Source List", CreateRasterList);
                root.ToolTipText = "Click this to create a pre-populated list of some " + src.ToString() + " sources.";
                base.AppendAdditionalMenuItems(menu);
            }
        }
Exemplo n.º 24
0
        protected override void AppendAdditionalComponentMenuItems(ToolStripDropDown menu)
        {
            ToolStripMenuItem item  = GH_DocumentObject.Menu_AppendItem(menu, "Detail Lines", new EventHandler(this.Menu_DetailClicked), true, this.lineMode == LineMode.DetailLine);
            ToolStripMenuItem item2 = GH_DocumentObject.Menu_AppendItem(menu, "Model Lines", new EventHandler(this.Menu_ModelClicked), true, this.lineMode == LineMode.ModelLine);
            ToolStripMenuItem item3 = GH_DocumentObject.Menu_AppendItem(menu, "Area Boundary Lines", new EventHandler(this.Menu_AreaClicked), true, this.lineMode == LineMode.AreaBoundLine);
            ToolStripMenuItem item4 = GH_DocumentObject.Menu_AppendItem(menu, "Room Separation Lines", new EventHandler(this.Menu_RoomClicked), true, this.lineMode == LineMode.RoomSepLine);

            item.ToolTipText  = "Create Revit Detail Lines.  This will project lines to current view's workplane.";
            item2.ToolTipText = "Create Revit Model Lines";
            item3.ToolTipText = "Create Revit Area Boundary Lines";
            item4.ToolTipText = "Create Revit Room Separation Lines";
        }
Exemplo n.º 25
0
        protected override void AppendAdditionalComponentMenuItems(ToolStripDropDown menu)
        {
            ToolStripMenuItem item  = GH_DocumentObject.Menu_AppendItem(menu, "Architectural", new EventHandler(this.Menu_ArchClicked), true, this.colMode == ColMode.Arch);
            ToolStripMenuItem item2 = GH_DocumentObject.Menu_AppendItem(menu, "Structural Vertical", new EventHandler(this.Menu_StrucVertClicked), true, this.colMode == ColMode.StrucVert);
            ToolStripMenuItem item3 = GH_DocumentObject.Menu_AppendItem(menu, "Structural EndPoints", new EventHandler(this.Menu_StrucPointClicked), true, this.colMode == ColMode.StrucPoint);
            ToolStripMenuItem item4 = GH_DocumentObject.Menu_AppendItem(menu, "Structural By Angle", new EventHandler(this.Menu_StrucAngleClicked), true, this.colMode == ColMode.StrucAngle);

            item.ToolTipText  = "Create Revit Architectural Columns";
            item2.ToolTipText = "Create Revit Structural Columns, Defined vertically from start point";
            item3.ToolTipText = "Create Revit Structural Columns, Defined by start and end points";
            item4.ToolTipText = "Create Revit Structural Columns, Defined from start point and angle";
        }
Exemplo n.º 26
0
        /*******************************************/
        /**** Override Methods                  ****/
        /*******************************************/

        public override void AppendAdditionalMenuItems(ToolStripDropDown menu)
        {
            base.AppendAdditionalMenuItems(menu);
            if (Kind != GH_ParamKind.output)
            {
                GH_DocumentObject.Menu_AppendItem(menu, "Item Access", ItemAccessClicked, Resources.ItemAccess, true, Access == GH_ParamAccess.item);
                GH_DocumentObject.Menu_AppendItem(menu, "List Access", ListAccessClicked, Resources.ListAccess, true, Access == GH_ParamAccess.list);
                GH_DocumentObject.Menu_AppendItem(menu, "Tree Access", TreeAccessClicked, Resources.TreeAccess, true, Access == GH_ParamAccess.tree);

                AppendMenuHintItems(menu);
            }
        }
        // Create right-click menu item for show-label
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            System.Windows.Forms.ToolStripMenuItem ShowLabelMenuItem = GH_DocumentObject.Menu_AppendItem(menu, "Show Label", new EventHandler(this.Menu_ShowLabelClicked), true, showLabel);
            ShowLabelMenuItem.ToolTipText = "When checked, the UI Element will include the supplied label.";

            System.Windows.Forms.ToolStripMenuItem EnterListenerMenuItem = GH_DocumentObject.Menu_AppendItem(menu, "Use Enter to submit", new EventHandler(this.Menu_EnterEventClicked), true, enterEvent);
            ShowLabelMenuItem.ToolTipText = "If checked, the text will be submitted when Enter key is pressed.";
            if (!enterMenuEnabled)
            {
                EnterListenerMenuItem.Enabled = false;
                EnterListenerMenuItem.Checked = true;
            }
        }
        protected virtual void AppendContactMenuItems(ToolStripMenuItem menu)
        {
            WinFormPlus.AddMessageBoxItem(menu, GetTransLation(new string[] { "InfoGlasses QQ Group", "InfoGlasses QQ交流群" }),
                                          GetTransLation(new string[] { "Click to contact us in InfoGlasses QQ Group!", "点击以加入InfoGlasses QQ交流群。" }), Properties.Resources.QQLogo, Properties.Resources.InfoGlasses_QQGroup_QRcode);

            WinFormPlus.AddMessageBoxItem(menu, GetTransLation(new string[] { "Bright Zone of Rhino QQ Group", "犀牛之光 QQ交流群" }),
                                          GetTransLation(new string[] { "Click to contact us in Bright Zone of Rhino QQ Group!", "点击以加入犀牛之光 QQ交流群。" }), Properties.Resources.QQLogo, Properties.Resources.BrightZoneOfRhino_QQGroup_QRcode);

            GH_DocumentObject.Menu_AppendSeparator(menu.DropDown);

            WinFormPlus.AddMessageBoxItem(menu, GetTransLation(new string[] { "Parameterization QQ Group", "参数化交流 QQ群" }),
                                          GetTransLation(new string[] { "Click to contact us in Parameterization QQ Group!", "点击以加入参数化交流 QQ群。" }), Properties.Resources.QQLogo, Properties.Resources.Parameterization_QQGroup_QRcode);
        }
Exemplo n.º 29
0
        public static void AddTextItem(ToolStripDropDown menu, LanguagableComponent component, string itemName, string itemTip, Bitmap itemIcon, bool enable,
                                       string Default, string valueName, int width = 100)
        {
            bool flag = true;

            GH_DocumentObject.Menu_AppendTextItem(menu, itemName, BoxItemKeyDown, textchanged, true, width, true);
            void textchanged(GH_MenuTextBox sender, string newText)
            {
                component.SetValuePub(valueName, newText, flag);
                flag = false;
                component.ExpireSolution(true);
            }
        }
Exemplo n.º 30
0
 /// <summary>
 /// Add options for tick marks, the value readout, and tooltips to the component Menu.
 /// </summary>
 protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
 {
     System.Windows.Forms.ToolStripMenuItem ticksMenuItem = GH_DocumentObject.Menu_AppendItem(menu, "Enable Ticks", new System.EventHandler(this.menu_enableTicks), true, showTicks);
     ticksMenuItem.ToolTipText = "Display ticks below the slider.";
     System.Windows.Forms.ToolStripMenuItem tooltipMenuItem = GH_DocumentObject.Menu_AppendItem(menu, "Enable Tooltip", new System.EventHandler(this.menu_enableTooltip), true, showTooltip);
     tooltipMenuItem.ToolTipText = "Display a tooltip above the slider displaying the value.";
     System.Windows.Forms.ToolStripMenuItem valueLabelMenuItem = GH_DocumentObject.Menu_AppendItem(menu, "Enable Value Label", new System.EventHandler(this.menu_enableValueLabel), true, showValueReadout);
     valueLabelMenuItem.ToolTipText = "Display a label to the right of the slider showing its current value.";
     System.Windows.Forms.ToolStripMenuItem showBoundsMenuItem = GH_DocumentObject.Menu_AppendItem(menu, "Show Slider Limits", new System.EventHandler(this.menu_showBounds), true, showBounds);
     showBoundsMenuItem.ToolTipText = "Display a label to the right of the slider showing its current value.";
     System.Windows.Forms.ToolStripMenuItem showLabelMenuItem = GH_DocumentObject.Menu_AppendItem(menu, "Show Label", new EventHandler(this.Menu_ShowLabelClicked), true, showLabel);
     showLabelMenuItem.ToolTipText = "When checked, the UI Element will include the supplied label.";
 }