Skip to content

Commit

Permalink
[HaCreator] Scrolling map multiboard horizontally with the mouse wheel
Browse files Browse the repository at this point in the history
  • Loading branch information
lastbattle committed Aug 19, 2020
1 parent 8285131 commit 2c7177a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions HaCreator/MapEditor/MultiBoard.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
MouseDown="DxContainer_MouseDown"
MouseMove="DxContainer_MouseMove"
MouseUp="DxContainer_MouseUp"
MouseWheel="DxContainer_MouseWheel"
/>
</WindowsFormsHost>

Expand Down
19 changes: 19 additions & 0 deletions HaCreator/MapEditor/MultiBoard.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
Expand Down Expand Up @@ -646,6 +647,24 @@ private void DxContainer_MouseDoubleClick(object sender, System.Windows.Forms.Mo
}
}

/// <summary>
/// Mouse wheel
/// Wheelup = positive, Wheeldown = negative
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void DxContainer_MouseWheel(object sender, System.Windows.Forms.MouseEventArgs e)
{
int rotationDelta = e.Delta;
//System.Diagnostics.Debug.Write("Rotation: " + rotationDelta);

// wheel up = positive, wheel down = negative
hScrollBar.Value += rotationDelta;

// Update display
hScrollBar_Scroll(null, null);
}

/// <summary>
/// Mouse down
/// </summary>
Expand Down

0 comments on commit 2c7177a

Please sign in to comment.