BsScriptGUIButton.h 2.0 KB

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