コード例 #1
0
ファイル: EtoTextBox.cs プロジェクト: visualizor/GH_Eto
 public override void AppendAdditionalMenuItems(wf.ToolStripDropDown menu)
 {
     base.AppendAdditionalMenuItems(menu);
     wf.ToolStripMenuItem mi = menu.Items.Add("Live", null, OnLive) as wf.ToolStripMenuItem;
     mi.Checked     = live;
     mi.ToolTipText = "check to update on every key stroke\nthis property may be overriden with P/V parameter inputs";
 }
コード例 #2
0
ファイル: ComboBoxEx.cs プロジェクト: camalot/droidexplorer
        public void AddControl( IComboBoxExtender child )
        {
            try {
            childControl = child;
            childControl.SetUserInterface ( );
            treeViewHost = new ToolStripControlHost ( childControl as Control );
            treeViewHost.Visible = false;
            CloseComboBoxExtenderHandler closeCombo = new CloseComboBoxExtenderHandler ( CloseComboBox );
            childControl.CloseComboBoxExtenderDelegate = closeCombo;

            dropDown = new ToolStripDropDown ( );
            dropDown.Items.Add ( treeViewHost );
            dropDown.AutoClose = true;

            this.DropDownStyle = ComboBoxStyle.DropDownList;

            dropDown.Closed += new ToolStripDropDownClosedEventHandler ( DropDownClosed );
            this.EnabledChanged += new EventHandler ( ExtenderCombo_EnabledChanged );

            closeCombo ( );

              } catch ( Exception ex ) {
            MessageBox.Show ( ex.Message );
              }
        }
コード例 #3
0
        public override void AppendAdditionalMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            //base.AppendAdditionalMenuItems(menu);
            ToolStripMenuItem toolStripMenuItem = Menu_AppendItem(menu, "Animate", new EventHandler(this.Menu_AnimateClicked), true, GetValue("Animate", false));

            toolStripMenuItem.ToolTipText = "Preview the mesh construction process.";
        }
コード例 #4
0
        public LayerManagerPanel()
        {
            InitializeComponent();

            // Create other command
            var control = new LayerControl();
            control.ControlsClicked += LayerCommand_ControlsClicked;
            // Add to dropdown list
            var dropdown = new ToolStripDropDown();
            dropdown.Items.Add(new ToolStripControlHost(control));
            btnLayer.DropDown = dropdown;

            // Add sign
            btnAdd.Tag = LayerCommand.Add;

            // Set border width
            _borderWidth = 4F;

            // Set serveral option for paint
            SetStyle(
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.OptimizedDoubleBuffer |
                ControlStyles.ResizeRedraw |
                ControlStyles.UserPaint, true);
        }
コード例 #5
0
ファイル: MenuRenderer.cs プロジェクト: rizwan3d/elalang
 public static void ApplySkin(ToolStripDropDown dropDown)
 {
     dropDown.Renderer = new MenuRenderer();
     var size = MeasureDropDown(dropDown);
     dropDown.Width = size.Width;
     dropDown.Height = size.Height + 5;
 }
コード例 #6
0
ファイル: UndoButton.cs プロジェクト: Jchuchla/vixen
        public UndoButton()
        {
            // Initialize the custom control
            m_dropControl = new UndoDropDownControl()
                                {
                                    MinimumSize = new Size(SetWidth, SetHeight) // <- important
                                };
            m_dropControl.ItemChosen += m_dropControl_ItemChosen;

            // ...hosted by a ToolStripControlHost
            m_toolHost = new ToolStripControlHost(m_dropControl)
                         	{
                         		Size = new Size(SetWidth, SetHeight),
                         		Margin = new Padding(0)
                         	};

            // ... and shown in a ToolStripDropDown.
            m_toolDrop = new ToolStripDropDown()
                         	{
                         		Padding = new Padding(0)
                         	};
            m_toolDrop.Items.Add(m_toolHost);

            this.DisplayStyle = ToolStripItemDisplayStyle.Image;
            this.BackgroundImageLayout = ImageLayout.Stretch;

            // There is no OnDropDownOpening to override, so I guess we have to do it this way.
            this.DropDownOpening += UndoButton_DropDownOpening;
        }
コード例 #7
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);
        }
コード例 #8
0
 /// <summary>
 /// Used by AddContributions to add new ContextMenu Items to a Menu they are about to Display
 /// </summary>
 /// <param name="strip">The form's menu</param>
 /// <param name="itemsIn">New Items to Add</param>
 public static void AddContributions_Helper(ToolStripDropDown strip, List<ToolStripMenuItem> itemsIn)
 {
     if (itemsIn == null || itemsIn.Count == 0) return;
     List<ToolStripItem> items = new List<ToolStripItem>();
     itemsIn.ForEach(o =>
                         {
                             string txt = (o.Text ?? "").ToLower().Trim();
                             foreach (var i in strip.Items)
                             {
                                 ToolStripItem item = (ToolStripItem)i;
                                 if (txt != (item.Text ?? "").ToLower().Trim()) continue;
                                 txt = null;
                                 break;
                             }
                             foreach (var item in items)
                             {
                                 if (txt != (item.Text ?? "").ToLower().Trim()) continue;
                                 txt = null;
                                 break;
                             }
                             if (txt != null) items.Add(o);
                         });
     if (items.Count == 0) return;
     if (strip.Items.Count > 0)
         items.Insert(0, new ToolStripSeparator());
     strip.Items.AddRange(items.ToArray());
     strip.Closing += ((sender, args) => items.ForEach((o) => strip.Items.Remove(o)));
 }
コード例 #9
0
 protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
 {
     Menu_AppendItem(menu, "Simple Subdivision", SimpleSubClicked, true, _mode == FoldMode.SimpleSubdivision);
     Menu_AppendItem(menu, "Vertices", VerticeClicked, true, _mode == FoldMode.Vertices || _mode == FoldMode.VerticesAndEdges || _mode == FoldMode.VerticesAndFaces || _mode == FoldMode.AllSelect);
     Menu_AppendItem(menu, "Edges", EdgeClicked, true, _mode == FoldMode.Edges || _mode == FoldMode.VerticesAndEdges || _mode == FoldMode.EdgesAndFace || _mode == FoldMode.AllSelect);
     Menu_AppendItem(menu, "Faces", FaceClicked, true, _mode == FoldMode.Faces || _mode == FoldMode.VerticesAndFaces || _mode == FoldMode.EdgesAndFace || _mode == FoldMode.AllSelect);
 }
コード例 #10
0
ファイル: FwPopup.cs プロジェクト: sillsdev/WorldPad
		/// ------------------------------------------------------------------------------------
		/// <summary>
		/// Initializes a new instance of the <see cref="FwPopup"/> class.
		/// </summary>
		/// ------------------------------------------------------------------------------------
		public FwPopup()
		{
			InitializeComponent();
			base.DoubleBuffered = true;

			if (DesignMode)
				return;

			base.Dock = DockStyle.Fill;

			m_host = new ToolStripControlHost(this);
			m_host.Padding = Padding.Empty;
			m_host.Margin = Padding.Empty;
			m_host.AutoSize = false;
			m_host.Size = Size;
			m_host.Dock = DockStyle.Fill;

			m_owningDropDown = new ToolStripDropDown();
			m_owningDropDown.Padding = Padding.Empty;
			m_owningDropDown.AutoSize = false;
			m_owningDropDown.LayoutStyle = ToolStripLayoutStyle.Table;
			m_owningDropDown.Size = Size;
			m_owningDropDown.Items.Add(m_host);
			m_owningDropDown.VisibleChanged += m_owningDropDown_VisibleChanged;
			m_owningDropDown.Opened += m_owningDropDown_Opened;
			m_owningDropDown.Closed += m_owningDropDown_Closed;
			m_owningDropDown.Opening += m_owningDropDown_Opening;
		}
コード例 #11
0
ファイル: LineSetPanel.cs プロジェクト: PeteFohl/SDTS-Browser
 public LineSetPanel()
 {
     InitializeComponent();
     MouseWheel += LineSetPanel_MouseWheel;
     _popup = new ToolStripDropDown();
     _selectedLines = new List<Line>();
     UseProjection = true;
 }
コード例 #12
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            ToolStripMenuItem item1 = Menu_AppendItem(menu, "删除线性数据首尾", AdvancedMenuClicked1, true, _CutStartEnd);
            ToolStripMenuItem item2 = Menu_AppendItem(menu, "删除树形数据首尾", AdvancedMenuClicked2, true, !_CutStartEnd);

            item1.BackColor = cor1;
            item2.BackColor = cor2;
        }
コード例 #13
0
 /// <summary>
 /// Extra fancy menu items
 /// </summary>
 /// <param name="menu"></param>
 protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
 {
     base.AppendAdditionalComponentMenuItems(menu);
     Menu_AppendItem(menu, @"Connect all sliders", AddAllSliders);
     Menu_AppendItem(menu, @"Connect selected sliders", AddSelectedSliders);
     Menu_AppendItem(menu, @"Remove all sliders", RemoveAllSliders);
     Menu_AppendItem(menu, @"Link to github src", GotoGithub);
 }
コード例 #14
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            // Append the item to the menu, making sure it's always enabled and checked if Absolute is True.
            ToolStripMenuItem item = Menu_AppendItem(menu, "EvenOdd", Menu_AbsoluteClicked, true, EvenOdd);

            // Specifically assign a tooltip text to the menu item.
            item.ToolTipText = "When checked, even/odd sorting rule is used.";
        }
コード例 #15
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);
        }
コード例 #16
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            // Append the item to the menu, making sure it's always enabled and checked if Absolute is True.
            ToolStripMenuItem item = Menu_AppendItem(menu, "Absolute", Menu_AbsoluteClicked, true, Absolute);

            // Specifically assign a tooltip text to the menu item.
            item.ToolTipText = "When checked, values are made absolute prior to sorting.";
        }
コード例 #17
0
 /// <summary>
 /// Extra fancy menu items
 /// </summary>
 /// <param name="menu"></param>
 protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
 {
     base.AppendAdditionalComponentMenuItems(menu);
     Menu_AppendItem(menu, @"All Sliders", AddAllSliders);
     Menu_AppendItem(menu, @"Selected Sliders", AddSelectedSliders);
     Menu_AppendItem(menu, @"No Sliders", RemoveAllSliders);
     Menu_AppendItem(menu, @"Github source", GotoGithub);
 }
コード例 #18
0
ファイル: GHC_WindowFrame.cs プロジェクト: wqs111000/Leopard
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            ToolStripMenuItem item = Menu_AppendItem(menu, "Cap", Menu_CapClicked, true, Cap);

            // Specifically assign a tooltip text to the menu item.
            item.ToolTipText = "When checked, cap the opening of the frame";
            //base.AppendAdditionalMenuItems(menu);
        }
コード例 #19
0
ファイル: MainForm.cs プロジェクト: Shaykh/Loyc
		public static ToolStripDropDown NewPopup(Control contents)
		{
			var strip = new ToolStripDropDown();
			var host = new ToolStripControlHost(contents);
			strip.Items.Add(host);
			host.Margin = new Padding(0);
			return strip;
		}
コード例 #20
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            // Append the item to the menu, making sure it's always enabled and checked if Absolute is True.
            ToolStripMenuItem item = Menu_AppendItem(menu, "Clipped", Menu_ClippedClicked, true, Clipped);

            // Specifically assign a tooltip text to the menu item.
            item.ToolTipText = "When checked, the OSM data is clipped to the boundary input.";
        }
コード例 #21
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            base.AppendAdditionalComponentMenuItems(menu);

            var item = menu.Items.Add("Load from .obj files...", null, OnImport);

            item.Font    = new System.Drawing.Font(item.Font.FontFamily, item.Font.Size, System.Drawing.FontStyle.Bold);
            item.Enabled = Params.Input[0].SourceCount == 0;
        }
コード例 #22
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            base.AppendAdditionalComponentMenuItems(menu);

            var item = menu.Items.Add("Save as .obj file...", null, OnExport);

            item.Font    = new System.Drawing.Font(item.Font.FontFamily, item.Font.Size, System.Drawing.FontStyle.Bold);
            item.Enabled = Params.Output[0].VolatileDataCount > 0;
        }
コード例 #23
0
ファイル: 筛选树支.cs プロジェクト: zohozer/Vipers
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            ToolStripMenuItem item1 = Menu_AppendItem(menu, "整数列表筛选分支", AdvancedMenuClicked1, true, IntList);
            ToolStripMenuItem item2 = Menu_AppendItem(menu, "布尔列表筛选分支", AdvancedMenuClicked2, true, BoolList);
            ToolStripMenuItem item3 = Menu_AppendItem(menu, "区间列表筛选分支", AdvancedMenuClicked3, true, IntervalList);

            item1.BackColor = cor1;
            item2.BackColor = cor2;
            item3.BackColor = cor3;
        }
コード例 #24
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            ToolStripMenuItem item  = Menu_AppendItem(menu, "only between", Menu_AbsoluteClicked, true, Between);
            ToolStripMenuItem item2 = Menu_AppendItem(menu, "coincident", Menu_AbsoluteClicked2, true, Coincident);

            item.ToolTipText  = "两条曲线间的点,不包括在曲线上的点";
            item.BackColor    = cor1;
            item2.ToolTipText = "两条曲线间的点,包括在曲线上的点";
            item2.BackColor   = cor2;
        }
コード例 #25
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            // Append the item to the menu, making sure it's always enabled and checked if Absolute is True.
            ToolStripMenuItem item  = Menu_AppendItem(menu, "繁→简", Menu_AbsoluteClicked, true, Fanjian);
            ToolStripMenuItem item2 = Menu_AppendItem(menu, "简→繁", Menu_AbsoluteClicked2, true, Jianfan);

            // Specifically assign a tooltip text to the menu item.
            item.BackColor  = cor1;
            item2.BackColor = cor2;
        }
コード例 #26
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            // Append the item to the menu, making sure it's always enabled and checked if Absolute is True.
            ToolStripMenuItem avgOutput   = Menu_AppendItem(menu, "Avg Output", SetValueToOneDimensionalResults, true);
            ToolStripMenuItem facadeOuput = Menu_AppendItem(menu, "Facade Output", SetValueToFacedeResults, true);

            // Specifically assign a tooltip text to the menu item.
            avgOutput.ToolTipText   = "Click on it to select only avg building results.";
            facadeOuput.ToolTipText = "Click on it to select only file for facade results.";
        }
コード例 #27
0
ファイル: PythonComponent.cs プロジェクト: rivermao/ghpython
        public override bool AppendMenuItems(ToolStripDropDown iMenu)
        {
            var toReturn = base.AppendMenuItems(iMenu);

              {
            var tsi = GetTargetVariableMenuItem();
            iMenu.Items.Insert(Math.Min(iMenu.Items.Count, 1), tsi);
              }

              return toReturn;
        }
コード例 #28
0
ファイル: Nameable.cs プロジェクト: ksteinfe/lemmings
        public override bool AppendMenuItems(ToolStripDropDown menu)
        {
            // Place a call to the base class to ensure the default parameter menu is still there and operational.
            base.AppendAdditionalComponentMenuItems(menu);

            // Now insert your own custom menu items.
            //Menu_AppendSeparator(menu);
            Menu_AppendTextItem(menu, this.ComponentName, Menu_ParentLayerNameKeyDown, Menu_ParentLayerNameChanged, true);
            //Menu_AppendItem(menu, "Run Lemmings!", Menu_RunLemmingsClicked);
            return true;
        }
コード例 #29
0
 public CommandMenuBuilder()
 {
     menu = new ContextMenuStrip();
     menu.ShowCheckMargin = false;
     menu.ShowImageMargin = false;
     menu.SuspendLayout();
     menu.Opening +=new System.ComponentModel.CancelEventHandler(menu_Opening);
     menu.Closed += new ToolStripDropDownClosedEventHandler(menu_Closed);
     currentMenu = menu;
     currentButtonBar = new List<ToolStripButton>();
 }
コード例 #30
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            // Append the item to the menu, making sure it's always enabled and checked Which on is True.
            ToolStripMenuItem item1 = Menu_AppendItem(menu, "Length", Menu_ConversionTypeClickedL, true, ConvTypeL);
            ToolStripMenuItem item2 = Menu_AppendItem(menu, "Area", Menu_ConversionTypeClickedA, true, ConvTypeA);
            ToolStripMenuItem item3 = Menu_AppendItem(menu, "Volume", Menu_ConversionTypeClickedV, true, ConvTypeV);

            // Specifically assign a tooltip text to the menu item.
            item1.ToolTipText = "When checked, you are converting Length.";
            item2.ToolTipText = "When checked, you are converting Areas.";
            item3.ToolTipText = "When checked, you are converting Volume.";
        }
コード例 #31
0
        public override void AppendAdditionalMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            Menu_AppendSeparator(menu);
            ToolStripMenuItem toolStripMenuItem;

            toolStripMenuItem             = Menu_AppendItem(menu, "GLPK (Google or-tools)", new EventHandler(this.Menu_GLPKClicked), true, m_solType == SharpSLO.SolType.GLPK);
            toolStripMenuItem.ToolTipText = "Use the GLPK solver (provided by Google's or-tools).";
            toolStripMenuItem             = Menu_AppendItem(menu, "Clp (Google or-tools)", new EventHandler(this.Menu_ClpClicked), true, m_solType == SharpSLO.SolType.Clp);
            toolStripMenuItem.ToolTipText = "Use the Clp solver (provided by Google's or-tools).";
            toolStripMenuItem             = Menu_AppendItem(menu, "Mosek", new EventHandler(this.Menu_MosekClicked), true, m_solType == SharpSLO.SolType.Mosek);
            toolStripMenuItem.ToolTipText = "Use the Mosek solver (if you have it installed).";
        }
コード例 #32
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            // Append the item to the menu, making sure it's always enabled and checked if Absolute is True.
            ToolStripMenuItem item  = Menu_AppendItem(menu, "编织树形数据分支", Menu_AbsoluteClicked, true, _WaveTree);
            ToolStripMenuItem item2 = Menu_AppendItem(menu, "编织整个树形数据", Menu_AbsoluteClicked2, true, !_WaveTree);

            // Specifically assign a tooltip text to the menu item.
            item.ToolTipText  = "编织树形数据中的每个分支";
            item.BackColor    = cor1;
            item2.ToolTipText = "编织整个树形数据";
            item2.BackColor   = cor2;
        }
コード例 #33
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            // Append the item to the menu, making sure it's always enabled and checked if Absolute is True.
            ToolStripMenuItem item  = Menu_AppendItem(menu, "根据不同长度划分曲线", new EventHandler(Menu_AbsoluteClicked), true, _LengthCutCurve);
            ToolStripMenuItem item2 = Menu_AppendItem(menu, "根据不同距离划分曲线", new EventHandler(Menu_AbsoluteClicked2), true, !_LengthCutCurve);

            // Specifically assign a tooltip text to the menu item.
            item.ToolTipText  = "方法参考GH中的\"DivideLength\",依次按照列表中的数值划分曲线";
            item.BackColor    = cor1;
            item2.ToolTipText = "方法参考GH中的\"DivideDistance\",依次按照列表中的数值划分曲线";
            item2.BackColor   = cor2;
        }
コード例 #34
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            // Append the item to the menu, making sure it's always enabled and checked if Absolute is True.
            ToolStripMenuItem atmosphere = Menu_AppendItem(menu, "Atmosphere", SetValueToAtmosphere, true);
            ToolStripMenuItem soil       = Menu_AppendItem(menu, "Soil", SetValueToSoil, true);
            ToolStripMenuItem flux       = Menu_AppendItem(menu, "Flux", SetValueToFlux, true);

            // Specifically assign a tooltip text to the menu item.
            atmosphere.ToolTipText = "Click on it to select only atmosphere output.";
            soil.ToolTipText       = "Click on it to select only soil output.";
            flux.ToolTipText       = "Click on it to select only flux output.";
        }
コード例 #35
0
		public void Layout ()
		{
			ToolStripDropDown drop_down = new ToolStripDropDown ();
			drop_down.Items.Add (new ToolStripVariableSizeItem ());
			drop_down.PerformLayout ();

			// We want to be sure the DropDown is using the size provided
			// by GetPreferredSize, not DefaultSize, and since the extra padding/margin
			// can change by some few pixels, we do a light check
			Assert.AreEqual (true, drop_down.Size.Width >= 100, "A1");
			Assert.AreEqual (true, drop_down.Size.Height >= 100, "A2");
		}
コード例 #36
0
ファイル: ExcelWrite.cs プロジェクト: rhughes42/Link
        // The following functions append menu items and then handle the item clicked event.
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            ToolStripMenuItem mClear = Menu_AppendItem(menu, "Clear Sheet", Clear_Click, true, clear);

            mClear.ToolTipText = "Delete the worksheet and create a new one.";
            ToolStripMenuItem mForce = Menu_AppendItem(menu, "Force Numbers", Num_Click, true, numbers);

            mForce.ToolTipText = "Force the formatting of all data cells to general numbers.";
            ToolStripMenuItem mHide = Menu_AppendItem(menu, "Hide Headers", Head_Click, true, hideHeaders);

            mHide.ToolTipText = "Hide the headers of the data to enable easier processing.";
        }
コード例 #37
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (dropDown != null)
         {
             dropDown.Dispose();
             dropDown = null;
         }
     }
     base.Dispose(disposing);
 }
コード例 #38
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            // Append the item to the menu, making sure it's always enabled and checked if Absolute is True.
            ToolStripMenuItem item  = Menu_AppendItem(menu, "X轴方向排序", Menu_AbsoluteClicked, true, _VectorX);
            ToolStripMenuItem item2 = Menu_AppendItem(menu, "Y轴方向排序", Menu_AbsoluteClicked2, true, _VectorY);
            ToolStripMenuItem item3 = Menu_AppendItem(menu, "Z轴方向排序", Menu_AbsoluteClicked3, true, _VectorZ);

            // Specifically assign a tooltip text to the menu item.
            item.BackColor  = cor1;
            item2.BackColor = cor2;
            item3.BackColor = cor3;
        }
コード例 #39
0
 public CheckComboBox()
     : base()
 {
     m_checkListBox = new CheckListBox();
     m_checkListBox.Dock = DockStyle.Fill;            
     m_checkListBox.ItemChecked += new ItemCheckedEventHandler(m_checkListBox_ItemChecked);
     m_dropDown = new ToolStripDropDown();
     m_dropDown.Margin = new Padding(0);
     m_dropDown.Padding = new Padding(1);
     m_dropDown.Items.Add(new ToolStripControlHost(m_checkListBox));
     m_dropDown.Closing += new ToolStripDropDownClosingEventHandler(m_dropDown_Closing);            
 }
コード例 #40
0
ファイル: 曲线转换.cs プロジェクト: sx789456/Vipers
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            // Append the item to the menu, making sure it's always enabled and checked if Absolute is True.
            ToolStripMenuItem item1 = Menu_AppendItem(menu, "曲线转换为弧线", Menu_AbsoluteClicked1, true, arc);
            ToolStripMenuItem item2 = Menu_AppendItem(menu, "曲线转换为圆", Menu_AbsoluteClicked2, true, circle);
            ToolStripMenuItem item3 = Menu_AppendItem(menu, "曲线转换为椭圆", Menu_AbsoluteClicked3, true, elli);
            ToolStripMenuItem item4 = Menu_AppendItem(menu, "曲线转换为多段线", Menu_AbsoluteClicked4, true, poly);

            item1.BackColor = cor1;
            item2.BackColor = cor2;
            item3.BackColor = cor3;
            item4.BackColor = cor4;
        }
コード例 #41
0
ファイル: 线段转矩形.cs プロジェクト: zohozer/Vipers
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            ToolStripMenuItem item  = Menu_AppendItem(menu, "中心对齐", new EventHandler(Menu_AbsoluteClicked), true, Flag);
            ToolStripMenuItem item2 = Menu_AppendItem(menu, "左边对齐", new EventHandler(Menu_AbsoluteClicked2), true, Flag2);
            ToolStripMenuItem item3 = Menu_AppendItem(menu, "右边对齐", new EventHandler(Menu_AbsoluteClicked3), true, Flag3);

            item.ToolTipText  = "指定线段位于多边形线框中心位置";
            item.BackColor    = cor1;
            item2.ToolTipText = "指定线段位于多边形线框左边位置";
            item2.BackColor   = cor2;
            item3.ToolTipText = "指定线段位于多边形线框右边位置";
            item3.BackColor   = cor3;
        }
コード例 #42
0
        public override bool AppendMenuItems(ToolStripDropDown menu)
        {
            // Place a call to the base class to ensure the default parameter menu is still there and operational.
            //base.AppendAdditionalComponentMenuItems(menu);

            // Now insert your own custom menu items.
            //Menu_AppendItem(menu, "1 Parameter", Menu_ChangeParamCount, true, true);
            //Menu_AppendItem(menu, "2 Parameters", Menu_ChangeParamCount, true, false);
            //Menu_AppendItem(menu, "3 Parameters", Menu_ChangeParamCount, true, false);
            //Menu_AppendSeparator(menu);
            Menu_AppendItem(menu, "Run Lemmings!", Menu_RunLemmingsClicked);
            return true;
        }
コード例 #43
0
ファイル: IfcPreview.cs プロジェクト: whztt07/ifc-visualiser
        // Overrides the default menu of grasshopper (useful)
        public override bool AppendMenuItems(ToolStripDropDown menu)
        {
            Menu_AppendItem(menu, "First item");
            Menu_AppendItem(menu, "Second item");
            Menu_AppendItem(menu, "Third item");
            Menu_AppendSeparator(menu);
            Menu_AppendItem(menu, "Fourth item");
            Menu_AppendItem(menu, "Fifth item");
            Menu_AppendItem(menu, "Sixth item");

            // Return true, otherwise the menu won't be shown.
            return true;
        }
コード例 #44
0
ファイル: ParseEPLComponent.cs プロジェクト: ksteinfe/dyear
        public override bool AppendMenuItems(ToolStripDropDown menu)
        {
            //base.AppendMenuItems(menu);
            Menu_AppendEnableItem(menu);
            Menu_AppendWarningsAndErrors(menu);
            Menu_AppendObjectHelp(menu);
            Menu_AppendSeparator(menu);

            if (FilepathValid()) { Menu_AppendItem(menu, this.filepath, Menu_FilepathClicked); }
            if (FilepathValid()) { Menu_AppendItem(menu, "Refresh Filepath", Menu_RefreshFilepathClicked); }
            Menu_AppendItem(menu, "Set Filepath", Menu_SetFilepathClicked);

            return true;
        }
コード例 #45
0
        public override void AppendAdditionalMenuItems(wf.ToolStripDropDown menu)
        {
            base.AppendAdditionalMenuItems(menu);
            // TODO: this uses winforms, probably won't work on Mac
            try
            {
                wf.ToolStripMenuItem asciionly = menu.Items.Add("ASCII only", null, OnAscii) as wf.ToolStripMenuItem;
                asciionly.Checked = ascii;

                wf.FlowLayoutPanel flowpanel = new wf.FlowLayoutPanel()
                {
                    FlowDirection = wf.FlowDirection.TopDown
                };
                wf.RadioButton rb1 = new wf.RadioButton()
                {
                    Text = "UI"
                };
                wf.RadioButton rb2 = new wf.RadioButton()
                {
                    Text = "Installed"
                };
                wf.RadioButton rb3 = new wf.RadioButton()
                {
                    Text = "Invariant"
                };
                if (cultr == CultureInfo.CurrentUICulture)
                {
                    rb1.Checked = true;
                }
                else if (cultr == CultureInfo.InstalledUICulture)
                {
                    rb2.Checked = true;
                }
                else if (cultr == CultureInfo.InvariantCulture)
                {
                    rb3.Checked = true;
                }
                else
                {
                    rb3.Checked = true;
                }
                flowpanel.Controls.AddRange(new wf.Control[] { rb1, rb2, rb3, });
                rb1.Click += OnCheck;
                rb2.Click += OnCheck;
                rb3.Click += OnCheck;

                menu.Items.Add(new wf.ToolStripControlHost(flowpanel));
            }
            catch { }
        }
コード例 #46
0
        public ComboBox_TreeView()
        {
            // new empty tree view
            treeView = new TreeView();
            treeView.BorderStyle = BorderStyle.None;
            treeViewHost = new ToolStripControlHost(treeView);

            // create drop down and add it
            dropDown = new ToolStripDropDown();
            dropDown.Items.Add(treeViewHost);

            // adding signal for action after selection
            treeView.AfterSelect += new TreeViewEventHandler(treeView_AfterSelect);
        }
コード例 #47
0
ファイル: StripMenu.cs プロジェクト: ehershey/development
		private void StripMenu_Load(object sender, EventArgs e)
		{
					
			// Create the font collection.
			InstalledFontCollection fontFamilies = new InstalledFontCollection();

			// Iterate through all font families.
			foreach (FontFamily family in fontFamilies.Families)
			{
				try
				{
					// Create a ToolStripMenuItem that will display text in this font.
					ToolStripMenuItem item = new ToolStripMenuItem(family.Name);
					item.Font = new Font(family, 8);

					mnuFont.DropDownItems.Add(item);
				}
				catch
				{
					// An error will occur if the selected font does
					// not support normal style (the default used when
					// creating a Font object). This problem can be
					// harmlessly ignored.
				}

			}

			// Code for the table-like File menu:
			
            // Create a new drop-down menu.
			ToolStripDropDown menu = new ToolStripDropDown();

            // Copy the existing items.
            ToolStripItem[] items = new ToolStripItem[fileToolStripMenuItem.DropDown.Items.Count];
            fileToolStripMenuItem.DropDown.Items.CopyTo(items, 0);

            // Transfer the items into the drop-down menu.
			foreach (ToolStripItem item in items)
			{
				if (!(item is ToolStripSeparator)) menu.Items.Add(item);
			}

            // Adjust the layout of the new menu.
			menu.LayoutStyle = ToolStripLayoutStyle.Table;
			((TableLayoutSettings)menu.LayoutSettings).ColumnCount = 2;
            			
            // Attach it to the File menu.
            fileToolStripMenuItem.DropDown = menu;
		}
コード例 #48
0
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            base.AppendAdditionalComponentMenuItems(menu);
            var m = Menu_AppendItem(menu, "Get Colors", ChangeMode, true, getColors);

            m.ToolTipText = "If checked, will output unjoined curves in a tree data structure.";

            tp = Menu_AppendItem(menu, "Turn Policy", null, true);
            tp.DropDownItems.Add(new ToolStripMenuItem("Minority", null, ChangeTurnPolicy));
            tp.DropDownItems.Add(new ToolStripMenuItem("Majority", null, ChangeTurnPolicy));
            tp.DropDownItems.Add(new ToolStripMenuItem("Right", null, ChangeTurnPolicy));
            tp.DropDownItems.Add(new ToolStripMenuItem("Black", null, ChangeTurnPolicy));
            tp.DropDownItems.Add(new ToolStripMenuItem("White", null, ChangeTurnPolicy));
            ((ToolStripMenuItem)tp.DropDownItems[(int)Potrace.turnpolicy]).Checked = true;
        }
コード例 #49
0
ファイル: 点云随机上色.cs プロジェクト: zohozer/Vipers
        protected override void AppendAdditionalComponentMenuItems(System.Windows.Forms.ToolStripDropDown menu)
        {
            // Append the item to the menu, making sure it's always enabled and checked if Absolute is True.
            ToolStripMenuItem item  = Menu_AppendItem(menu, "SimplePoint", Menu_AbsoluteClicked, true, Abs1);
            ToolStripMenuItem item2 = Menu_AppendItem(menu, "ControlPoint", Menu_AbsoluteClicked2, true, Abs2);
            ToolStripMenuItem item3 = Menu_AppendItem(menu, "ActivePoint", Menu_AbsoluteClicked3, true, Abs3);

            // Specifically assign a tooltip text to the menu item.
            item.ToolTipText  = "Style: Simple";
            item.BackColor    = cor1;
            item2.ToolTipText = "Style: ControlPoint";
            item2.BackColor   = cor2;
            item3.ToolTipText = "Style: ActivePoint";
            item3.BackColor   = cor3;
        }
コード例 #50
0
ファイル: Form1.cs プロジェクト: DarkLotus/UOnet
 public Form1()
 {
     InitializeComponent();
     globals = new Globals { UO = new uoNet.UO() };
     globals.UO.Open(2);
     t = new Thread(new ThreadStart(refresh));
     t.Start();
     ToolStripDropDown dropdown = new ToolStripDropDown();
     for (int i = 1; i <= globals.UO.CliCnt;i++) {
         var toolstripItem = new ToolStripMenuItem("Client: " + i);
         toolstripItem.Click += (e, v) => { globals.UO.CliNr = i; };
         dropdown.Items.Add(toolstripItem);
     }
     switchClientToolStripMenuItem.DropDown = dropdown;
 }
コード例 #51
0
        // The constructor creates an instance of CheckedListBox and ToolStripDropDown.
        // the CheckedListBox is hosted by ToolStripControlHost, which in turn is
        // added to ToolStripDropDown.
        public DataGridViewColumnSelector()
        {
            mCheckedListBox = new CheckedListBox();
            mCheckedListBox.CheckOnClick = true;
            mCheckedListBox.ItemCheck += new ItemCheckEventHandler(mCheckedListBox_ItemCheck);

            ToolStripControlHost mControlHost = new ToolStripControlHost(mCheckedListBox);
            mControlHost.Padding = Padding.Empty;
            mControlHost.Margin = Padding.Empty;
            mControlHost.AutoSize = false;

            mPopup = new ToolStripDropDown();
            mPopup.Padding = Padding.Empty;
            mPopup.Items.Add(mControlHost);
        }
コード例 #52
0
        public ToolStripFillButton()
        {
            FillColor = Color.Transparent;
            base.Image = GenerateThumbWidthColor(FillColor);

            // Create size and color picker
            _control = new ColorToolControl(FillColor, 0, DashStyle.Solid, true);
            _control.ColorSelected += control_ColorSelected;

            // Add to dropdown list
            var dropdown = new ToolStripDropDown();
            dropdown.Items.Add(new ToolStripControlHost(_control));

            DropDown = dropdown;
        }
コード例 #53
0
        public void Show(Point screenLocation)
        {
            ToolStripControlHost host = new ToolStripControlHost(this);
            ToolStripDropDown = new ToolStripDropDown();
            ToolStripDropDown.Items.Clear();
            ToolStripDropDown.Items.Add(host);

            ToolStripDropDown.Padding = Padding.Empty;
            ToolStripDropDown.Margin = Padding.Empty;
            host.Padding = Padding.Empty;
            host.Margin = Padding.Empty;

            ToolStripDropDown.Closed += new ToolStripDropDownClosedEventHandler(ToolStripDropDown_Closed);

            ToolStripDropDown.Show(screenLocation);
        }
コード例 #54
0
 public DGVColumnFilterContextControl(DataGridView dgv, int colIndex)
 {
     InitializeComponent();
     this.colIndex = colIndex;
     this.dgv = dgv;
     popup = new ToolStripDropDown();
     popup.Margin = Padding.Empty;
     popup.Padding = Padding.Empty;
     ToolStripControlHost host = new ToolStripControlHost(this);
     host.Margin = Padding.Empty;
     host.Padding = Padding.Empty;
     popup.Items.Add(host);
     // Setup
     LostFocus += new EventHandler(DGVColumnFilterContextControl_LostFocus);
     dgv.ColumnHeaderMouseClick += new DataGridViewCellMouseEventHandler(dgv_ColumnHeaderMouseClick);
 }
コード例 #55
0
        protected override void AppendAdditionalComponentMenuItems(ToolStripDropDown menu)
        {
            base.AppendAdditionalComponentMenuItems(menu);

            Menu_AppendSeparator(menu);
            Menu_AppendItem(menu, "Recompute", MenuHandler_Recompute);

            Menu_AppendSeparator(menu);
            menuItem_Standard = Menu_AppendItem(menu, "Standard", MenuHandler_Standard, true, false);
            menuItem_StructuralAnalysis = Menu_AppendItem(menu, "Structural Analysis", MenuHandler_StructuralAnalysis, true, false);
            menuItem_ExtendedSurfaces = Menu_AppendItem(menu, "Extended Surfaces", MenuHandler_ExtendedSurfaces, true, false);

            //menuItem_Standard.CheckOnClick = true;
            //menuItem_StructuralAnalysis.CheckOnClick = true;
            //menuItem_ExtendedSurfaces.CheckOnClick = true;
        }
コード例 #56
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ToolStripOutlineButton"/> class.
        /// </summary>
        public ToolStripOutlineButton()
        {
            // Initialize
            OutlineWidth = 2;
            OutlineColor = Color.Black;
            OutlineDash = DashStyle.Solid;
            base.Image = GenerateThumbWidthColor(OutlineColor, OutlineWidth, OutlineDash);

            // Create size and color picker
            _control = new ColorToolControl(OutlineColor, OutlineWidth, OutlineDash);
            _control.ColorSelected += control_ColorSelected;

            // Add to dropdown list
            var dropdown = new ToolStripDropDown();
            dropdown.Items.Add(new ToolStripControlHost(_control));

            DropDown = dropdown;
        }
コード例 #57
0
        // The constructor creates an instance of CheckedListBox and ToolStripDropDown.
        // the CheckedListBox is hosted by ToolStripControlHost, which in turn is
        // added to ToolStripDropDown.
        /// <summary>
        /// /
        /// </summary>
        public DataGridViewColumnSelector()
        {
            //mCheckedListBox = new CheckedListBox();
            //mCheckedListBox.CheckOnClick = true;
            //mCheckedListBox.ItemCheck += new ItemCheckEventHandler(mCheckedListBox_ItemCheck);

            //ToolStripControlHost mControlHost = new ToolStripControlHost(mCheckedListBox);
            pUserControl1.DoneEvent += new EventHandler(OnDone);
            pUserControl1.CheckedChangedEnent += new DataGridViewMenu.CheckedChanged(CheckedChangedEnent);
            ToolStripControlHost mControlHost = new ToolStripControlHost(pUserControl1);
            mControlHost.Padding = Padding.Empty;
            mControlHost.Margin = Padding.Empty;
            mControlHost.AutoSize = false;

            mPopup = new ToolStripDropDown();
            mPopup.Padding = Padding.Empty;
            mPopup.AutoClose = true;
            mPopup.Items.Add(mControlHost);
        }
コード例 #58
0
        public ToolStripItemCommandBinding(ToolStripDropDown dropDown, ToolStripItem item, Lifetime<ICommand> command, object argument)
        {
            if (dropDown == null)
                throw new ArgumentNullException("dropDown");

            if (item == null)
                throw new ArgumentNullException("item");

            if (command == null)
                throw new ArgumentNullException("command");

            _dropDown = dropDown;
            _item = item;
            _menuItem = item as ToolStripMenuItem;
            _command = command.Instance;
            _lifetime = command;
            _argument = argument;

            RegisterEvents();
            Refresh();
        }
コード例 #59
0
		public void Constructor ()
		{
			ToolStripDropDown tsdd = new ToolStripDropDown ();

			Assert.AreEqual (false, tsdd.AllowTransparency, "A1");
			Assert.AreEqual (true, tsdd.AutoClose, "A2");
			Assert.AreEqual (false, tsdd.CanOverflow, "A3");
			Assert.AreEqual (ToolStripDropDownDirection.Right, tsdd.DefaultDropDownDirection, "A4");
			Assert.AreEqual (true, tsdd.DropShadowEnabled, "A5");
			Assert.AreEqual (false, tsdd.IsAutoGenerated, "A6");
			Assert.AreEqual (1, tsdd.Opacity, "A7");
			Assert.AreEqual (Orientation.Horizontal, tsdd.Orientation, "A7-2");
			Assert.AreEqual (null, tsdd.OwnerItem, "A8");
			Assert.AreEqual (null, tsdd.Region, "A9");
			Assert.AreEqual (RightToLeft.No, tsdd.RightToLeft, "A10");
			Assert.AreEqual (ToolStripTextDirection.Horizontal, tsdd.TextDirection, "A11");
			Assert.AreEqual (true, tsdd.TopLevel, "A12");
			Assert.AreEqual (false, tsdd.Visible, "A13");
			
			Assert.AreEqual ("System.Windows.Forms.ToolStripDropDown+ToolStripDropDownAccessibleObject", tsdd.AccessibilityObject.GetType ().ToString (), "A14");
		}
 internal void AddNewTemplateNode(ToolStripDropDown dropDown)
 {
     foreach (ToolStripItem item in dropDown.Items)
     {
         if (item is DesignerToolStripControlHost)
         {
             this.typeHereNode = (DesignerToolStripControlHost) item;
         }
     }
     if (this.typeHereNode != null)
     {
         dropDown.Items.Remove(this.typeHereNode);
     }
     this.typeHereTemplateNode = new ToolStripTemplateNode(base.Component, System.Design.SR.GetString("ToolStripDesignerTemplateNodeEnterText"), null);
     int width = this.typeHereTemplateNode.EditorToolStrip.Width;
     this.typeHereNode = new DesignerToolStripControlHost(this.typeHereTemplateNode.EditorToolStrip);
     this.typeHereTemplateNode.ControlHost = this.typeHereNode;
     this.typeHereNode.AutoSize = false;
     this.typeHereNode.Width = width;
     dropDown.Items.Add(this.typeHereNode);
 }