BsScriptGUISliderField.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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 GUISliderField. */
  13. class BS_SCR_BED_EXPORT ScriptGUISliderField : public TScriptGUIElement<ScriptGUISliderField>
  14. {
  15. public:
  16. SCRIPT_OBJ(EDITOR_ASSEMBLY, EDITOR_NS, "GUISliderField")
  17. private:
  18. ScriptGUISliderField(MonoObject* instance, GUISliderField* sliderField);
  19. /**
  20. * Triggered when the value in the native slider field changes.
  21. *
  22. * @param[in] newValue New field value.
  23. */
  24. void onChanged(float newValue);
  25. /************************************************************************/
  26. /* CLR HOOKS */
  27. /************************************************************************/
  28. static void internal_createInstance(MonoObject* instance, float min, float max, __GUIContentInterop* title,
  29. UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
  30. static float internal_getValue(ScriptGUISliderField* nativeInstance);
  31. static float internal_getStep(ScriptGUISliderField* nativeInstance);
  32. static float internal_setValue(ScriptGUISliderField* nativeInstance, float value);
  33. static void internal_hasInputFocus(ScriptGUISliderField* nativeInstance, bool* output);
  34. static void internal_setTint(ScriptGUISliderField* nativeInstance, Color* color);
  35. static void internal_setRange(ScriptGUISliderField* nativeInstance, float min, float max);
  36. static void internal_setStep(ScriptGUISliderField* nativeInstance, float step);
  37. typedef void(BS_THUNKCALL *OnChangedThunkDef) (MonoObject*, float, MonoException**);
  38. static OnChangedThunkDef onChangedThunk;
  39. };
  40. /** @} */
  41. }