BsScriptGUIIntField.h 2.1 KB

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