BsScriptGUIScrollArea.h 2.2 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 "BsScriptGUIElement.h"
  6. #include "BsGUIScrollArea.h"
  7. namespace BansheeEngine
  8. {
  9. /**
  10. * @brief Interop class between C++ & CLR for GUIScrollArea.
  11. */
  12. class BS_SCR_BE_EXPORT ScriptGUIScrollArea : public TScriptGUIElement<ScriptGUIScrollArea>
  13. {
  14. public:
  15. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIScrollArea")
  16. /**
  17. * @brief Initializes the interop object by providing it with the interop object for
  18. * the internal layout held by the scroll area.
  19. */
  20. void initialize(ScriptGUIScrollAreaLayout* layout);
  21. private:
  22. friend class ScriptGUIScrollAreaLayout;
  23. ScriptGUIScrollArea(MonoObject* instance, GUIScrollArea* scrollArea);
  24. /**
  25. * @copydoc TScriptGUIElement::destroy
  26. */
  27. void destroy() override;
  28. /**
  29. * @brief Called when the child script GUI layout gets destroyed. Notifies this object that it shouldn't
  30. * use it anymore.
  31. */
  32. void notifyLayoutDestroyed();
  33. ScriptGUIScrollAreaLayout* mLayout;
  34. /************************************************************************/
  35. /* CLR HOOKS */
  36. /************************************************************************/
  37. static void internal_createInstance(MonoObject* instance, ScrollBarType vertBarType, ScrollBarType horzBarType,
  38. MonoString* scrollBarStyle, MonoString* scrollAreaStyle, MonoArray* guiOptions);
  39. static void internal_getContentBounds(ScriptGUIScrollArea* nativeInstance, Rect2I* bounds);
  40. static float internal_getHorzScroll(ScriptGUIScrollArea* nativeInstance);
  41. static void internal_setHorzScroll(ScriptGUIScrollArea* nativeInstance, float value);
  42. static float internal_getVertScroll(ScriptGUIScrollArea* nativeInstance);
  43. static void internal_setVertScroll(ScriptGUIScrollArea* nativeInstance, float value);
  44. static int internal_getScrollBarWidth(ScriptGUIScrollArea* nativeInstance);
  45. };
  46. }