BsScriptGUIToggleField.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. /** @addtogroup ScriptInteropEditor
  9. * @{
  10. */
  11. /** Interop class between C++ & CLR for GUIToggleField. */
  12. class BS_SCR_BED_EXPORT ScriptGUIToggleField : public TScriptGUIElement<ScriptGUIToggleField>
  13. {
  14. public:
  15. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIToggleField")
  16. private:
  17. /**
  18. * Triggered when the value in the native toggle field changes.
  19. *
  20. * @param[in] instance Managed GUIToggleField instance.
  21. * @param[in] newValue Is the toggle active.
  22. */
  23. static void onChanged(MonoObject* instance, bool newValue);
  24. ScriptGUIToggleField(MonoObject* instance, GUIToggleField* toggleField);
  25. /************************************************************************/
  26. /* CLR HOOKS */
  27. /************************************************************************/
  28. static void internal_createInstance(MonoObject* instance, MonoObject* 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. }