BsScriptGUISlider.h 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsScriptEnginePrerequisites.h"
  5. #include "BsScriptGUIElement.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief Interop class between C++ & CLR for GUISliderH.
  10. */
  11. class BS_SCR_BE_EXPORT ScriptGUISliderH : public TScriptGUIElement<ScriptGUISliderH>
  12. {
  13. public:
  14. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUISliderH")
  15. private:
  16. ScriptGUISliderH(MonoObject* instance, GUISliderHorz* slider);
  17. /**
  18. * @brief Triggered when the native slider is moved.
  19. */
  20. static void onChanged(MonoObject* instance, float percent);
  21. /************************************************************************/
  22. /* CLR HOOKS */
  23. /************************************************************************/
  24. static void internal_createInstance(MonoObject* instance, MonoString* style, MonoArray* guiOptions);
  25. static void internal_setPercent(ScriptGUISliderH* nativeInstance, float percent);
  26. static float internal_getPercent(ScriptGUISliderH* nativeInstance);
  27. static float internal_getValue(ScriptGUISliderH* nativeInstance);
  28. static void internal_setValue(ScriptGUISliderH* nativeInstance, float percent);
  29. static void internal_setRange(ScriptGUISliderH* nativeInstance, float min, float max);
  30. static void internal_setStep(ScriptGUISliderH* nativeInstance, float step);
  31. static void internal_setTint(ScriptGUISliderH* nativeInstance, Color* color);
  32. typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
  33. static OnChangedThunkDef onChangedThunk;
  34. };
  35. /**
  36. * @brief Interop class between C++ & CLR for GUISliderV.
  37. */
  38. class BS_SCR_BE_EXPORT ScriptGUISliderV : public TScriptGUIElement<ScriptGUISliderV>
  39. {
  40. public:
  41. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUISliderV")
  42. private:
  43. ScriptGUISliderV(MonoObject* instance, GUISliderVert* slider);
  44. /**
  45. * @brief Triggered when the native slider is moved.
  46. */
  47. static void onChanged(MonoObject* instance, float percent);
  48. /************************************************************************/
  49. /* CLR HOOKS */
  50. /************************************************************************/
  51. static void internal_createInstance(MonoObject* instance, MonoString* style, MonoArray* guiOptions);
  52. static void internal_setPercent(ScriptGUISliderV* nativeInstance, float percent);
  53. static float internal_getPercent(ScriptGUISliderV* nativeInstance);
  54. static float internal_getValue(ScriptGUISliderV* nativeInstance);
  55. static void internal_setValue(ScriptGUISliderV* nativeInstance, float percent);
  56. static void internal_setRange(ScriptGUISliderV* nativeInstance, float min, float max);
  57. static void internal_setStep(ScriptGUISliderV* nativeInstance, float step);
  58. static void internal_setTint(ScriptGUISliderV* nativeInstance, Color* color);
  59. typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, float, MonoException**);
  60. static OnChangedThunkDef onChangedThunk;
  61. };
  62. }