BsScriptGUISlider.h 2.9 KB

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