BsScriptGUIFloatField.h 2.4 KB

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