BsScriptGUIListBoxField.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 "Wrappers/GUI/BsScriptGUIElement.h"
  6. namespace bs
  7. {
  8. /** @addtogroup ScriptInteropEditor
  9. * @{
  10. */
  11. /** Interop class between C++ & CLR for GUIListBoxField. */
  12. class BS_SCR_BED_EXPORT ScriptGUIListBoxField : public TScriptGUIElement<ScriptGUIListBoxField>
  13. {
  14. public:
  15. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIListBoxField")
  16. private:
  17. /**
  18. * Triggered when the value in the native list box selection changes.
  19. *
  20. * @param[in] newIndex New selection index.
  21. */
  22. void onSelectionChanged(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(BS_THUNKCALL *OnSelectionChangedThunkDef) (MonoObject*, UINT32, MonoException**);
  38. static OnSelectionChangedThunkDef onSelectionChangedThunk;
  39. };
  40. /** @} */
  41. }