BsScriptGUIToggleField.h 1.4 KB

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