BsScriptGUIIntField.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. /**
  22. * @brief Triggered when the user confirms input in the native int field.
  23. *
  24. * @param instance Managed GUIIntField instance.
  25. */
  26. static void onConfirmed(MonoObject* instance);
  27. ScriptGUIIntField(MonoObject* instance, GUIIntField* intField);
  28. /************************************************************************/
  29. /* CLR HOOKS */
  30. /************************************************************************/
  31. static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
  32. MonoString* style, MonoArray* guiOptions, bool withTitle);
  33. static void internal_getValue(ScriptGUIIntField* nativeInstance, INT32* output);
  34. static void internal_setValue(ScriptGUIIntField* nativeInstance, INT32 value);
  35. static void internal_hasInputFocus(ScriptGUIIntField* nativeInstance, bool* output);
  36. static void internal_setRange(ScriptGUIIntField* nativeInstance, INT32 min, INT32 max);
  37. static void internal_setTint(ScriptGUIIntField* nativeInstance, Color color);
  38. typedef void (__stdcall *OnChangedThunkDef) (MonoObject*, INT32, MonoException**);
  39. typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
  40. static OnChangedThunkDef onChangedThunk;
  41. static OnConfirmedThunkDef onConfirmedThunk;
  42. };
  43. }