BsScriptGUIListBox.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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 "BsGUITexture.h"
  7. namespace BansheeEngine
  8. {
  9. /**
  10. * @brief Interop class between C++ & CLR for GUIListBox.
  11. */
  12. class BS_SCR_BE_EXPORT ScriptGUIListBox : public TScriptGUIElement<ScriptGUIListBox>
  13. {
  14. public:
  15. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUIListBox")
  16. private:
  17. ScriptGUIListBox(MonoObject* instance, GUIListBox* listBox);
  18. /**
  19. * @brief Triggered when the selected index in the native list box changes.
  20. */
  21. static void onSelectionChanged(MonoObject* instance, UINT32 index, bool enabled);
  22. /************************************************************************/
  23. /* CLR HOOKS */
  24. /************************************************************************/
  25. static void internal_createInstance(MonoObject* instance, MonoArray* elements, bool multiselect, MonoString* style, MonoArray* guiOptions);
  26. static void internal_setElements(ScriptGUIListBox* nativeInstance, MonoArray* elements);
  27. static void internal_setTint(ScriptGUIListBox* nativeInstance, Color* color);
  28. static void internal_selectElement(ScriptGUIListBox* nativeInstance, int idx);
  29. static void internal_deselectElement(ScriptGUIListBox* nativeInstance, int idx);
  30. static MonoArray* internal_getElementStates(ScriptGUIListBox* nativeInstance);
  31. static void internal_setElementStates(ScriptGUIListBox* nativeInstance, MonoArray* states);
  32. typedef void (__stdcall *OnSelectionChangedThunkDef) (MonoObject*, UINT32, MonoException**);
  33. static OnSelectionChangedThunkDef onSelectionChangedThunk;
  34. };
  35. }