Esempio n. 1
0
        private void ToolBox_MouseMove(object sender, MouseEventArgs e)
        {
            ToolBoxNode node = GetNodeAt(e.X, e.Y);

            if (node == null || node.Tag == null)
            {
                if (ShowTooltip)
                {
                    toolTip.Hide(this);
                }
                HoverNode = node;
                this.Refresh();
                return;
            }

            if (HoverNode == node)
            {
                return;
            }

            HoverNode = node;
            this.Refresh();
            if (ShowTooltip)
            {
                toolTip.ToolTipTitle = node.Text;
                toolTip.Show(node.Tag.ToString() + " (" + node.Tag2.ToString() + ")", this, 0, node.Bounds.Bottom + 15);
            }
        }
Esempio n. 2
0
 private void ToolBox_MouseLeave(object sender, EventArgs e)
 {
     if (ShowTooltip)
     {
         toolTip.Hide(this);
     }
     HoverNode = null;
     this.Refresh();
 }
Esempio n. 3
0
        private void SelectNodeAt(int x, int y, ICollection nodes)
        {
            ToolBoxNode node = GetNodeAt(x, y, nodes);

            if (node == null)
            {
                return;
            }
            SelectedNode = node;
            this.Refresh();
        }
Esempio n. 4
0
 private ToolBoxNode GetNodeAt(int x, int y, ICollection nodes)
 {
     foreach (ToolBoxNode node in nodes)
     {
         if (node.Bounds.Contains(x, y) && node.IsVisible)
         {
             ToolBoxNode potential_node = GetNodeAt(x, y, node.Nodes);
             if (potential_node == null)
             {
                 return(node);
             }
             else
             {
                 return(potential_node);
             }
         }
     }
     return(null);
 }
Esempio n. 5
0
 public override bool Show(ToolBoxNode node)
 {
     return (Text == null || node.Text.ToLower().Contains(Text) || (node.Tag != null && node.Tag.ToString().ToLower().Contains(Text)));
 }
Esempio n. 6
0
 public abstract bool Show(ToolBoxNode node);
Esempio n. 7
0
 private void ToolBox_MouseLeave(object sender, EventArgs e)
 {
     toolTip.Hide(this);
     HoverNode = null;
     this.Refresh();
 }
Esempio n. 8
0
        private void ToolBox_MouseMove(object sender, MouseEventArgs e)
        {
            ToolBoxNode node = GetNodeAt(e.X, e.Y);
            if (node == null || node.Tag == null)
            {
                toolTip.Hide(this);
                HoverNode = node;
                this.Refresh();
                return;
            }

            if (HoverNode == node)
                return;

            HoverNode = node;
            this.Refresh();
            toolTip.ToolTipTitle = node.Text;
            toolTip.Show(node.Tag.ToString(), this, 0, node.Bounds.Bottom+15); 
        }
Esempio n. 9
0
 public override bool Show(ToolBoxNode node)
 {
     return(Text == null || node.Text.ToLower().Contains(Text) || (node.Tag != null && node.Tag.ToString().ToLower().Contains(Text)) || (node.Tag2 != null && node.Tag2.ToString().ToLower().Contains(Text)));
 }
Esempio n. 10
0
 public abstract bool Show(ToolBoxNode node);
Esempio n. 11
0
        private ToolBoxNode GetNewToolChildNode(string line)
        {
            int comma = line.IndexOf(",");
            ToolBoxNode child = null;
            if (comma > 0)
            {
                child = new ToolBoxNode(line.Substring(0, comma));
                child.Tag = line.Substring(comma + 1);
            }
            else
            {
                child = new ToolBoxNode(line);
                child.AlwaysExpand = true;
            }

            return child;
        }
Esempio n. 12
0
 public override bool Show(ToolBoxNode node)
 {
     return (node.Tag != null && SmartFactory.GetInstance().IsEventValidType(node.Tag.ToString(), Type));
 }
Esempio n. 13
0
        private ToolBoxNode GetNewToolChildNode(string line)
        {
            int comma = line.IndexOf(",");
            ToolBoxNode child = null;
            if (comma > 0)
            {
                child = new ToolBoxNode(line.Substring(0, comma));
                child.Tag = line.Substring(comma + 1);
                Dictionary<SmartType, Dictionary<string, int>> smart_name_to_id = SmartFactory.GetInstance().smart_name_to_id;
                child.Tag2 = SmartFactory.GetInstance().NameToId(type, line.Substring(comma + 1));
            }
            else
            {
                child = new ToolBoxNode(line);
                child.AlwaysExpand = true;
            }

            return child;
        }