Ejemplo n.º 1
0
        private void OnMouseDown(object sender, MouseEventArgs e)
        {
            RibbonControl ribbonControl = sender as RibbonControl;

            hitInfo = ribbonControl.CalcHitInfo(e.Location);
            if (!hitInfo.InToolbar || hitInfo.Item == null || hitInfo.Item is DevExpress.XtraBars.Ribbon.Internal.RibbonQuickToolbarBarItemLink)
            {
                hitInfo = null;
            }
        }
Ejemplo n.º 2
0
 private void ToolTipController_GetActiveObjectInfo(object sender, ToolTipControllerGetActiveObjectInfoEventArgs e)
 {
     if (e.SelectedControl == RibbonControl)
     {
         RibbonHitInfo hitInfo = RibbonControl.CalcHitInfo(e.ControlMousePosition);
         if (hitInfo.InItem && hitInfo.Item is BarStaticItemLink)
         {
             e.Info = null;                             // don't show tooltip that is the same text as the BarStaticItemLlink
         }
     }
 }
Ejemplo n.º 3
0
        private void OnDragOver(object sender, DragEventArgs e)
        {
            RibbonControl ribbonControl = sender as RibbonControl;
            Point         point         = ribbonControl.PointToClient(new Point(e.X, e.Y));
            RibbonHitInfo hitInfo       = ribbonControl.CalcHitInfo(point);

            e.Effect = DragDropEffects.None;
            if (hitInfo.InToolbar && hitInfo.Item != null && !(hitInfo.Item is DevExpress.XtraBars.Ribbon.Internal.RibbonQuickToolbarBarItemLink))
            {
                e.Effect = DragDropEffects.Move;
            }
        }
Ejemplo n.º 4
0
        private void OnDragDrop(object sender, DragEventArgs e)
        {
            RibbonControl ribbonControl = sender as RibbonControl;
            Point         point         = ribbonControl.PointToClient(new Point(e.X, e.Y));
            RibbonHitInfo hitInfo       = ribbonControl.CalcHitInfo(point);
            BarItemLink   targetLink    = hitInfo.Item;

            if (hitInfo.InToolbar && targetLink != null && !targetLink.Equals(link))
            {
                ReorderItems(ribbonControl, targetLink);
            }
            link = null;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// 作用:鼠标在RibbonControl控件上移动时触发的事件
        /// 作者:汪建龙
        /// 编写时间:2016年12月19日12:56:44
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        public void ribbonControl_MouseMove(object sender, MouseEventArgs e)
        {
            try
            {
                RibbonControl ribbonControl = sender as RibbonControl;
                if (ribbonControl == null || e == null)
                {
                    return;
                }

                RibbonHitInfo hitInfo = ribbonControl.CalcHitInfo(new System.Drawing.Point(e.X, e.Y));
                if (hitInfo.InItem)
                {
                    BarButtonItem item = hitInfo.Item.Item as BarButtonItem;
                    if (item != null && item.Tag is IUICommand)
                    {
                        item.Hint = (item.Tag as IUICommand).Tooltip;
                    }
                }
            }catch (Exception ex)
            {
                //LogManager.Log.LogError(ex.ToString());
            }
        }