BsScriptGUIIntField.h 2.1 KB

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