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 "Wrappers/GUI/BsScriptGUIElement.h"
  6. #include "GUI/BsGUITexture.h"
  7. namespace bs
  8. {
  9. /** @addtogroup ScriptInteropEngine
  10. * @{
  11. */
  12. /** Interop class between C++ & CLR for GUIInputBox. */
  13. class BS_SCR_BE_EXPORT ScriptGUIInputBox : public TScriptGUIElement<ScriptGUIInputBox>
  14. {
  15. public:
  16. SCRIPT_OBJ(ENGINE_ASSEMBLY, "BansheeEngine", "GUITextBox")
  17. private:
  18. ScriptGUIInputBox(MonoObject* instance, GUIInputBox* inputBox);
  19. /** Triggered when the value in the native input box changes. */
  20. void onChanged(const String& newValue);
  21. /** Triggered when the user confirms input in the native input box. */
  22. void onConfirmed();
  23. /************************************************************************/
  24. /* CLR HOOKS */
  25. /************************************************************************/
  26. static void internal_createInstance(MonoObject* instance, bool multiline, MonoString* style, MonoArray* guiOptions);
  27. static void internal_setText(ScriptGUIInputBox* nativeInstance, MonoString* text);
  28. static void internal_getText(ScriptGUIInputBox* nativeInstance, MonoString** text);
  29. static void internal_setTint(ScriptGUIInputBox* nativeInstance, Color* color);
  30. typedef void(BS_THUNKCALL *OnChangedThunkDef) (MonoObject*, MonoString*, MonoException**);
  31. typedef void(BS_THUNKCALL *OnConfirmedThunkDef) (MonoObject*, MonoException**);
  32. static OnChangedThunkDef onChangedThunk;
  33. static OnConfirmedThunkDef onConfirmedThunk;
  34. };
  35. /** @} */
  36. }