Example #1
0
        private void ClickHandler(EntityMouseEventArgs e)
        {
            #region Test the main expansion icon
            RectangleF collapseRect = new RectangleF(((int)(Rectangle.Right - 20)), ((int)(Rectangle.Y + 5)), 16, 16);

            if (collapseRect.Contains(e.X, e.Y))
            {
                //switch the main state
                if (collapsed) //expand
                {
                    collapsed = false;
                    cBottom.Move(0, Rectangle.Top + bodyHeight + 50 + 10 - cBottom.Point.Y);
                    cLeft.Move(0, Rectangle.Top + bodyHeight / 2 + 30 - cLeft.Point.Y);
                    cRight.Move(0, Rectangle.Top + bodyHeight / 2 + 30 - cRight.Point.Y);
                    //cBottom.Point = new Point((int) (Rectangle.Left+Rectangle.Width/2),Rectangle.Top + rec+70);
                }
                else //collapse
                {
                    collapsed = true;                   //set main collapsed off
                    //cBottom.Point = new Point((int) (Rectangle.Left+Rectangle.Width/2),Rectangle.Top+50);
                    cBottom.Move(0, Rectangle.Top + 50 - cBottom.Point.Y);
                    cLeft.Move(0, Rectangle.Top + 25 - cLeft.Point.Y);
                    cRight.Move(0, Rectangle.Top + 25 - cRight.Point.Y);
                }



                this.Invalidate();
                return;
            }

            #endregion
        }
Example #2
0
 public void RaiseOnMouseDown(EntityMouseEventArgs e)
 {
     if (OnMouseDown != null)
     {
         OnMouseDown(this, e);
     }
 }
Example #3
0
 private void ClassShape_Click(object shape, EntityMouseEventArgs e)
 {
     ClickHandler(e);
 }