Inheritance: Drawable, MouseOverable
Exemple #1
0
        public Circle(Component compontent, int radius, int circleWidth, Point center, Color color)
        {
            this.component = compontent;
            this.radius = radius;
            this.circleWidth = circleWidth;

            this.center = center;
            this.outerRadius = radius * 2 + 2;
            this.color = color;
        }
        public void OnMouseMotion(MouseEvent e)
        {
            foreach (ParentComponent pc in this.componentList)
            {
                Component mouseOver = pc.GetComponentAt(e.location);

                if( previousMouseOver != null && previousMouseOver != mouseOver ) FireMouseExitEvents(e);
                if (mouseOver != null)
                {
                    if (!mouseOver.isMouseOver)
                    {
                        ((MouseOverable)mouseOver).OnMouseEnter(e);
                    }
                    previousMouseOver = mouseOver;
                }

            }
        }
Exemple #3
0
        public void OnMouseMotion(MouseEvent e)
        {
            LinkedList<ParentComponent> sortedList = this.SortComponentsByZ(this.componentList, false);

            foreach (ParentComponent pc in sortedList)
            {
                Component mouseOver = pc.GetComponentAt(e.location);

                if (previousMouseOver != null && previousMouseOver != mouseOver) previousMouseOver.OnMouseExit(e);

                //FireMouseExitEvents(e);
                if (mouseOver != null)
                {
                    if (!mouseOver.isMouseOver)
                    {
                        ((MouseOverable)mouseOver).OnMouseEnter(e);
                    }
                    previousMouseOver = mouseOver;
                    break;
                }
            }
        }
Exemple #4
0
 public Border(Component parent, int width, Color color)
 {
     this.parent = parent;
     this.width = width;
     this.color = color;
 }
Exemple #5
0
 /// <summary>
 /// Removes a child from this component.
 /// </summary>
 /// <param name="component">The component to remove.</param>
 /// <returns>Whether the child was removed or not.</returns>
 public Boolean RemoveChild(Component component)
 {
     if (this.children.Contains(component))
     {
         component.parent = null;
         this.children.Remove(component);
         return true;
     }
     else return false;
 }
Exemple #6
0
 /// <summary>
 /// Adds a child to this component.
 /// </summary>
 /// <param name="component">The component to add to this parent component</param>
 public void AddChild(Component component)
 {
     this.children.AddLast(component);
     component.parent = this;
 }
Exemple #7
0
 /// <summary>
 /// DO NOT USE THIS FUNCTION UNLESS YOU WANT TO HAVE A NICE FAT EXCEPTION.
 /// </summary>
 /// <param name="c">F**k you</param>
 public new Boolean RemoveChild(Component c)
 {
     throw new NotSupportedException("Use RemoveChild(String optionName) instead.");
 }
Exemple #8
0
 /// <summary>
 /// DO NOT USE THIS FUNCTION UNLESS YOU WANT TO HAVE A NICE FAT EXCEPTION.
 /// </summary>
 /// <param name="c">F**k you</param>
 public new void AddChild(Component c)
 {
     throw new NotSupportedException("Use AddChild(String optionName) instead.");
 }