BsScriptGUIListBoxField.h 1.9 KB

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