BsScriptGUIFloatField.h 2.2 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 GUIFloatField.
  10. */
  11. class BS_SCR_BED_EXPORT ScriptGUIFloatField : public TScriptGUIElement<ScriptGUIFloatField>
  12. {
  13. public:
  14. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIFloatField")
  15. private:
  16. ScriptGUIFloatField(MonoObject* instance, GUIFloatField* floatField);
  17. /**
  18. * @brief Triggered when the value in the native float field changes.
  19. *
  20. * @param instance Managed GUIFloatField instance.
  21. * @param newValue New field value.
  22. */
  23. static void onChanged(MonoObject* instance, float newValue);
  24. /**
  25. * @brief Triggered when the user confirms input in the native float field.
  26. *
  27. * @param instance Managed GUIFloatField instance.
  28. */
  29. static void onConfirmed(MonoObject* instance);
  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(ScriptGUIFloatField* nativeInstance, float* output);
  36. static void internal_setValue(ScriptGUIFloatField* nativeInstance, float value);
  37. static void internal_hasInputFocus(ScriptGUIFloatField* nativeInstance, bool* output);
  38. static void internal_setTint(ScriptGUIFloatField* nativeInstance, Color* color);
  39. static void internal_setRange(ScriptGUIFloatField* nativeInstance, float min, float max);
  40. typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
  41. typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
  42. static OnChangedThunkDef onChangedThunk;
  43. static OnConfirmedThunkDef onConfirmedThunk;
  44. };
  45. }