本文整理汇总了C#中DevComponents.DotNetBar.BaseItem.InternalMouseEnter方法的典型用法代码示例。如果您正苦于以下问题:C# BaseItem.InternalMouseEnter方法的具体用法?C# BaseItem.InternalMouseEnter怎么用?C# BaseItem.InternalMouseEnter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DevComponents.DotNetBar.BaseItem
的用法示例。
在下文中一共展示了BaseItem.InternalMouseEnter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ExpandItem
private void ExpandItem(BaseItem objItem)
{
// Set the focus here so it can be properly released...
Control cc = this.ContainerControl as Control;
//if(bar!=null && !bar.Focused) // Commented out to fix menu bar taking the focus
// bar.Focus();
if (cc is Bar && !cc.Focused)
((Bar)cc).MenuFocus = true;
if(m_HotSubItem!=null)
m_HotSubItem.InternalMouseLeave();
m_HotSubItem=objItem;
objItem.InternalMouseEnter();
objItem.InternalMouseMove(new MouseEventArgs(MouseButtons.None, 0, objItem.LeftInternal + 2, objItem.TopInternal + 2, 0));
objItem.Expanded=true;
if(objItem is PopupItem)
{
this.AutoExpand=true;
// If it is a menu select first menu item inside...
PopupItem popup=objItem as PopupItem;
if(popup.PopupType==ePopupType.Menu && popup.PopupControl is MenuPanel)
{
((MenuPanel)popup.PopupControl).SelectFirstItem();
}
}
}
示例2: ExKeyDown
internal void ExKeyDown(KeyEventArgs e)
{
if(m_ParentItem==null || m_ParentItem.SubItems.Count==0 || m_ParentItem.DesignMode)
return;
if(m_HotSubItem==null || m_HotSubItem!=null && !m_HotSubItem.Expanded)
{
if(e.KeyCode==Keys.Down)
{
if (m_ParentItem is ItemContainer)
{
m_ParentItem.InternalKeyDown(e);
}
else
{
if (m_HotSubItem is ItemContainer)
m_HotSubItem.InternalKeyDown(e);
if (!e.Handled)
{
int i = 0;
if (m_HotSubItem != null)
{
m_HotSubItem.InternalMouseLeave();
i = m_ParentItem.SubItems.IndexOf(m_HotSubItem) + 1;
if (i == m_ParentItem.SubItems.Count && m_ExpandButton.ShowExpandButton)
{
m_ExpandButton.MouseOver = true;
RefreshExpandButton();
}
else if (i < 0 || i == m_ParentItem.SubItems.Count)
{
i = 0;
}
m_HotSubItem = null;
}
else if (m_ExpandButton.MouseOver)
{
m_ExpandButton.MouseOver = false;
RefreshExpandButton();
i = 0;
}
BaseItem objTmp;
for (int f = i; f < m_ParentItem.SubItems.Count; f++)
{
objTmp = m_ParentItem.SubItems[f];
if (objTmp.Displayed && objTmp.Visible && CanGetMouseFocus(objTmp))
{
m_HotSubItem = objTmp;
m_HotSubItem.InternalMouseEnter();
m_HotSubItem.InternalMouseMove(new MouseEventArgs(MouseButtons.None, 0, m_HotSubItem.LeftInternal + 2, m_HotSubItem.TopInternal + 2, 0));
if (m_HotSubItem.IsContainer)
m_HotSubItem.InternalKeyDown(e);
break;
}
}
if (m_HotSubItem == null && m_ExpandButton.ShowExpandButton && !m_ExpandButton.MouseOver)
{
m_ExpandButton.MouseOver = true;
RefreshExpandButton();
}
}
}
e.Handled=true;
m_IgnoreDuplicateMouseMove=true;
}
else if(e.KeyCode==Keys.Up)
{
if (m_ParentItem is ItemContainer)
{
m_ParentItem.InternalKeyDown(e);
}
else
{
if (m_HotSubItem is ItemContainer)
m_HotSubItem.InternalKeyDown(e);
if (!e.Handled)
{
int i = 0;
if (m_HotSubItem != null)
{
m_HotSubItem.InternalMouseLeave();
i = m_ParentItem.SubItems.IndexOf(m_HotSubItem) - 1;
if (i < 0 && m_ExpandButton.ShowExpandButton)
{
m_ExpandButton.MouseOver = true;
RefreshExpandButton();
}
else if (i < 0)
i = m_ParentItem.SubItems.Count - 1;
m_HotSubItem = null;
}
else if (m_ExpandButton.MouseOver)
{
m_ExpandButton.MouseOver = false;
RefreshExpandButton();
i = m_ParentItem.SubItems.Count - 1;
}
else if (m_ExpandButton.ShowExpandButton)
{
//.........这里部分代码省略.........
示例3: ProcessContainerAccessKey
private bool ProcessContainerAccessKey(BaseItem container, char key)
{
List<BaseItem> itemsForMnemonic = GetItemsForMnemonic(container, key);
if (itemsForMnemonic.Count > 1)
{
// Special processing for case when more than one item uses same mnemonic key
BaseItem newHotSubitem = null;
if (m_HotSubItem == null)
newHotSubitem = itemsForMnemonic[0];
else
{
int hotItemIndex = itemsForMnemonic.IndexOf(m_HotSubItem);
if (hotItemIndex == -1)
newHotSubitem = itemsForMnemonic[0];
else
{
if (hotItemIndex == itemsForMnemonic.Count - 1)
hotItemIndex = 0;
else
hotItemIndex++;
newHotSubitem = itemsForMnemonic[hotItemIndex];
}
}
if (newHotSubitem != null)
{
if (m_HotSubItem != null)
m_HotSubItem.InternalMouseLeave();
m_HotSubItem = newHotSubitem;
m_HotSubItem.InternalMouseEnter();
m_HotSubItem.InternalMouseMove(new MouseEventArgs(MouseButtons.None, 0, m_HotSubItem.LeftInternal + 2, m_HotSubItem.TopInternal + 2, 0));
}
return true;
}
BaseItem item = GetItemForMnemonic(container, key, true);
if (item!=null && item.GetEnabled() && item.Visible)
{
if (item is ItemContainer)
{
this.ShowKeyTips = false;
this.HotSubItem = item;
}
else if (item.SubItems.Count > 0 && item.ShowSubItems && !item.Expanded)
{
if (m_HotSubItem != item)
{
if (m_HotSubItem != null)
m_HotSubItem.InternalMouseLeave();
m_HotSubItem = item;
m_HotSubItem.InternalMouseEnter();
m_HotSubItem.InternalMouseMove(new MouseEventArgs(MouseButtons.None, 0, m_HotSubItem.LeftInternal + 2, m_HotSubItem.TopInternal + 2, 0));
}
item.Expanded = true;
if (item is PopupItem && ((PopupItem)item).PopupControl is MenuPanel)
{
((MenuPanel)((PopupItem)item).PopupControl).SelectFirstItem();
}
m_IgnoreDuplicateMouseMove = true;
}
else
{
this.ShowKeyTips = false;
if (item is ComboBoxItem)
{
((ComboBoxItem)item).ComboBoxEx.Focus();
((ComboBoxItem)item).ComboBoxEx.DroppedDown = true;
}
else if (item is TextBoxItem)
{
((TextBoxItem)item).TextBox.Focus();
}
else if (item is ControlContainerItem && ((ControlContainerItem)item).Control != null)
((ControlContainerItem)item).Control.Focus();
else
item.RaiseClick();
}
return true;
}
return false;
}
示例4: OnMouseLeave
protected override void OnMouseLeave(EventArgs e)
{
if(m_ParentItem!=null && m_ParentItem.DesignMode || m_ParentItem==null)
return;
// If we had hot sub item pass the mouse leave message to it...
if(m_HotSubItem!=null) // && !m_HotSubItem.Expanded)
{
// Handle the case when child control of the item gets the mouse
Point mp=this.PointToClient(Control.MousePosition);
if (!m_HotSubItem.DisplayRectangle.Contains(mp))
{
if (!(m_HotSubItem is PopupItem && m_HotSubItem.Expanded))
{
m_HotSubItem.InternalMouseLeave();
m_HotSubItem = null;
}
}
}
else if(m_ExpandButton.ShowExpandButton && m_ExpandButton.MouseOver)
{
m_ExpandButton.MouseOver=false;
RefreshExpandButton();
}
if (m_HotSubItem == null)
{
BaseItem exp = ExpandedItem();
if (exp != null && exp is PopupItem)
{
m_HotSubItem = exp;
m_HotSubItem.InternalMouseEnter();
m_HotSubItem.InternalMouseMove(new MouseEventArgs(MouseButtons.None, 0, m_HotSubItem.DisplayRectangle.X+4, m_HotSubItem.DisplayRectangle.Y+4, 0));
}
}
base.OnMouseLeave(e);
}