示例#1
0
        private void ShowToolTip()
        {
            int        index = -1;
            BarSubItem item  = null;

            for (int i = 0; i < ToolTipList.Count; i++)
            {
                item = ToolTipList[i].ToolTipItem;
                link = item.Links[0] as BarSubItemLink;
                if (ExampleHelper.GlyphContainsCursor(link))
                {
                    index = i;
                    break;
                }
            }

            if (index != -1)
            {
                ToolTipControllerShowEventArgs args = new ToolTipControllerShowEventArgs()
                {
                    ToolTipLocation = ToolTipLocation.Fixed, SuperTip = new SuperToolTip()
                };
                args.SuperTip.Items.Add(itemsAndLinks.ContainsKey(item) ? ToolTipList[index].RemoveToolTip : ToolTipList[index].AddToolTip);
                Point linkPoint = ExampleHelper.GetToolTipLocation(link);
                barManger.GetToolTipController().ShowHint(args, linkPoint);
                isToolTipShown = true;
            }
        }
示例#2
0
 private void HideToolTipIfRequired()
 {
     if (isToolTipShown && !ExampleHelper.GlyphContainsCursor(link))
     {
         HideToolTip();
     }
 }
示例#3
0
 private void AddToFavorites(ItemClickEventArgs e)
 {
     if (ExampleHelper.GlyphContainsCursor(e.Link as BarSubItemLink))
     {
         bool inFavorites = true;
         if (barSubItem2.ContainsItem(e.Item))
         {
             inFavorites = false;
             barSubItem2.ItemLinks.Remove(itemsAndLinks[e.Item]);
             itemsAndLinks.Remove(e.Item);
         }
         else
         {
             itemsAndLinks[e.Item] = barSubItem2.ItemLinks.Add(e.Item);
         }
         e.Item.Glyph = ExampleHelper.GetImage(inFavorites);
     }
 }