BsScriptGUIListBoxField.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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] instance Managed GUIListBoxField instance.
  21. * @param[in] newIndex New selection index.
  22. */
  23. static void onSelectionChanged(MonoObject* instance, 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. MonoObject* 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(__stdcall *OnSelectionChangedThunkDef) (MonoObject*, UINT32, MonoException**);
  39. static OnSelectionChangedThunkDef onSelectionChangedThunk;
  40. };
  41. /** @} */
  42. }