当前位置: 首页>>代码示例>>C#>>正文


C# ButtonItem.PopupMenu方法代码示例

本文整理汇总了C#中DevComponents.DotNetBar.ButtonItem.PopupMenu方法的典型用法代码示例。如果您正苦于以下问题:C# ButtonItem.PopupMenu方法的具体用法?C# ButtonItem.PopupMenu怎么用?C# ButtonItem.PopupMenu使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DevComponents.DotNetBar.ButtonItem的用法示例。


在下文中一共展示了ButtonItem.PopupMenu方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnMouseUp

		protected override void OnMouseUp(MouseEventArgs e)
		{
			if (e.Button == MouseButtons.Right) 
			{
				ButtonItem[] contextMenu = (ButtonItem[])(AddInTreeSingleton.AddInTree.GetTreeNode(contextMenuPath).BuildChildItems(this)).ToArray(typeof(ButtonItem));
				
				if (contextMenu.Length > 0 && TabPages.Count > 0 && clickedTabIndex >= 0) 
				{
					ButtonItem item = new ButtonItem();
					item.SubItems.AddRange(contextMenu);
					dotNetBarManager1.RegisterPopup(item);
					//Control ctrl=this as Control;
					//Point p=this.PointToScreen(new Point(ctrl.Left,ctrl.Bottom));
					Point p = this.PointToScreen(new Point(e.X,e.Y));
					item.PopupMenu(p);
					
					//PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
					//popup.Style = (Crownwood.Magic.Common.VisualStyle)propertyService.GetProperty("NetFocus.DataStructure.Gui.VisualStyle", Crownwood.Magic.Common.VisualStyle.IDE);
					//popup.TrackPopup(PointToScreen(new Point(e.X, e.Y)));
				}
			} 
			else 
			{
				base.OnMouseUp(e);
			}
		}
开发者ID:tangxuehua,项目名称:DataStructure,代码行数:26,代码来源:OpenFileTab.cs

示例2: OnMouseUp

		protected override void OnMouseUp(MouseEventArgs e)
		{
			base.OnMouseUp(e);
			ButtonItem[] contextMenu = null;
			if (e.Button == MouseButtons.Right) 
			{
				try
				{
					contextMenu = (ButtonItem[])(AddInTreeSingleton.AddInTree.GetTreeNode(contextMenuPath).BuildChildItems(this)).ToArray(typeof(ButtonItem));
				}
				catch
				{
					return;
				}
				ButtonItem item = new ButtonItem();
				item.SubItems.AddRange(contextMenu);
				dotNetBarManager1.RegisterPopup(item);
				Control ctrl=this as Control;
				Point p=this.PointToScreen(new Point(e.X, e.Y));
				item.PopupMenu(p);
				
			} 

		}
开发者ID:tangxuehua,项目名称:DataStructure,代码行数:24,代码来源:TextArea.cs

示例3: DesignTimeContextMenu

		public void DesignTimeContextMenu(BaseItem objItem)
		{
			using(LocalizationManager lm=new LocalizationManager(m_DotNetBar))
			{
				ButtonItem btn;
				m_EditItem=objItem;
				if(m_PopupMenu!=null)
					m_PopupMenu.Dispose();

				m_PopupMenu=new ButtonItem("syscustomizepopupmenu");
				m_PopupMenu.Style=objItem.Style;

				btn=new ButtonItem("reset");
				btn.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuReset);
				btn.Click+=new EventHandler(this.ResetItemClick);
				m_PopupMenu.SubItems.Add(btn);
				
				btn=new ButtonItem("delete");
				btn.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuDelete);
				btn.Click+=new System.EventHandler(this.DeleteClick);
				m_PopupMenu.SubItems.Add(btn);

				TextBoxItem tx=new TextBoxItem("name");
				tx.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuChangeName);
				tx.BeginGroup=true;
				tx.ControlText=objItem.Text;
				tx.LostFocus+=new System.EventHandler(this.ItemNameLostFocus);
				
				m_PopupMenu.SubItems.Add(tx);

				if(m_EditItem is ButtonItem)
				{
					ButtonItem objButton=m_EditItem as ButtonItem;
					btn=new ButtonItem("defaultstyle");
					btn.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuDefaultStyle);
					btn.BeginGroup=true;
					btn.Click+=new System.EventHandler(this.ButtonStyleClick);
					if(objButton.ButtonStyle==eButtonStyle.Default)
						btn.Checked=true;
					m_PopupMenu.SubItems.Add(btn);

					btn=new ButtonItem("textonly");
					btn.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuTextOnly);
					btn.Click+=new System.EventHandler(this.ButtonStyleClick);
					if(objButton.ButtonStyle==eButtonStyle.TextOnlyAlways)
						btn.Checked=true;
					m_PopupMenu.SubItems.Add(btn);

					btn=new ButtonItem("imageandtext");
					btn.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuImageAndText);
					btn.Click+=new System.EventHandler(this.ButtonStyleClick);
					if(objButton.ButtonStyle==eButtonStyle.ImageAndText)
						btn.Checked=true;
					m_PopupMenu.SubItems.Add(btn);

				}

				btn=new ButtonItem("begingroup");
				btn.BeginGroup=true;
				btn.Text=lm.GetLocalizedString(LocalizationKeys.CustomizeMenuBeginGroup);
				btn.Checked=m_EditItem.BeginGroup;
				btn.Click+=new System.EventHandler(this.BeginGroupClick);
			
				m_PopupMenu.SubItems.Add(btn);
	
				m_DotNetBar.OnCustomizeContextMenu(this,m_PopupMenu);
		        
				//m_DotNetBar.RegisterPopup(m_PopupMenu);
				m_PopupMenu.SetOwner(m_DotNetBar);
				m_PopupMenu.PopupMenu(Control.MousePosition);
			}
		}
开发者ID:,项目名称:,代码行数:72,代码来源:


注:本文中的DevComponents.DotNetBar.ButtonItem.PopupMenu方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。