Exemple #1
0
        protected override void OnKeyUp(KeyEventArgs args)
        {
            base.OnKeyUp(args);
            if (args.KeyCode == Keys.Enter)
            {
                DataEventList_MouseDoubleClick(null, null);
                return;
            }
            if (args.KeyCode != Keys.Up &&
                args.KeyCode != Keys.Down &&
                args.KeyCode != Keys.Left &&
                args.KeyCode != Keys.Right)
            {
                return;
            }
            toolTipIndex = SelectedIndex;
            if (toolTipIndex < 0)
            {
                return;
            }
            ignoreMouse = true;
            DataEvent e = Items[toolTipIndex] as DataEvent;

            EventListToolTip.Show(string.Format(XenAPI.Message.FriendlyBody(e.Message.Type.ToString()), Helpers.GetName(e.xo)),
                                  this,
                                  -10,
                                  (toolTipIndex - TopIndex + 1) * ItemHeight + 2);
        }
Exemple #2
0
 protected override void OnMouseMove(MouseEventArgs args)
 {
     base.OnMouseMove(args);
     if (ignoreMouse)
     {
         return;
     }
     try
     {
         int itemIndex = -1;
         if (ItemHeight != 0)
         {
             itemIndex  = args.Y / ItemHeight;
             itemIndex += TopIndex;
         }
         if ((itemIndex >= 0) && (itemIndex < Items.Count))
         {
             if (itemIndex == toolTipIndex)
             {
                 return;
             }
             DataEvent e = Items[itemIndex] as DataEvent;
             if (e == null)
             {
                 EventListToolTip.Hide(this);
                 toolTipIndex = -1;
             }
             else
             {
                 toolTipIndex = itemIndex;
                 EventListToolTip.Show(string.Format(XenAPI.Message.FriendlyBody(e.Message.Type.ToString()), Helpers.GetName(e.xo)),
                                       this,
                                       -10,
                                       (toolTipIndex - TopIndex + 1) * ItemHeight + 2);
             }
         }
         else
         {
             EventListToolTip.Hide(this);
             toolTipIndex = -1;
         }
     }
     catch
     {
         EventListToolTip.Hide(this);
         toolTipIndex = -1;
     }
 }
Exemple #3
0
 protected override void OnLostFocus(EventArgs e)
 {
     base.OnLostFocus(e);
     EventListToolTip.Hide(this);
     toolTipIndex = -1;
 }
Exemple #4
0
 protected override void OnMouseLeave(EventArgs e)
 {
     base.OnMouseLeave(e);
     EventListToolTip.Hide(this);
     toolTipIndex = -1;
 }