BsScriptGUIInputBox.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsScriptEnginePrerequisites.h"
  5. #include "BsScriptGUIElement.h"
  6. #include "BsGUITexture.h"
  7. namespace BansheeEngine
  8. {
  9. /**
  10. * @brief Interop class between C++ & CLR for GUIInputBox.
  11. */
  12. class BS_SCR_BE_EXPORT ScriptGUIInputBox : public TScriptGUIElement<ScriptGUIInputBox>
  13. {
  14. public:
  15. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUITextBox")
  16. private:
  17. ScriptGUIInputBox(MonoObject* instance, GUIInputBox* inputBox);
  18. /**
  19. * @brief Triggered when the value in the native input box changes.
  20. */
  21. static void onChanged(MonoObject* instance, const WString& newValue);
  22. /**
  23. * @brief Triggered when the user confirms input in the native input box.
  24. */
  25. static void onConfirmed(MonoObject* instance);
  26. /************************************************************************/
  27. /* CLR HOOKS */
  28. /************************************************************************/
  29. static void internal_createInstance(MonoObject* instance, bool multiline, MonoString* style, MonoArray* guiOptions);
  30. static void internal_setText(ScriptGUIInputBox* nativeInstance, MonoString* text);
  31. static void internal_getText(ScriptGUIInputBox* nativeInstance, MonoString** text);
  32. static void internal_setTint(ScriptGUIInputBox* nativeInstance, Color* color);
  33. typedef void(__stdcall *OnChangedThunkDef) (MonoObject*, MonoString*, MonoException**);
  34. typedef void(__stdcall *OnConfirmedThunkDef) (MonoObject*, MonoException**);
  35. static OnChangedThunkDef onChangedThunk;
  36. static OnConfirmedThunkDef onConfirmedThunk;
  37. };
  38. }