BsScriptGUIButton.h 2.1 KB

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