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