BsScriptGUIFloatField.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. #include "BsScriptEditorPrerequisites.h"
  3. #include "BsScriptGUIElement.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Interop class between C++ & CLR for GUIFloatField.
  8. */
  9. class BS_SCR_BED_EXPORT ScriptGUIFloatField : public TScriptGUIElement<ScriptGUIFloatField>
  10. {
  11. public:
  12. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIFloatField")
  13. private:
  14. ScriptGUIFloatField(MonoObject* instance, GUIFloatField* floatField);
  15. /**
  16. * @brief Triggered when the value in the native float field changes.
  17. *
  18. * @param instance Managed GUIFloatField instance.
  19. * @param newValue New field value.
  20. */
  21. static void onChanged(MonoObject* instance, float newValue);
  22. /**
  23. * @brief Triggered when the user confirms input in the native float field.
  24. *
  25. * @param instance Managed GUIFloatField instance.
  26. */
  27. static void onConfirmed(MonoObject* instance);
  28. /************************************************************************/
  29. /* CLR HOOKS */
  30. /************************************************************************/
  31. static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
  32. MonoString* style, MonoArray* guiOptions, bool withTitle);
  33. static void internal_getValue(ScriptGUIFloatField* nativeInstance, float* output);
  34. static void internal_setValue(ScriptGUIFloatField* nativeInstance, float value);
  35. static void internal_hasInputFocus(ScriptGUIFloatField* nativeInstance, bool* output);
  36. static void internal_setTint(ScriptGUIFloatField* nativeInstance, Color color);
  37. static void internal_setRange(ScriptGUIFloatField* nativeInstance, float min, float max);
  38. typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
  39. typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
  40. static OnChangedThunkDef onChangedThunk;
  41. static OnConfirmedThunkDef onConfirmedThunk;
  42. };
  43. }