Parcourir la source

Implemented stepping logic on GUIFloatField and GUIIntField

marco.bellan il y a 9 ans
Parent
commit
d0a982313a

+ 9 - 2
Source/BansheeEditor/Include/BsGUIFloatField.h

@@ -31,14 +31,20 @@ namespace BansheeEngine
 		float getValue() const { return mValue; }
 		float getValue() const { return mValue; }
 
 
 		/**	Sets a new value in the input field. */
 		/**	Sets a new value in the input field. */
-		void setValue(float value);
+		float setValue(float value);
 
 
 		/**
 		/**
-		 * Sets a minimum and maximum allow values in the input field. Set to large negative/positive values if you don't
+		 * Sets a minimum and maximum allowed values in the input field. Set to large negative/positive values if you don't
 		 * require clamping.
 		 * require clamping.
 		 */
 		 */
 		void setRange(float min, float max);
 		void setRange(float min, float max);
 
 
+		/**	Sets the minimum change allowed for the input field. */
+		void setStep(float step);
+
+		/** Returns the minimum change allowed for the input field. */
+		float getStep() const{ return mStep; }
+
 		/**	Checks is the input field currently active. */
 		/**	Checks is the input field currently active. */
 		bool hasInputFocus() const { return mHasInputFocus; }
 		bool hasInputFocus() const { return mHasInputFocus; }
 
 
@@ -96,6 +102,7 @@ namespace BansheeEngine
 		INT32 mLastDragPos;
 		INT32 mLastDragPos;
 		float mMinValue;
 		float mMinValue;
 		float mMaxValue;
 		float mMaxValue;
+		float mStep;
 		bool mIsDragging;
 		bool mIsDragging;
 		bool mHasInputFocus;
 		bool mHasInputFocus;
 	};
 	};

+ 8 - 1
Source/BansheeEditor/Include/BsGUIIntField.h

@@ -31,7 +31,7 @@ namespace BansheeEngine
 		INT32 getValue() const { return mValue; }
 		INT32 getValue() const { return mValue; }
 
 
 		/**	Sets a new value in the input field. */
 		/**	Sets a new value in the input field. */
-		void setValue(INT32 value);
+		INT32 setValue(INT32 value);
 
 
 		/**
 		/**
 		 * Sets a minimum and maximum allow values in the input field. Set to large negative/positive values if you don't
 		 * Sets a minimum and maximum allow values in the input field. Set to large negative/positive values if you don't
@@ -39,6 +39,12 @@ namespace BansheeEngine
 		 */
 		 */
 		void setRange(INT32 min, INT32 max);
 		void setRange(INT32 min, INT32 max);
 
 
+		/**	Sets the minimum change allowed for the input field. */
+		void setStep(INT32 step);
+
+		/** Returns the minimum change allowed for the input field. */
+		INT32 getStep() const { return mStep; }
+
 		/**	Checks is the input field currently active. */
 		/**	Checks is the input field currently active. */
 		bool hasInputFocus() const { return mHasInputFocus; }
 		bool hasInputFocus() const { return mHasInputFocus; }
 
 
@@ -96,6 +102,7 @@ namespace BansheeEngine
 		INT32 mLastDragPos;
 		INT32 mLastDragPos;
 		INT32 mMinValue;
 		INT32 mMinValue;
 		INT32 mMaxValue;
 		INT32 mMaxValue;
+		INT32 mStep;
 		bool mIsDragging;
 		bool mIsDragging;
 		bool mIsDragCursorSet;
 		bool mIsDragCursorSet;
 		bool mHasInputFocus;
 		bool mHasInputFocus;

+ 11 - 4
Source/BansheeEditor/Source/BsGUIFloatField.cpp

@@ -21,7 +21,7 @@ namespace BansheeEngine
 		const String& style, const GUIDimensions& dimensions, bool withLabel)
 		const String& style, const GUIDimensions& dimensions, bool withLabel)
 		: TGUIField(dummy, labelContent, labelWidth, style, dimensions, withLabel), mInputBox(nullptr), mValue(0.0f)
 		: TGUIField(dummy, labelContent, labelWidth, style, dimensions, withLabel), mInputBox(nullptr), mValue(0.0f)
 		, mLastDragPos(0), mMinValue(std::numeric_limits<float>::lowest()), mMaxValue(std::numeric_limits<float>::max())
 		, mLastDragPos(0), mMinValue(std::numeric_limits<float>::lowest()), mMaxValue(std::numeric_limits<float>::max())
-		, mIsDragging(false), mHasInputFocus(false)
+		, mIsDragging(false), mHasInputFocus(false), mStep(0.0f)
 	{
 	{
 		mInputBox = GUIInputBox::create(false, GUIOptions(GUIOption::flexibleWidth()), getSubStyleName(getInputStyleType()));
 		mInputBox = GUIInputBox::create(false, GUIOptions(GUIOption::flexibleWidth()), getSubStyleName(getInputStyleType()));
 		mInputBox->setFilter(&GUIFloatField::floatFilter);
 		mInputBox->setFilter(&GUIFloatField::floatFilter);
@@ -134,16 +134,18 @@ namespace BansheeEngine
 		return false;
 		return false;
 	}
 	}
 
 
-	void GUIFloatField::setValue(float value)
+	float GUIFloatField::setValue(float value)
 	{
 	{
 		mValue = Math::clamp(value, mMinValue, mMaxValue);
 		mValue = Math::clamp(value, mMinValue, mMaxValue);
-
+		if (mStep != 0.0f)
+			mValue = mValue - fmod(mValue, mStep);
 		// Only update with new value if it actually changed, otherwise
 		// Only update with new value if it actually changed, otherwise
 		// problems can occur when user types in "0." and the field
 		// problems can occur when user types in "0." and the field
 		// updates back to "0" effectively making "." unusable
 		// updates back to "0" effectively making "." unusable
 		float curValue = parseFloat(mInputBox->getText());
 		float curValue = parseFloat(mInputBox->getText());
 		if (mValue != curValue)
 		if (mValue != curValue)
 			mInputBox->setText(toWString(mValue));
 			mInputBox->setText(toWString(mValue));
+		return mValue;
 	}
 	}
 
 
 	void GUIFloatField::setRange(float min, float max)
 	void GUIFloatField::setRange(float min, float max)
@@ -152,6 +154,11 @@ namespace BansheeEngine
 		mMaxValue = max;
 		mMaxValue = max;
 	}
 	}
 
 
+	void GUIFloatField::setStep(float step) 
+	{
+		mStep = step;
+	}
+
 	void GUIFloatField::setTint(const Color& color)
 	void GUIFloatField::setTint(const Color& color)
 	{
 	{
 		if (mLabel != nullptr)
 		if (mLabel != nullptr)
@@ -165,7 +172,7 @@ namespace BansheeEngine
 		setValue(value);
 		setValue(value);
 
 
 		if(triggerEvent)
 		if(triggerEvent)
-			onValueChanged(value);
+			onValueChanged(mValue);
 	}
 	}
 
 
 	const String& GUIFloatField::getGUITypeName()
 	const String& GUIFloatField::getGUITypeName()

+ 11 - 4
Source/BansheeEditor/Source/BsGUIIntField.cpp

@@ -22,7 +22,7 @@ namespace BansheeEngine
 		const String& style, const GUIDimensions& dimensions, bool withLabel)
 		const String& style, const GUIDimensions& dimensions, bool withLabel)
 		: TGUIField(dummy, labelContent, labelWidth, style, dimensions, withLabel), mInputBox(nullptr), mValue(0)
 		: TGUIField(dummy, labelContent, labelWidth, style, dimensions, withLabel), mInputBox(nullptr), mValue(0)
 		, mLastDragPos(0), mMinValue(std::numeric_limits<INT32>::lowest())
 		, mLastDragPos(0), mMinValue(std::numeric_limits<INT32>::lowest())
-		, mMaxValue(std::numeric_limits<INT32>::max()), mIsDragging(false), mIsDragCursorSet(false), mHasInputFocus(false)
+		, mMaxValue(std::numeric_limits<INT32>::max()), mIsDragging(false), mIsDragCursorSet(false), mHasInputFocus(false), mStep(1)
 	{
 	{
 		mInputBox = GUIInputBox::create(false, GUIOptions(GUIOption::flexibleWidth()), getSubStyleName(getInputStyleType()));
 		mInputBox = GUIInputBox::create(false, GUIOptions(GUIOption::flexibleWidth()), getSubStyleName(getInputStyleType()));
 		mInputBox->setFilter(&GUIIntField::intFilter);
 		mInputBox->setFilter(&GUIIntField::intFilter);
@@ -160,16 +160,18 @@ namespace BansheeEngine
 		mInputBox->setStyle(getSubStyleName(getInputStyleType()));
 		mInputBox->setStyle(getSubStyleName(getInputStyleType()));
 	}
 	}
 
 
-	void GUIIntField::setValue(INT32 value)
+	INT32 GUIIntField::setValue(INT32 value)
 	{
 	{
 		mValue = Math::clamp(value, mMinValue, mMaxValue);
 		mValue = Math::clamp(value, mMinValue, mMaxValue);
-
+		if (mStep != 0)
+			mValue = mValue - fmod(mValue, mStep);
 		// Only update with new value if it actually changed, otherwise
 		// Only update with new value if it actually changed, otherwise
 		// problems can occur when user types in "0." and the field
 		// problems can occur when user types in "0." and the field
 		// updates back to "0" effectively making "." unusable
 		// updates back to "0" effectively making "." unusable
 		float curValue = parseFloat(mInputBox->getText());
 		float curValue = parseFloat(mInputBox->getText());
 		if (mValue != curValue)
 		if (mValue != curValue)
 			mInputBox->setText(toWString(mValue));
 			mInputBox->setText(toWString(mValue));
+		return mValue;
 	}
 	}
 
 
 	void GUIIntField::setRange(INT32 min, INT32 max)
 	void GUIIntField::setRange(INT32 min, INT32 max)
@@ -178,6 +180,11 @@ namespace BansheeEngine
 		mMaxValue = max;
 		mMaxValue = max;
 	}
 	}
 
 
+	void GUIIntField::setStep(INT32 step)
+	{
+		mStep = step;
+	}
+
 	void GUIIntField::setTint(const Color& color)
 	void GUIIntField::setTint(const Color& color)
 	{
 	{
 		if (mLabel != nullptr)
 		if (mLabel != nullptr)
@@ -191,7 +198,7 @@ namespace BansheeEngine
 		setValue(value);
 		setValue(value);
 
 
 		if (triggerEvent)
 		if (triggerEvent)
-			onValueChanged(value);
+			onValueChanged(mValue);
 	}
 	}
 
 
 	const String& GUIIntField::getGUITypeName()
 	const String& GUIIntField::getGUITypeName()

+ 19 - 0
Source/MBansheeEditor/GUI/GUIFloatField.cs

@@ -40,6 +40,19 @@ namespace BansheeEditor
             set { Internal_SetValue(mCachedPtr, value); }
             set { Internal_SetValue(mCachedPtr, value); }
         }
         }
 
 
+        /// <summary>
+        /// Minimum change of the field
+        /// </summary>
+        public float Step
+        {
+            get
+            {
+                return Internal_GetStep(mCachedPtr);
+            }
+
+            set { Internal_SetStep(mCachedPtr, value); }
+        }
+
         /// <summary>
         /// <summary>
         /// Checks does the element currently has input focus. Input focus means the element has an input caret displayed
         /// Checks does the element currently has input focus. Input focus means the element has an input caret displayed
         /// and will accept input from the keyboard.
         /// and will accept input from the keyboard.
@@ -139,6 +152,12 @@ namespace BansheeEditor
 
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_SetRange(IntPtr nativeInstance, float min, float max);
         private static extern void Internal_SetRange(IntPtr nativeInstance, float min, float max);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SetStep(IntPtr nativeInstance, float step);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern float Internal_GetStep(IntPtr nativeInstance);
     }
     }
 
 
     /** @} */
     /** @} */

+ 20 - 1
Source/MBansheeEditor/GUI/GUIIntField.cs

@@ -40,6 +40,19 @@ namespace BansheeEditor
             set { Internal_SetValue(mCachedPtr, value); }
             set { Internal_SetValue(mCachedPtr, value); }
         }
         }
 
 
+        /// <summary>
+        /// Minimum change of the field
+        /// </summary>
+        public int Step
+        {
+            get
+            {
+                return Internal_GetStep(mCachedPtr);
+            }
+
+            set { Internal_SetStep(mCachedPtr, value);}
+        }
+
         /// <summary>
         /// <summary>
         /// Checks does the element currently has input focus. Input focus means the element has an input caret displayed
         /// Checks does the element currently has input focus. Input focus means the element has an input caret displayed
         /// and will accept input from the keyboard.
         /// and will accept input from the keyboard.
@@ -129,7 +142,7 @@ namespace BansheeEditor
         private static extern void Internal_GetValue(IntPtr nativeInstance, out int value);
         private static extern void Internal_GetValue(IntPtr nativeInstance, out int value);
 
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
-        private static extern void Internal_SetValue(IntPtr nativeInstance, int value);
+        private static extern int Internal_SetValue(IntPtr nativeInstance, int value);
 
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_HasInputFocus(IntPtr nativeInstance, out bool value);
         private static extern void Internal_HasInputFocus(IntPtr nativeInstance, out bool value);
@@ -139,6 +152,12 @@ namespace BansheeEditor
 
 
         [MethodImpl(MethodImplOptions.InternalCall)]
         [MethodImpl(MethodImplOptions.InternalCall)]
         private static extern void Internal_SetTint(IntPtr nativeInstance, ref Color color);
         private static extern void Internal_SetTint(IntPtr nativeInstance, ref Color color);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern void Internal_SetStep(IntPtr nativeInstance, int step);
+
+        [MethodImpl(MethodImplOptions.InternalCall)]
+        private static extern int Internal_GetStep(IntPtr nativeInstance);
     }
     }
 
 
     /** @} */
     /** @} */

+ 3 - 1
Source/SBansheeEditor/Include/BsScriptGUIFloatField.h

@@ -42,10 +42,12 @@ namespace BansheeEngine
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 
 		static void internal_getValue(ScriptGUIFloatField* nativeInstance, float* output);
 		static void internal_getValue(ScriptGUIFloatField* nativeInstance, float* output);
-		static void internal_setValue(ScriptGUIFloatField* nativeInstance, float value);
+		static float internal_setValue(ScriptGUIFloatField* nativeInstance, float value);
 		static void internal_hasInputFocus(ScriptGUIFloatField* nativeInstance, bool* output);
 		static void internal_hasInputFocus(ScriptGUIFloatField* nativeInstance, bool* output);
 		static void internal_setTint(ScriptGUIFloatField* nativeInstance, Color* color);
 		static void internal_setTint(ScriptGUIFloatField* nativeInstance, Color* color);
 		static void internal_setRange(ScriptGUIFloatField* nativeInstance, float min, float max);
 		static void internal_setRange(ScriptGUIFloatField* nativeInstance, float min, float max);
+		static void internal_setStep(ScriptGUIFloatField* nativeInstance, float step);
+		static INT32 internal_getStep(ScriptGUIFloatField* nativeInstance);
 
 
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
 		typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
 		typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
 		typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);

+ 3 - 1
Source/SBansheeEditor/Include/BsScriptGUIIntField.h

@@ -42,10 +42,12 @@ namespace BansheeEngine
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 			MonoString* style, MonoArray* guiOptions, bool withTitle);
 
 
 		static void internal_getValue(ScriptGUIIntField* nativeInstance, INT32* output);
 		static void internal_getValue(ScriptGUIIntField* nativeInstance, INT32* output);
-		static void internal_setValue(ScriptGUIIntField* nativeInstance, INT32 value);
+		static INT32 internal_setValue(ScriptGUIIntField* nativeInstance, INT32 value);
 		static void internal_hasInputFocus(ScriptGUIIntField* nativeInstance, bool* output);
 		static void internal_hasInputFocus(ScriptGUIIntField* nativeInstance, bool* output);
 		static void internal_setRange(ScriptGUIIntField* nativeInstance, INT32 min, INT32 max);
 		static void internal_setRange(ScriptGUIIntField* nativeInstance, INT32 min, INT32 max);
 		static void internal_setTint(ScriptGUIIntField* nativeInstance, Color* color);
 		static void internal_setTint(ScriptGUIIntField* nativeInstance, Color* color);
+		static void internal_setStep(ScriptGUIIntField* nativeInstance, INT32 step);
+		static INT32 internal_getStep(ScriptGUIIntField* nativeInstance);
 
 
 		typedef void (__stdcall *OnChangedThunkDef) (MonoObject*, INT32, MonoException**);
 		typedef void (__stdcall *OnChangedThunkDef) (MonoObject*, INT32, MonoException**);
 		typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
 		typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);

+ 18 - 4
Source/SBansheeEditor/Source/BsScriptGUIFloatField.cpp

@@ -32,6 +32,8 @@ namespace BansheeEngine
 		metaData.scriptClass->addInternalCall("Internal_HasInputFocus", &ScriptGUIFloatField::internal_hasInputFocus);
 		metaData.scriptClass->addInternalCall("Internal_HasInputFocus", &ScriptGUIFloatField::internal_hasInputFocus);
 		metaData.scriptClass->addInternalCall("Internal_SetTint", &ScriptGUIFloatField::internal_setTint);
 		metaData.scriptClass->addInternalCall("Internal_SetTint", &ScriptGUIFloatField::internal_setTint);
 		metaData.scriptClass->addInternalCall("Internal_SetRange", &ScriptGUIFloatField::internal_setRange);
 		metaData.scriptClass->addInternalCall("Internal_SetRange", &ScriptGUIFloatField::internal_setRange);
+		metaData.scriptClass->addInternalCall("Internal_SetStep", &ScriptGUIFloatField::internal_setStep);
+		metaData.scriptClass->addInternalCall("Internal_GetStep", &ScriptGUIFloatField::internal_getStep);
 
 
 		onChangedThunk = (OnChangedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnChanged", 1)->getThunk();
 		onChangedThunk = (OnChangedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnChanged", 1)->getThunk();
 		onConfirmedThunk = (OnConfirmedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnConfirmed", 0)->getThunk();
 		onConfirmedThunk = (OnConfirmedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnConfirmed", 0)->getThunk();
@@ -72,7 +74,7 @@ namespace BansheeEngine
 		*output = floatField->getValue();
 		*output = floatField->getValue();
 	}
 	}
 
 
-	void ScriptGUIFloatField::internal_setValue(ScriptGUIFloatField* nativeInstance, float value)
+	float ScriptGUIFloatField::internal_setValue(ScriptGUIFloatField* nativeInstance, float value)
 	{
 	{
 		GUIFloatField* floatField = static_cast<GUIFloatField*>(nativeInstance->getGUIElement());
 		GUIFloatField* floatField = static_cast<GUIFloatField*>(nativeInstance->getGUIElement());
 		return floatField->setValue(value);
 		return floatField->setValue(value);
@@ -84,16 +86,28 @@ namespace BansheeEngine
 		*output = floatField->hasInputFocus();
 		*output = floatField->hasInputFocus();
 	}
 	}
 
 
+	void ScriptGUIFloatField::internal_setRange(ScriptGUIFloatField* nativeInstance, float min, float max)
+	{
+		GUIFloatField* intField = static_cast<GUIFloatField*>(nativeInstance->getGUIElement());
+		intField->setRange(min, max);
+	}
+
 	void ScriptGUIFloatField::internal_setTint(ScriptGUIFloatField* nativeInstance, Color* color)
 	void ScriptGUIFloatField::internal_setTint(ScriptGUIFloatField* nativeInstance, Color* color)
 	{
 	{
 		GUIFloatField* floatField = (GUIFloatField*)nativeInstance->getGUIElement();
 		GUIFloatField* floatField = (GUIFloatField*)nativeInstance->getGUIElement();
 		floatField->setTint(*color);
 		floatField->setTint(*color);
 	}
 	}
 
 
-	void ScriptGUIFloatField::internal_setRange(ScriptGUIFloatField* nativeInstance, float min, float max)
+	void ScriptGUIFloatField::internal_setStep(ScriptGUIFloatField* nativeInstance, float step)
 	{
 	{
-		GUIFloatField* intField = static_cast<GUIFloatField*>(nativeInstance->getGUIElement());
-		intField->setRange(min, max);
+		GUIFloatField* floatField = (GUIFloatField*)nativeInstance->getGUIElement();
+		floatField->setStep(step);
+	}
+
+	INT32 ScriptGUIFloatField::internal_getStep(ScriptGUIFloatField* nativeInstance)
+	{
+		GUIFloatField* floatField = (GUIFloatField*)nativeInstance->getGUIElement();
+		return floatField->getStep();
 	}
 	}
 
 
 	void ScriptGUIFloatField::onChanged(MonoObject* instance, float newValue)
 	void ScriptGUIFloatField::onChanged(MonoObject* instance, float newValue)

+ 15 - 1
Source/SBansheeEditor/Source/BsScriptGUIIntField.cpp

@@ -32,6 +32,8 @@ namespace BansheeEngine
 		metaData.scriptClass->addInternalCall("Internal_HasInputFocus", &ScriptGUIIntField::internal_hasInputFocus);
 		metaData.scriptClass->addInternalCall("Internal_HasInputFocus", &ScriptGUIIntField::internal_hasInputFocus);
 		metaData.scriptClass->addInternalCall("Internal_SetRange", &ScriptGUIIntField::internal_setRange);
 		metaData.scriptClass->addInternalCall("Internal_SetRange", &ScriptGUIIntField::internal_setRange);
 		metaData.scriptClass->addInternalCall("Internal_SetTint", &ScriptGUIIntField::internal_setTint);
 		metaData.scriptClass->addInternalCall("Internal_SetTint", &ScriptGUIIntField::internal_setTint);
+		metaData.scriptClass->addInternalCall("Internal_SetStep", &ScriptGUIIntField::internal_setStep);
+		metaData.scriptClass->addInternalCall("Internal_GetStep", &ScriptGUIIntField::internal_getStep);
 
 
 		onChangedThunk = (OnChangedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnChanged", 1)->getThunk();
 		onChangedThunk = (OnChangedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnChanged", 1)->getThunk();
 		onConfirmedThunk = (OnConfirmedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnConfirmed", 0)->getThunk();
 		onConfirmedThunk = (OnConfirmedThunkDef)metaData.scriptClass->getMethod("Internal_DoOnConfirmed", 0)->getThunk();
@@ -72,7 +74,7 @@ namespace BansheeEngine
 		*output = intField->getValue();
 		*output = intField->getValue();
 	}
 	}
 
 
-	void ScriptGUIIntField::internal_setValue(ScriptGUIIntField* nativeInstance, INT32 value)
+	INT32 ScriptGUIIntField::internal_setValue(ScriptGUIIntField* nativeInstance, INT32 value)
 	{
 	{
 		GUIIntField* intField = static_cast<GUIIntField*>(nativeInstance->getGUIElement());
 		GUIIntField* intField = static_cast<GUIIntField*>(nativeInstance->getGUIElement());
 		return intField->setValue(value);
 		return intField->setValue(value);
@@ -96,6 +98,18 @@ namespace BansheeEngine
 		intField->setTint(*color);
 		intField->setTint(*color);
 	}
 	}
 
 
+	void ScriptGUIIntField::internal_setStep(ScriptGUIIntField* nativeInstance, INT32 step)
+	{
+		GUIIntField* intField = (GUIIntField*)nativeInstance->getGUIElement();
+		intField->setStep(step);
+	}
+
+	INT32 ScriptGUIIntField::internal_getStep(ScriptGUIIntField* nativeInstance)
+	{
+		GUIIntField* intField = (GUIIntField*)nativeInstance->getGUIElement();
+		return intField->getStep();
+	}
+
 	void ScriptGUIIntField::onChanged(MonoObject* instance, INT32 newValue)
 	void ScriptGUIIntField::onChanged(MonoObject* instance, INT32 newValue)
 	{
 	{
 		MonoUtil::invokeThunk(onChangedThunk, instance, newValue);
 		MonoUtil::invokeThunk(onChangedThunk, instance, newValue);