BsScriptGUIComponentFoldout.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #pragma once
  2. #include "BsScriptEditorPrerequisites.h"
  3. #include "BsScriptGUIElement.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Interop class between C++ & CLR for GUIComponentFoldout.
  8. */
  9. class BS_SCR_BED_EXPORT ScriptGUIComponentFoldout : public TScriptGUIElement<ScriptGUIComponentFoldout>
  10. {
  11. public:
  12. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIComponentFoldout")
  13. private:
  14. /**
  15. * @brief Triggered when the foldout is expanded or collapsed.
  16. *
  17. * @param instance Managed GUIComponentFoldout instance.
  18. * @param expanded True if the foldout is now expanded, false otherwise.
  19. */
  20. static void onToggled(MonoObject* instance, bool expanded);
  21. /**
  22. * @brief Triggered when the remove button on the foldout is clicked.
  23. *
  24. * @param instance Managed GUIComponentFoldout instance.
  25. */
  26. static void onRemoveClicked(MonoObject* instance);
  27. ScriptGUIComponentFoldout(MonoObject* instance, GUIComponentFoldout* foldout);
  28. /************************************************************************/
  29. /* CLR HOOKS */
  30. /************************************************************************/
  31. static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);
  32. static void internal_setContent(ScriptGUIComponentFoldout* nativeInstance, MonoObject* content);
  33. static void internal_setExpanded(ScriptGUIComponentFoldout* nativeInstance, bool expanded);
  34. static void internal_getIsExpanded(ScriptGUIComponentFoldout* nativeInstance, bool* isExpanded);
  35. static void internal_setTint(ScriptGUIComponentFoldout* nativeInstance, Color color);
  36. typedef void (__stdcall *OnToggledThunkDef) (MonoObject*, bool, MonoException**);
  37. typedef void(__stdcall *OnRemoveClickedThunkDef) (MonoObject*, MonoException**);
  38. static OnToggledThunkDef onToggledThunk;
  39. static OnRemoveClickedThunkDef onRemoveClickedThunk;
  40. };
  41. }