Ejemplo n.º 1
0
        private void HumanForm_KeyDown(object sender, KeyEventArgs e)
        {
            switch (e.KeyCode)
            {
            case Keys.Back: tf.RecreateTrack(t.trackType); break;

            case Keys.D1: tf.RecreateTrack(1); break;

            case Keys.D2: tf.RecreateTrack(2); break;

            case Keys.D3: tf.RecreateTrack(3); break;

            case Keys.D4: tf.RecreateTrack(4); break;

            case Keys.D5: tf.RecreateTrack(5); break;

            case Keys.D6: tf.RecreateTrack(6); break;

            case Keys.D7: tf.RecreateTrack(7); break;

            case Keys.D8: tf.RecreateTrack(8); break;

            case Keys.D9: tf.RecreateTrack(9); break;

            case Keys.D0: tf.RecreateTrack(0); break;

            case Keys.P: TrackForm.ToggleForm(tf.pf); break;

            case Keys.H: Hide(); break;

            case Keys.C: tf.ChamferTrack(); break;

            case Keys.Q: quality = !quality; RedrawBackground(); break;

            case Keys.D: drawPortraits = !drawPortraits; tf.gd.Refresh(false, false, true); break;

            case Keys.Enter: tf.pf.ResizeWindow(0, 0, true); break;

            case Keys.Space: tf.pf.Recreate(t, true); break;

            case Keys.PageUp: ResizeWindow(windowWScale * Program.HUMAN_DIAGRAM_RESIZE_FACTOR, windowHScale * Program.HUMAN_DIAGRAM_RESIZE_FACTOR); break;

            case Keys.PageDown: ResizeWindow(windowWScale / Program.HUMAN_DIAGRAM_RESIZE_FACTOR, windowHScale / Program.HUMAN_DIAGRAM_RESIZE_FACTOR); break;

            case Keys.S: ResizeWindow(windowWScale, windowHScale * Program.HUMAN_DIAGRAM_RESIZE_FACTOR); break;

            case Keys.A: ResizeWindow(windowWScale, windowHScale / Program.HUMAN_DIAGRAM_RESIZE_FACTOR); break;

            case Keys.X: ResizeWindow(windowWScale * Program.HUMAN_DIAGRAM_RESIZE_FACTOR, windowHScale); break;

            case Keys.Z: ResizeWindow(windowWScale / Program.HUMAN_DIAGRAM_RESIZE_FACTOR, windowHScale); break;

            case Keys.R: ResizeWindow(1, 1); break;

            case Keys.Up: tf.gd.hfDiagramScale *= Program.FEATURE_RESIZE_FACTOR; RedrawBackground(); break;

            case Keys.Down: tf.gd.hfDiagramScale /= Program.FEATURE_RESIZE_FACTOR; RedrawBackground(); break;
            }
        }
Ejemplo n.º 2
0
 public PuppyForm(TrackForm tf)
 {
     this.tf = tf;
     t       = tf.t;
     InitializeComponent();
     Recreate(t);
     Location = new System.Drawing.Point(tf.Size.Width, 0);
     Show();
 }
Ejemplo n.º 3
0
 public HumanForm(TrackForm tf)
 {
     this.tf = tf;
     t       = tf.t;
     InitializeComponent();
     Recreate(t);
     Location = new System.Drawing.Point(0, tf.Size.Height);
     Show();
 }
Ejemplo n.º 4
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);
     }
 }
Ejemplo n.º 5
0
        /*        private Font tokenFont;
         *      private Brush tokenFontBrush = new SolidBrush(Color.Black);
         *      private StringFormat tokenFormat = new StringFormat()
         *      {
         *          Alignment = StringAlignment.Center,
         *          LineAlignment = StringAlignment.Center,
         *      };*/

        /*private double arrowLength;
         * private double arrowWidth;
         * private Brush arrowBrush = new SolidBrush(Color.Green);*/

        public GraphicsData(TrackForm tf)
        {
            this.tf = tf;
            UpdateSize();
            SetFeatureScale(Program.INITIAL_FEATURE_SCALE);
            SetScale(Program.INITIAL_TRACK_SCALE);
            linePen.LineJoin = LineJoin.Round;
            dashPenT.SetLineCap(LineCap.Flat, LineCap.Flat, DashCap.Flat);
            dashPenT.DashPattern = new float[] { 2, 2 };
            dashPenN.SetLineCap(LineCap.Flat, LineCap.Flat, DashCap.Flat);
            dashPenN.DashPattern = new float[] { 2, 2 };
            diagramPen.SetLineCap(LineCap.Round, LineCap.Round, DashCap.Flat);
            arrowCap = new AdjustableArrowCap((float)(Program.ARROW_W_SIZE / Program.ARROW_LINE_THICKNESS), (float)(Program.ARROW_H_SIZE / Program.ARROW_LINE_THICKNESS));
        }
Ejemplo n.º 6
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;
     }
 }
Ejemplo n.º 7
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;
     }
 }