本文整理汇总了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);
}
}
示例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);
}
}
示例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);
}
}