BsScriptGUISliderField.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. /**
  9. * @brief Interop class between C++ & CLR for GUISliderField.
  10. */
  11. class BS_SCR_BED_EXPORT ScriptGUISliderField : public TScriptGUIElement<ScriptGUISliderField>
  12. {
  13. public:
  14. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUISliderField")
  15. private:
  16. ScriptGUISliderField(MonoObject* instance, GUISliderField* sliderField);
  17. /**
  18. * @brief Triggered when the value in the native slider field changes.
  19. *
  20. * @param instance Managed GUISliderField instance.
  21. * @param newValue New field value.
  22. */
  23. static void onChanged(MonoObject* instance, float newValue);
  24. /************************************************************************/
  25. /* CLR HOOKS */
  26. /************************************************************************/
  27. static void internal_createInstance(MonoObject* instance, float min, float max, MonoObject* title, UINT32 titleWidth,
  28. MonoString* style, MonoArray* guiOptions, bool withTitle);
  29. static float internal_getValue(ScriptGUISliderField* nativeInstance);
  30. static void internal_setValue(ScriptGUISliderField* nativeInstance, float value);
  31. static void internal_setTint(ScriptGUISliderField* nativeInstance, Color* color);
  32. static void internal_setRange(ScriptGUISliderField* nativeInstance, float min, float max);
  33. static void internal_setStep(ScriptGUISliderField* nativeInstance, float step);
  34. typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
  35. static OnChangedThunkDef onChangedThunk;
  36. };
  37. }