Пример #1
0
 private void HumanForm_MouseDown(object sender, MouseEventArgs e)
 {
     LineOnMouse(e);
     if ((e.Button & MouseButtons.Left) == MouseButtons.Left && TrackForm.IsControlDown())
     {
         mouseX = e.X;
     }
     if ((e.Button & MouseButtons.Right) == MouseButtons.Right)
     {
         mouseOffset = new System.Drawing.Point(-e.X, -e.Y);
     }
 }
Пример #2
0
 private void HumanForm_MouseMove(object sender, MouseEventArgs e)
 {
     LineOnMouse(e);
     if ((e.Button & MouseButtons.Left) == MouseButtons.Left && TrackForm.IsControlDown())
     {
         xOffset = (xOffset + ((double)e.X - mouseX) / ClientSize.Width).Frac();
         mouseX  = e.X;
         tf.gd.Refresh(false, false, true);
     }
     if ((e.Button & MouseButtons.Right) == MouseButtons.Right)
     {
         System.Drawing.Point mousePos = Control.MousePosition;
         mousePos.Offset(mouseOffset);
         Location = mousePos;
     }
 }
Пример #3
0
 private void LineOnMouse(MouseEventArgs e)
 {
     if ((e.Button & MouseButtons.Left) == MouseButtons.Left && !TrackForm.IsControlDown())
     {
         if (tf.gd == null || t == null)
         {
             return;
         }
         tf.gd.drawNormal = true;
         tf.gd.normalX    = ((double)e.X / ClientSize.Width).Frac();
         tf.gd.Refresh(true, false, true);
     }
     else if (tf.gd.drawNormal)
     {
         mouseX           = e.X;
         tf.gd.drawNormal = false;
     }
 }