BsScriptGUIIntField.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #pragma once
  2. #include "BsScriptEditorPrerequisites.h"
  3. #include "BsScriptGUIElement.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Interop class between C++ & CLR for GUIIntField.
  8. */
  9. class BS_SCR_BED_EXPORT ScriptGUIIntField : public TScriptGUIElement<ScriptGUIIntField>
  10. {
  11. public:
  12. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIIntField")
  13. private:
  14. /**
  15. * @brief Triggered when the value in the native int field changes.
  16. *
  17. * @param instance Managed GUIIntField instance.
  18. * @param newValue New field value.
  19. */
  20. static void onChanged(MonoObject* instance, INT32 newValue);
  21. ScriptGUIIntField(MonoObject* instance, GUIIntField* intField);
  22. /************************************************************************/
  23. /* CLR HOOKS */
  24. /************************************************************************/
  25. static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
  26. MonoString* style, MonoArray* guiOptions, bool withTitle);
  27. static void internal_getValue(ScriptGUIIntField* nativeInstance, INT32* output);
  28. static void internal_setValue(ScriptGUIIntField* nativeInstance, INT32 value);
  29. static void internal_hasInputFocus(ScriptGUIIntField* nativeInstance, bool* output);
  30. static void internal_setRange(ScriptGUIIntField* nativeInstance, INT32 min, INT32 max);
  31. static void internal_setTint(ScriptGUIIntField* nativeInstance, Color color);
  32. typedef void (__stdcall *OnChangedThunkDef) (MonoObject*, INT32, MonoException**);
  33. static OnChangedThunkDef onChangedThunk;
  34. };
  35. }