BsScriptGUIButton.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #pragma once
  2. #include "BsScriptEnginePrerequisites.h"
  3. #include "BsScriptGUIElement.h"
  4. #include "BsColor.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Interop class between C++ & CLR for GUIButton.
  9. */
  10. class BS_SCR_BE_EXPORT ScriptGUIButton : public TScriptGUIElement<ScriptGUIButton>
  11. {
  12. public:
  13. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIButton")
  14. private:
  15. ScriptGUIButton(MonoObject* instance, GUIButton* button);
  16. /**
  17. * @brief Triggers when the GUI button is clicked.
  18. */
  19. static void onClick(MonoObject* instance);
  20. /**
  21. * @brief Triggers when the GUI button is double-clicked.
  22. */
  23. static void onDoubleClick(MonoObject* instance);
  24. /**
  25. * @brief Triggers when the GUI button is hovered over.
  26. */
  27. static void onHover(MonoObject* instance);
  28. /**
  29. * @brief Triggers when the pointer leaves the GUI button.
  30. */
  31. static void onOut(MonoObject* instance);
  32. /************************************************************************/
  33. /* CLR HOOKS */
  34. /************************************************************************/
  35. static void internal_createInstance(MonoObject* instance, MonoObject* content, MonoString* style, MonoArray* guiOptions);
  36. static void internal_setContent(ScriptGUIButton* nativeInstance, MonoObject* content);
  37. static void internal_setTint(ScriptGUIButton* nativeInstance, Color color);
  38. typedef void (__stdcall *OnClickThunkDef) (MonoObject*, MonoException**);
  39. typedef void (__stdcall *OnDoubleClickThunkDef) (MonoObject*, MonoException**);
  40. typedef void (__stdcall *OnHoverThunkDef) (MonoObject*, MonoException**);
  41. typedef void (__stdcall *OnOutThunkDef) (MonoObject*, MonoException**);
  42. static OnClickThunkDef onClickThunk;
  43. static OnDoubleClickThunkDef onDoubleClickThunk;
  44. static OnHoverThunkDef onHoverThunk;
  45. static OnOutThunkDef onOutThunk;
  46. };
  47. }