2
0

BsScriptGUIIntField.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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 bs
  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 INT32 internal_getValue(ScriptGUIIntField* nativeInstance);
  37. static INT32 internal_setValue(ScriptGUIIntField* nativeInstance, INT32 value);
  38. static bool internal_hasInputFocus(ScriptGUIIntField* nativeInstance);
  39. static void internal_setRange(ScriptGUIIntField* nativeInstance, INT32 min, INT32 max);
  40. static void internal_setTint(ScriptGUIIntField* nativeInstance, Color* color);
  41. static void internal_setStep(ScriptGUIIntField* nativeInstance, INT32 step);
  42. static INT32 internal_getStep(ScriptGUIIntField* nativeInstance);
  43. typedef void (__stdcall *OnChangedThunkDef) (MonoObject*, INT32, MonoException**);
  44. typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
  45. static OnChangedThunkDef onChangedThunk;
  46. static OnConfirmedThunkDef onConfirmedThunk;
  47. };
  48. /** @} */
  49. }