本文整理汇总了C#中DevComponents.DotNetBar.ButtonItem.SetOwner方法的典型用法代码示例。如果您正苦于以下问题:C# ButtonItem.SetOwner方法的具体用法?C# ButtonItem.SetOwner怎么用?C# ButtonItem.SetOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevComponents.DotNetBar.ButtonItem
的用法示例。
在下文中一共展示了ButtonItem.SetOwner方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreatePopupItem
protected override PopupItem CreatePopupItem()
{
m_Button = CreateButtonItem();
m_Button.GlobalItem = false;
m_Button.Displayed = true;
m_Button.ContainerControl = this;
m_Button.ColorTable = eButtonColor.BlueWithBackground;
m_Button.ButtonStyle = eButtonStyle.ImageAndText;
m_Button._FitContainer = true;
m_Button.Style = eDotNetBarStyle.Office2007;
m_Button.SetOwner(this);
m_Button.CheckedChanged += new EventHandler(OnCheckedChanged);
return m_Button;
}
示例2: 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);
}
}
示例3: ShowCustomizeContextMenu
/// <summary>
/// Displays popup customize context menu for given customization object.
/// </summary>
/// <param name="o">Object that should be customized, usually an instance of BaseItem.</param>
/// <param name="ribbonStrip">Indicates whether customize menu is displayed over ribbon strip</param>
internal virtual void ShowCustomizeContextMenu(object o, bool ribbonStrip)
{
if (o == null || !m_UseCustomizeDialog)
return;
m_RibbonStrip.ClosePopup(SYS_CUSTOMIZE_POPUP_MENU);
ButtonItem cont = new ButtonItem(SYS_CUSTOMIZE_POPUP_MENU);
cont.Style = eDotNetBarStyle.Office2007;
cont.SetOwner(m_RibbonStrip);
if ((CanCustomizeItem(o as BaseItem) || o is RibbonBar) && !m_UseExternalCustomization)
{
if (o is BaseItem && this.QuickToolbarItems.Contains((BaseItem)o))
{
ButtonItem b = new ButtonItem(SysQatRemoveFromItemName);
b.Text = this.SystemText.QatRemoveItemText;
b.Click += new System.EventHandler(CustomizeRemoveFromQuickAccessToolbar);
b.Tag = o;
cont.SubItems.Add(b);
}
else
{
BaseItem itemToCustomize = o as BaseItem;
ButtonItem b = new ButtonItem(SysQatAddToItemName);
b.Text = this.SystemText.QatAddItemText;
b.Click += new System.EventHandler(CustomizeAddToQuickAccessToolbar);
b.Tag = o;
cont.SubItems.Add(b);
if (itemToCustomize != null && this.QuickToolbarItems.Contains(itemToCustomize.Name) ||
o is RibbonBar && this.QuickToolbarItems.Contains(GetQATRibbonBarName(o as RibbonBar)))
b.Enabled = false;
if (itemToCustomize != null && BaseItem.IsOnPopup(itemToCustomize) && itemToCustomize.Parent != null)
{
Control c = itemToCustomize.ContainerControl as Control;
if (c != null) c.VisibleChanged += new EventHandler(CustomizePopupItemParentVisibleChange);
}
}
}
if (m_UseCustomizeDialog)
{
ButtonItem b = new ButtonItem(SysQatCustomizeItemName);
b.Text = this.SystemText.QatCustomizeText;
b.BeginGroup = true;
b.Click += new EventHandler(CustomizeQuickAccessToolbarDialog);
cont.SubItems.Add(b);
}
if (m_EnableQatPlacement && !m_UseExternalCustomization)
{
ButtonItem b = new ButtonItem(SysQatPlaceItemName);
if (m_QatPositionedBelow)
b.Text = this.SystemText.QatPlaceAboveRibbonText;
else
b.Text = this.SystemText.QatPlaceBelowRibbonText;
b.Click += new EventHandler(QuickAccessToolbarChangePlacement);
cont.SubItems.Add(b);
}
if (this.AutoExpand)
{
ButtonItem b = new ButtonItem(this.Expanded ? SysMinimizeRibbon : SysMaximizeRibbon, this.Expanded ? this.SystemText.MinimizeRibbonText : this.SystemText.MaximizeRibbonText);
b.Click += new EventHandler(MinMaxRibbonClick);
b.BeginGroup = true;
cont.SubItems.Add(b);
}
RibbonCustomizeEventArgs e = new RibbonCustomizeEventArgs(o, cont);
OnBeforeCustomizeMenuPopup(e);
if (e.Cancel)
{
cont.Dispose();
return;
}
((IOwnerMenuSupport)m_RibbonStrip).RegisterPopup(cont);
cont.Popup(Control.MousePosition);
}