BsScriptGUIToggleField.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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 "BsScriptGUIElement.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief Interop class between C++ & CLR for GUIToggleField.
  10. */
  11. class BS_SCR_BED_EXPORT ScriptGUIToggleField : public TScriptGUIElement<ScriptGUIToggleField>
  12. {
  13. public:
  14. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIToggleField")
  15. private:
  16. /**
  17. * @brief Triggered when the value in the native toggle field changes.
  18. *
  19. * @param instance Managed GUIToggleField instance.
  20. * @param newValue Is the toggle active.
  21. */
  22. static void onChanged(MonoObject* instance, bool newValue);
  23. ScriptGUIToggleField(MonoObject* instance, GUIToggleField* toggleField);
  24. /************************************************************************/
  25. /* CLR HOOKS */
  26. /************************************************************************/
  27. static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
  28. MonoString* style, MonoArray* guiOptions, bool withTitle);
  29. static void internal_getValue(ScriptGUIToggleField* nativeInstance, bool* output);
  30. static void internal_setValue(ScriptGUIToggleField* nativeInstance, bool value);
  31. static void internal_setTint(ScriptGUIToggleField* nativeInstance, Color* color);
  32. typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, bool, MonoException**);
  33. static OnChangedThunkDef onChangedThunk;
  34. };
  35. }