Пример #1
0
        private void PreviewMouseMove_scrollstretch(object sender, MouseEventArgs e)
        {
            Point  p      = e.GetPosition(axiscontrol_time);
            double deltax = p.X - this.dragpoint.X;
            double deltay = p.Y - this.dragpoint.Y;

            if (e.LeftButton == MouseButtonState.Pressed || e.MiddleButton == MouseButtonState.Pressed)
            {
                // erst stretchen, dann scrollen!
                ////RendererManager.Stretch(dragtimestretch - 0.05 * deltay);
                ////RendererManager.Stretch(dragtimestretch - deltay * 0.001 * RendererManager.TimeMax);
                RendererManager.Stretch(this.dragtimestretch - (deltay * 0.005 * this.dragtimestretch));

                RendererManager.Scroll(this.dragtime - (RendererManager.TimeStretch * p.X / axiscontrol_time.ActualWidth));
            }
            else
            {
                // nix mehr gedrückt, handler deinstallieren
                Mouse.Capture(null);
                this.PreviewMouseMove    -= this.PreviewMouseMove_scrollstretch;
                this.dragwatcherinstalled = false;
            }

            e.Handled = true;
        }
Пример #2
0
        private void Executed_CmdChangeTimeZoom(object sender, ExecutedRoutedEventArgs e)
        {
            string param = (string)e.Parameter;

            if (param.Equals("all"))
            {
                RendererManager.Scroll(0.0);
                RendererManager.Stretch(RendererManager.TimeMax);
            }
            else if (param.Equals("selection"))
            {
                if (this.SelectionStart != this.SelectionEnd)
                {
                    RendererManager.Scroll(this.SelectionStart);
                    RendererManager.Stretch(this.SelectionEnd - this.SelectionStart);
                }
            }
            else
            {
                // Parameter ist ein Zeitwert in Sekunden
                RendererManager.Stretch(double.Parse(param));
            }
        }