From 748a35c8839f43fcef867cc376cedae1afb315ff Mon Sep 17 00:00:00 2001
From: codeimp <codeimp@e0d998f2-2e9b-42fe-843d-47128df60a06>
Date: Fri, 10 Jul 2009 19:19:28 +0000
Subject: [PATCH] @ Fixed a bug with the scrollwheel usage in numeric input
 controls

---
 Source/Core/Controls/ButtonsNumericTextbox.cs | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/Source/Core/Controls/ButtonsNumericTextbox.cs b/Source/Core/Controls/ButtonsNumericTextbox.cs
index 4f87b2b34..3ff333ea0 100644
--- a/Source/Core/Controls/ButtonsNumericTextbox.cs
+++ b/Source/Core/Controls/ButtonsNumericTextbox.cs
@@ -140,10 +140,20 @@ namespace CodeImp.DoomBuilder.Controls
 		// Mouse wheel used
 		private void textbox_MouseWheel(object sender, MouseEventArgs e)
 		{
-			if(e.Delta < 0)
-				buttons.Value += buttons.SmallChange;
-			else if(e.Delta > 0)
-				buttons.Value -= buttons.SmallChange;
+			if(steps != null)
+			{
+				if(e.Delta > 0)
+					textbox.Text = steps.GetNextHigher(textbox.GetResult(0)).ToString();
+				else if(e.Delta < 0)
+					textbox.Text = steps.GetNextLower(textbox.GetResult(0)).ToString();
+			}
+			else
+			{
+				if(e.Delta < 0)
+					buttons.Value += 1;
+				else if(e.Delta > 0)
+					buttons.Value -= 1;
+			}
 		}
 		
 		#endregion
-- 
GitLab