BsScriptGUITextField.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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 GUITextField. */
  13. class BS_SCR_BED_EXPORT ScriptGUITextField : public TScriptGUIElement<ScriptGUITextField>
  14. {
  15. public:
  16. SCRIPT_OBJ(EDITOR_ASSEMBLY, EDITOR_NS, "GUITextField")
  17. private:
  18. /**
  19. * Triggered when the value in the native text field changes.
  20. *
  21. * @param[in] newValue New string value.
  22. */
  23. void onChanged(const String& newValue);
  24. /** Triggered when the user confirms input in the native text field. */
  25. void onConfirmed();
  26. ScriptGUITextField(MonoObject* instance, GUITextField* textField);
  27. /************************************************************************/
  28. /* CLR HOOKS */
  29. /************************************************************************/
  30. static void internal_createInstance(MonoObject* instance, bool multiline, __GUIContentInterop* title,
  31. UINT32 titleWidth, MonoString* style, MonoArray* guiOptions, bool withTitle);
  32. static void internal_getValue(ScriptGUITextField* nativeInstance, MonoString** output);
  33. static void internal_setValue(ScriptGUITextField* nativeInstance, MonoString* value);
  34. static void internal_hasInputFocus(ScriptGUITextField* nativeInstance, bool* output);
  35. static void internal_setTint(ScriptGUITextField* nativeInstance, Color* color);
  36. typedef void(BS_THUNKCALL *OnChangedThunkDef) (MonoObject*, MonoString*, MonoException**);
  37. typedef void(BS_THUNKCALL *OnConfirmedThunkDef) (MonoObject*, MonoException**);
  38. static OnChangedThunkDef onChangedThunk;
  39. static OnConfirmedThunkDef onConfirmedThunk;
  40. };
  41. /** @} */
  42. }