BsScriptGUIIntField.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsScriptEditorPrerequisites.h"
  5. #include "BsScriptGUIElement.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief Interop class between C++ & CLR for GUIIntField.
  10. */
  11. class BS_SCR_BED_EXPORT ScriptGUIIntField : public TScriptGUIElement<ScriptGUIIntField>
  12. {
  13. public:
  14. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIIntField")
  15. private:
  16. /**
  17. * @brief Triggered when the value in the native int field changes.
  18. *
  19. * @param instance Managed GUIIntField instance.
  20. * @param newValue New field value.
  21. */
  22. static void onChanged(MonoObject* instance, INT32 newValue);
  23. /**
  24. * @brief Triggered when the user confirms input in the native int field.
  25. *
  26. * @param instance Managed GUIIntField instance.
  27. */
  28. static void onConfirmed(MonoObject* instance);
  29. ScriptGUIIntField(MonoObject* instance, GUIIntField* intField);
  30. /************************************************************************/
  31. /* CLR HOOKS */
  32. /************************************************************************/
  33. static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
  34. MonoString* style, MonoArray* guiOptions, bool withTitle);
  35. static void internal_getValue(ScriptGUIIntField* nativeInstance, INT32* output);
  36. static void internal_setValue(ScriptGUIIntField* nativeInstance, INT32 value);
  37. static void internal_hasInputFocus(ScriptGUIIntField* nativeInstance, bool* output);
  38. static void internal_setRange(ScriptGUIIntField* nativeInstance, INT32 min, INT32 max);
  39. static void internal_setTint(ScriptGUIIntField* nativeInstance, Color* color);
  40. typedef void (__stdcall *OnChangedThunkDef) (MonoObject*, INT32, MonoException**);
  41. typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
  42. static OnChangedThunkDef onChangedThunk;
  43. static OnConfirmedThunkDef onConfirmedThunk;
  44. };
  45. }