Ejemplo 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);
            }
        }
Ejemplo n.º 2
0
 private void ToolBox_MouseLeave(object sender, EventArgs e)
 {
     if (ShowTooltip)
     {
         toolTip.Hide(this);
     }
     HoverNode = null;
     this.Refresh();
 }
Ejemplo 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();
        }
Ejemplo 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);
 }
Ejemplo 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)));
 }
Ejemplo n.º 6
0
 public abstract bool Show(ToolBoxNode node);
Ejemplo n.º 7
0
 private void ToolBox_MouseLeave(object sender, EventArgs e)
 {
     toolTip.Hide(this);
     HoverNode = null;
     this.Refresh();
 }
Ejemplo 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); 
        }
Ejemplo 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)));
 }
Ejemplo n.º 10
0
 public abstract bool Show(ToolBoxNode node);
Ejemplo 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;
        }
Ejemplo n.º 12
0
 public override bool Show(ToolBoxNode node)
 {
     return (node.Tag != null && SmartFactory.GetInstance().IsEventValidType(node.Tag.ToString(), Type));
 }
Ejemplo 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;
        }