BsScriptGUIColorField.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include "BsScriptEditorPrerequisites.h"
  3. #include "BsScriptGUIElement.h"
  4. #include "BsColor.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Interop class between C++ & CLR for GUIColorField.
  9. */
  10. class BS_SCR_BED_EXPORT ScriptGUIColorField : public TScriptGUIElement<ScriptGUIColorField>
  11. {
  12. public:
  13. SCRIPT_OBJ(EDITOR_ASSEMBLY, "BansheeEditor", "GUIColorField")
  14. private:
  15. ScriptGUIColorField(MonoObject* instance, GUIColorField* colorField);
  16. /**
  17. * @brief Triggered when the value in the native color field changes.
  18. *
  19. * @param instance Managed GUIColorField instance.
  20. * @param newValue New color value.
  21. */
  22. static void onChanged(MonoObject* instance, Color newValue);
  23. /************************************************************************/
  24. /* CLR HOOKS */
  25. /************************************************************************/
  26. static void internal_createInstance(MonoObject* instance, MonoObject* title, UINT32 titleWidth,
  27. MonoString* style, MonoArray* guiOptions, bool withTitle);
  28. static void internal_getValue(ScriptGUIColorField* nativeInstance, Color* output);
  29. static void internal_setValue(ScriptGUIColorField* nativeInstance, Color value);
  30. static void internal_setTint(ScriptGUIColorField* nativeInstance, Color color);
  31. typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, Color, MonoException**);
  32. static OnChangedThunkDef onChangedThunk;
  33. };
  34. }