BsScriptGUIFloatField.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 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] newValue New field value.
  22. */
  23. void onChanged(float newValue);
  24. /**
  25. * Triggered when the user confirms input in the native float field.
  26. */
  27. void onConfirmed();
  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 float internal_getValue(ScriptGUIFloatField* nativeInstance);
  34. static float internal_setValue(ScriptGUIFloatField* nativeInstance, float value);
  35. static bool internal_hasInputFocus(ScriptGUIFloatField* nativeInstance);
  36. static void internal_setTint(ScriptGUIFloatField* nativeInstance, Color* color);
  37. static void internal_setRange(ScriptGUIFloatField* nativeInstance, float min, float max);
  38. static void internal_setStep(ScriptGUIFloatField* nativeInstance, float step);
  39. static float internal_getStep(ScriptGUIFloatField* nativeInstance);
  40. typedef void(BS_THUNKCALL *OnChangedThunkDef) (MonoObject*, float, MonoException**);
  41. typedef void(BS_THUNKCALL *OnConfirmedThunkDef) (MonoObject*, MonoException**);
  42. static OnChangedThunkDef onChangedThunk;
  43. static OnConfirmedThunkDef onConfirmedThunk;
  44. };
  45. /** @} */
  46. }