Ejemplo n.º 1
0
 public abstract void HandleMouseDown(GLMouseEvent e);
Ejemplo n.º 2
0
 public abstract void HandleMouseMove(GLMouseEvent e);
Ejemplo n.º 3
0
 public override void HandleMouseMove(GLMouseEvent e)
 {
   if((e.Buttons & MouseButtons.Left) != 0)
   {
     if(this.CurrentMode == Mode.TRANSLATE)
     {
       this.Position += e.Offset;
     }
     else if(this.CurrentMode == Mode.ROTATE)
     {
       Vector2f offset = e.Location - this.Position;
       this.Angle = offset.Angle;
     }
   }
 }
Ejemplo n.º 4
0
 public override void HandleMouseDown(GLMouseEvent e)
 {
   if((e.Buttons & MouseButtons.Left) != 0)
   {
     m_Mode = Mode.TRANSLATE;
     if(this.AngleCircle.CheckPointInside(e.Location))
     {
       m_Mode = Mode.ROTATE;
     }
   }
 }
Ejemplo n.º 5
0
 protected override void OnMouseUp(object sender, GLMouseEvent e)
 {
   base.OnMouseUp(sender, e);
   if(e.Buttons == MouseButtons.Left)
   {
     if(this.SelectedScene != null)
     {
       if(this.ActiveTemplate != null)
       {
         Shape shape = this.SelectedScene.CreateShape(this.ActiveTemplate.Name);
         shape.Template = this.ActiveTemplate;
         shape.Position = e.Location;
       }
     }
   }
   else if(e.Buttons == MouseButtons.Right)
   {
     this.ActiveTemplate = null;
     this.SelectedShape = null;
   }
 }
Ejemplo n.º 6
0
 private void OnMouseLeave(object sender, GLMouseEvent e)
 {
   this.TemplatePreviewPos = e.Location;
 }
Ejemplo n.º 7
0
 protected override void OnMouseMove(object sender, GLMouseEvent e)
 {
   base.OnMouseMove(sender, e);
   this.TemplatePreviewPos = e.Location;
 }
Ejemplo n.º 8
0
 protected override void OnMouseDown(object sender, GLMouseEvent e)
 {
   if(this.ActiveTemplate == null)
   {
     base.OnMouseDown(sender, e);
   }
 }
Ejemplo n.º 9
0
 protected virtual void OnMouseUp(object sender, GLMouseEvent e)
 {
 }
Ejemplo n.º 10
0
 protected virtual void OnMouseMove(object sender, GLMouseEvent e)
 {
   if(this.SelectedManip != null)
   {
     this.SelectedManip.HandleMouseMove(e);
   }
 }
Ejemplo n.º 11
0
 protected virtual void OnMouseDown(object sender, GLMouseEvent e)
 {
   if(e.Buttons == MouseButtons.Left)
   {
     if(m_ShapeSelectedHandler != null)
     {
       bool delayed;
       Shape shape = FindShape(e.Location, e.Shift, out delayed);
       if(shape != null || delayed)
       {
         m_ShapeSelectedHandler(this, shape);
         m_ShapeSelectedHandler = null;
       }
     }
     else
     {
       Shape shape = FindShape(e.Location, e.Control);
       if(this.SelectedShape == shape && shape != null && e.Shift)
       {
         Shape shapeClone = shape.Clone();
         this.SelectedShape = shapeClone;
         SpatialManip manip = SelectSpatialManip(e.Location);
         if(manip != null)
         {
           this.SelectedManip = manip;
         }
         
         if(this.SelectedManip != null)
         {
           this.SelectedManip.HandleMouseDown(e);
         }
       }
       else if(this.SelectedShape == shape)
       {
         SpatialManip manip = SelectSpatialManip(e.Location);
         if(manip != null)
         {
           this.SelectedManip = manip;
         }
         
         if(this.SelectedManip != null)
         {
           this.SelectedManip.HandleMouseDown(e);
         }
       }
       else if(shape != null)
       {
         this.SelectedShape = shape;
       }
     }
   }
 }