BsScriptGUIIntField.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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. /** @addtogroup ScriptInteropEditor
  9. * @{
  10. */
  11. /** Interop class between C++ & CLR for GUIIntField. */
  12. class BS_SCR_BED_EXPORT ScriptGUIIntField : public TScriptGUIElement<ScriptGUIIntField>
  13. {
  14. public:
  15. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIIntField")
  16. private:
  17. /**
  18. * Triggered when the value in the native int field changes.
  19. *
  20. * @param[in] instance Managed GUIIntField instance.
  21. * @param[in] newValue New field value.
  22. */
  23. static void onChanged(MonoObject* instance, INT32 newValue);
  24. /**
  25. * Triggered when the user confirms input in the native int field.
  26. *
  27. * @param[in] instance Managed GUIIntField instance.
  28. */
  29. static void onConfirmed(MonoObject* instance);
  30. ScriptGUIIntField(MonoObject* instance, GUIIntField* intField);
  31. /************************************************************************/
  32. /* CLR HOOKS */
  33. /************************************************************************/
  34. static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
  35. MonoString* style, MonoArray* guiOptions, bool withTitle);
  36. static void internal_getValue(ScriptGUIIntField* nativeInstance, INT32* output);
  37. static void internal_setValue(ScriptGUIIntField* nativeInstance, INT32 value);
  38. static void internal_hasInputFocus(ScriptGUIIntField* nativeInstance, bool* output);
  39. static void internal_setRange(ScriptGUIIntField* nativeInstance, INT32 min, INT32 max);
  40. static void internal_setTint(ScriptGUIIntField* nativeInstance, Color* color);
  41. typedef void (__stdcall *OnChangedThunkDef) (MonoObject*, INT32, MonoException**);
  42. typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
  43. static OnChangedThunkDef onChangedThunk;
  44. static OnConfirmedThunkDef onConfirmedThunk;
  45. };
  46. /** @} */
  47. }