BsScriptGUISlider.h 3.2 KB

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