BsScriptGUIToggleField.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 GUIToggleField. */
  13. class BS_SCR_BED_EXPORT ScriptGUIToggleField : public TScriptGUIElement<ScriptGUIToggleField>
  14. {
  15. public:
  16. SCRIPT_OBJ(EDITOR_ASSEMBLY, EDITOR_NS, "GUIToggleField")
  17. private:
  18. /**
  19. * Triggered when the value in the native toggle field changes.
  20. *
  21. * @param[in] newValue Is the toggle active.
  22. */
  23. void onChanged(bool newValue);
  24. ScriptGUIToggleField(MonoObject* instance, GUIToggleField* toggleField);
  25. /************************************************************************/
  26. /* CLR HOOKS */
  27. /************************************************************************/
  28. static void internal_createInstance(MonoObject* instance, __GUIContentInterop* title, UINT32 titleWidth,
  29. MonoString* style, MonoArray* guiOptions, bool withTitle);
  30. static void internal_getValue(ScriptGUIToggleField* nativeInstance, bool* output);
  31. static void internal_setValue(ScriptGUIToggleField* nativeInstance, bool value);
  32. static void internal_setTint(ScriptGUIToggleField* nativeInstance, Color* color);
  33. typedef void(BS_THUNKCALL *OnChangedThunkDef) (MonoObject*, bool, MonoException**);
  34. static OnChangedThunkDef onChangedThunk;
  35. };
  36. /** @} */
  37. }