本文整理汇总了C#中DevComponents.DotNetBar.ButtonItem.Popup方法的典型用法代码示例。如果您正苦于以下问题:C# ButtonItem.Popup方法的具体用法?C# ButtonItem.Popup怎么用?C# ButtonItem.Popup使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevComponents.DotNetBar.ButtonItem
的用法示例。
在下文中一共展示了ButtonItem.Popup方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShowContextMenu
private void ShowContextMenu(ButtonItem cm)
{
cm.Popup(MousePosition);
}
示例2: ShowContextMenu
/// <summary>
///
/// </summary>
/// <param name="group"></param>
/// <param name="location"></param>
/// <param name="temporaryColleagueParam"></param>
/// <param name="sequencer"></param>
public void ShowContextMenu(ChoiceGroup group, Point location,
TemporaryColleagueParameter temporaryColleagueParam,
MessageSequencer sequencer)
{
// Store optional parameter values.
m_temporaryColleagueParam = temporaryColleagueParam; // Nulls are just fine.
m_sequencer = sequencer; // Nulls are just fine.
ButtonItem b = new ButtonItem();
b.PopupType = DevComponents.DotNetBar.ePopupType.Menu;
//ContextMenu menu = new ContextMenu();
b.Tag = group;
group.ReferenceWidget = b;
b.SubItems.Add(new ButtonItem("just to make popup happen"));
Manager.RegisterPopup(b);
// This will be populated when this event fires, just to make it parallel to how menubar menus work.
b.PopupOpen += new DevComponents.DotNetBar.DotNetBarManager.PopupOpenEventHandler(menu_PopupOpen);
// It's too early to remove the temporary colleague, even in these event handlers,
// since the Mediator hasn't invoked anything on it yet.
// b.PopupClose += new EventHandler(OnContextMenuClose);
// b.PopupFinalized += new EventHandler(b_PopupFinalized);
// 'b' is not modal, so if we have either a temporaryColleagueParam,
// or a sequecner, or both, we need to preprocess them, before showing the menu.
// We also need to do some post-processing with them, after the menu closes.
// That is done in the OnContextMenuClose handler.
if (m_temporaryColleagueParam != null)
m_temporaryColleagueParam.Mediator.AddTemporaryColleague(m_temporaryColleagueParam.TemporaryColleague);
m_sequencerIsPaused = false;
//if (m_sequencer != null)
// m_sequencerIsPaused = m_sequencer.PauseMessageQueueing();
b.Popup(location.X, location.Y);
}
示例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);
}