BsScriptGUIFloatField.h 2.2 KB

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