GUIScrollArea.cs 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. using System.Runtime.CompilerServices;
  2. namespace BansheeEngine
  3. {
  4. public enum ScrollBarType
  5. {
  6. ShowIfDoesntFit,
  7. AlwaysShow,
  8. NeverShow
  9. };
  10. public sealed class GUIScrollArea : GUIElement
  11. {
  12. private GUILayout _mainLayout;
  13. public GUILayout layout
  14. {
  15. get { return _mainLayout; }
  16. }
  17. public GUIScrollArea(ScrollBarType vertBarType, ScrollBarType horzBarType, string scrollBarStyle,
  18. string scrollAreaStyle, params GUIOption[] options)
  19. {
  20. Internal_CreateInstance(this, vertBarType, horzBarType, scrollBarStyle, scrollAreaStyle, options);
  21. _mainLayout = new GUILayoutY(this);
  22. }
  23. public GUIScrollArea(ScrollBarType vertBarType, ScrollBarType horzBarType, string style, params GUIOption[] options)
  24. {
  25. Internal_CreateInstance(this, vertBarType, horzBarType, "", style, options);
  26. _mainLayout = new GUILayoutY(this);
  27. }
  28. public GUIScrollArea(ScrollBarType vertBarType, ScrollBarType horzBarType, params GUIOption[] options)
  29. {
  30. Internal_CreateInstance(this, vertBarType, horzBarType, "", "", options);
  31. _mainLayout = new GUILayoutY(this);
  32. }
  33. public GUIScrollArea(string style, params GUIOption[] options)
  34. {
  35. Internal_CreateInstance(this, ScrollBarType.ShowIfDoesntFit, ScrollBarType.ShowIfDoesntFit, "", style, options);
  36. _mainLayout = new GUILayoutY(this);
  37. }
  38. public GUIScrollArea(params GUIOption[] options)
  39. {
  40. Internal_CreateInstance(this, ScrollBarType.ShowIfDoesntFit, ScrollBarType.ShowIfDoesntFit, "", "", options);
  41. _mainLayout = new GUILayoutY(this);
  42. }
  43. public GUIScrollArea(string scrollBarStyle, string scrollAreaStyle, params GUIOption[] options)
  44. {
  45. Internal_CreateInstance(this, ScrollBarType.ShowIfDoesntFit, ScrollBarType.ShowIfDoesntFit, scrollBarStyle, scrollAreaStyle, options);
  46. _mainLayout = new GUILayoutY(this);
  47. }
  48. public override void Destroy()
  49. {
  50. _mainLayout.Destroy();
  51. base.Destroy();
  52. }
  53. [MethodImpl(MethodImplOptions.InternalCall)]
  54. private static extern void Internal_CreateInstance(GUIScrollArea instance, ScrollBarType vertBarType, ScrollBarType horzBarType,
  55. string scrollBarStyle, string scrollAreaStyle, params GUIOption[] options);
  56. }
  57. }