diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-04-08 16:55:37 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-04-08 16:55:37 +0300 |
| commit | 17a77c30765fe8a0d3ca57a9ec60fb43b82432d2 (patch) | |
| tree | 54881e3de14aaef3ad5e699f28d903a11a024b57 /Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Controls | |
| parent | b3bc15a29d8fff24edc5bcd4576e18c9141f76a6 (diff) | |
| download | Tango-17a77c30765fe8a0d3ca57a9ec60fb43b82432d2.tar.gz Tango-17a77c30765fe8a0d3ca57a9ec60fb43b82432d2.zip | |
Implemented timeline events !
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Controls')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Controls/TimelineScrollViewer.cs | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Controls/TimelineScrollViewer.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Controls/TimelineScrollViewer.cs new file mode 100644 index 000000000..dd1227a06 --- /dev/null +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Logging/Controls/TimelineScrollViewer.cs @@ -0,0 +1,51 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Controls; +using System.Windows.Input; + +namespace Tango.MachineStudio.Logging.Controls +{ + public class TimelineScrollViewer : ScrollViewer + { + public event EventHandler<MouseWheelEventArgs> MouseZooming; + + protected override void OnMouseWheel(MouseWheelEventArgs e) + { + if (Keyboard.IsKeyDown(Key.LeftCtrl)) + { + e.Handled = true; + OnMouseZooming(e); + } + else + { + base.OnMouseWheel(e); + } + + e.Handled = false; + } + + protected override void OnKeyDown(KeyEventArgs e) + { + if (e.KeyboardDevice.Modifiers == ModifierKeys.Control) + { + if (e.Key == Key.Left || e.Key == Key.Right) + e.Handled = true; + return; + } + base.OnKeyDown(e); + } + + protected override void OnPreviewKeyDown(KeyEventArgs e) + { + e.Handled = true; + } + + protected virtual void OnMouseZooming(MouseWheelEventArgs e) + { + if (MouseZooming != null) MouseZooming(this, e); + } + } +} |
