GUITextBox.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. namespace BansheeEngine
  4. {
  5. public sealed class GUITextBox : GUIElement
  6. {
  7. public GUITextBox(bool multiline, string style, params GUIOption[] options)
  8. {
  9. Internal_CreateInstance(this, multiline, style, options);
  10. }
  11. public GUITextBox(bool multiline, params GUIOption[] options)
  12. {
  13. Internal_CreateInstance(this, multiline, "", options);
  14. }
  15. public GUITextBox(string style, params GUIOption[] options)
  16. {
  17. Internal_CreateInstance(this, false, style, options);
  18. }
  19. public GUITextBox(params GUIOption[] options)
  20. {
  21. Internal_CreateInstance(this, false, "", options);
  22. }
  23. public string Text
  24. {
  25. get { string value; Internal_GetText(mCachedPtr, out value); return value; }
  26. set { Internal_SetText(mCachedPtr, value); }
  27. }
  28. public void SetTint(Color color)
  29. {
  30. Internal_SetTint(mCachedPtr, color);
  31. }
  32. [MethodImpl(MethodImplOptions.InternalCall)]
  33. private static extern void Internal_CreateInstance(GUITextBox instance, bool multiline, string style, GUIOption[] options);
  34. [MethodImpl(MethodImplOptions.InternalCall)]
  35. private static extern void Internal_SetText(IntPtr nativeInstance, string text);
  36. [MethodImpl(MethodImplOptions.InternalCall)]
  37. private static extern void Internal_GetText(IntPtr nativeInstance, out string text);
  38. [MethodImpl(MethodImplOptions.InternalCall)]
  39. private static extern void Internal_SetTint(IntPtr nativeInstance, Color color);
  40. }
  41. }