BsScriptGUIListBoxField.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. struct __GUIContentInterop;
  9. /** @addtogroup ScriptInteropEditor
  10. * @{
  11. */
  12. /** Interop class between C++ & CLR for GUIListBoxField. */
  13. class BS_SCR_BED_EXPORT ScriptGUIListBoxField : public TScriptGUIElement<ScriptGUIListBoxField>
  14. {
  15. public:
  16. SCRIPT_OBJ(EDITOR_ASSEMBLY, EDITOR_NS, "GUIListBoxField")
  17. private:
  18. /**
  19. * Triggered when the value in the native list box selection changes.
  20. *
  21. * @param[in] newIndex New selection index.
  22. */
  23. void onSelectionChanged(UINT32 newIndex);
  24. ScriptGUIListBoxField(MonoObject* instance, GUIListBoxField* listBoxField);
  25. /************************************************************************/
  26. /* CLR HOOKS */
  27. /************************************************************************/
  28. static void internal_createInstance(MonoObject* instance, MonoArray* elements, bool multiselect,
  29. __GUIContentInterop* title, UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
  30. static void internal_setElements(ScriptGUIListBoxField* nativeInstance, MonoArray* elements);
  31. static UINT32 internal_getValue(ScriptGUIListBoxField* nativeInstance);
  32. static void internal_setValue(ScriptGUIListBoxField* nativeInstance, UINT32 value);
  33. static void internal_selectElement(ScriptGUIListBoxField* nativeInstance, int idx);
  34. static void internal_deselectElement(ScriptGUIListBoxField* nativeInstance, int idx);
  35. static MonoArray* internal_getElementStates(ScriptGUIListBoxField* nativeInstance);
  36. static void internal_setElementStates(ScriptGUIListBoxField* nativeInstance, MonoArray* states);
  37. static void internal_setTint(ScriptGUIListBoxField* nativeInstance, Color* color);
  38. typedef void(BS_THUNKCALL *OnSelectionChangedThunkDef) (MonoObject*, UINT32, MonoException**);
  39. static OnSelectionChangedThunkDef onSelectionChangedThunk;
  40. };
  41. /** @} */
  42. }