BsScriptGUIListBoxField.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsScriptEditorPrerequisites.h"
  5. #include "BsScriptGUIElement.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief Interop class between C++ & CLR for GUIListBoxField.
  10. */
  11. class BS_SCR_BED_EXPORT ScriptGUIListBoxField : public TScriptGUIElement<ScriptGUIListBoxField>
  12. {
  13. public:
  14. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIListBoxField")
  15. private:
  16. /**
  17. * @brief Triggered when the value in the native list box selection changes.
  18. *
  19. * @param instance Managed GUIListBoxField instance.
  20. * @param newIndex New selection index.
  21. */
  22. static void onSelectionChanged(MonoObject* instance, UINT32 newIndex);
  23. ScriptGUIListBoxField(MonoObject* instance, GUIListBoxField* listBoxField);
  24. /************************************************************************/
  25. /* CLR HOOKS */
  26. /************************************************************************/
  27. static void internal_createInstance(MonoObject* instance, MonoArray* elements, bool multiselect,
  28. MonoObject* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
  29. static void internal_setElements(ScriptGUIListBoxField* nativeInstance, MonoArray* elements);
  30. static UINT32 internal_getValue(ScriptGUIListBoxField* nativeInstance);
  31. static void internal_setValue(ScriptGUIListBoxField* nativeInstance, UINT32 value);
  32. static void internal_selectElement(ScriptGUIListBoxField* nativeInstance, int idx);
  33. static void internal_deselectElement(ScriptGUIListBoxField* nativeInstance, int idx);
  34. static MonoArray* internal_getElementStates(ScriptGUIListBoxField* nativeInstance);
  35. static void internal_setElementStates(ScriptGUIListBoxField* nativeInstance, MonoArray* states);
  36. static void internal_setTint(ScriptGUIListBoxField* nativeInstance, Color* color);
  37. typedef void(__stdcall *OnSelectionChangedThunkDef) (MonoObject*, UINT32, MonoException**);
  38. static OnSelectionChangedThunkDef onSelectionChangedThunk;
  39. };
  40. }