diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2017-08-28 11:25:05 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2017-08-28 11:25:05 +0200 |
| commit | 7f10fe9ea2a4538843401c54d4518376a69b242d (patch) | |
| tree | f0318cea2ee2d3d569b72042b43a56f875e4a357 /src/GraphicObjects/ScrollingObject.cs | |
| parent | 1d9aa6aa61da3dd5f1a1a488018ceb8b5a88f2af (diff) | |
make currentInterface public, other minor changes
Diffstat (limited to 'src/GraphicObjects/ScrollingObject.cs')
| -rw-r--r-- | src/GraphicObjects/ScrollingObject.cs | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/GraphicObjects/ScrollingObject.cs b/src/GraphicObjects/ScrollingObject.cs index 8b9bc58a..42acdbf9 100644 --- a/src/GraphicObjects/ScrollingObject.cs +++ b/src/GraphicObjects/ScrollingObject.cs @@ -43,6 +43,11 @@ namespace Crow int scrollX, scrollY, maxScrollX, maxScrollY, mouseWheelSpeed; + /// <summary> + /// if true, key stroke are handled in derrived class + /// </summary> + protected bool KeyEventsOverrides = false; + /// <summary> Horizontal Scrolling Position </summary> [XmlAttributeAttribute][DefaultValue(0)] public virtual int ScrollX { @@ -142,15 +147,18 @@ namespace Crow { base.onMouseWheel (sender, e); if (currentInterface.Keyboard.IsKeyDown (Key.ShiftLeft)) - ScrollY += e.Delta * MouseWheelSpeed; - else ScrollX += e.Delta * MouseWheelSpeed; + else + ScrollY -= e.Delta * MouseWheelSpeed; } /// <summary> Process scrolling with arrow keys, home and end keys. </summary> public override void onKeyDown (object sender, KeyboardKeyEventArgs e) { base.onKeyDown (sender, e); + if (KeyEventsOverrides) + return; + switch (e.Key) { case Key.Up: ScrollY--; |