BsScriptGUIFloatField.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. /* CLR HOOKS */
  24. /************************************************************************/
  25. static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
  26. MonoString* style, MonoArray* guiOptions, bool withTitle);
  27. static void internal_getValue(ScriptGUIFloatField* nativeInstance, float* output);
  28. static void internal_setValue(ScriptGUIFloatField* nativeInstance, float value);
  29. static void internal_hasInputFocus(ScriptGUIFloatField* nativeInstance, bool* output);
  30. static void internal_setTint(ScriptGUIFloatField* nativeInstance, Color color);
  31. static void internal_setRange(ScriptGUIFloatField* nativeInstance, float min, float max);
  32. typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
  33. static OnChangedThunkDef onChangedThunk;
  34. };
  35. }