GUILayout.cs 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. namespace BansheeEngine
  4. {
  5. public abstract class GUILayout : GUIElement
  6. {
  7. internal GUILayout(GUIElement parent)
  8. :base(parent)
  9. { }
  10. public GUILabel AddLabel(GUIContent content, GUIElementStyle style, params GUIOption[] options)
  11. {
  12. return new GUILabel(this, content, style, options);
  13. }
  14. public GUILabel AddLabel(GUIContent content, params GUIOption[] options)
  15. {
  16. return new GUILabel(this, content, null, options);
  17. }
  18. public GUIButton AddButton(GUIContent content, GUIElementStyle style, params GUIOption[] options)
  19. {
  20. return new GUIButton(this, content, style, options);
  21. }
  22. public GUIButton AddButton(GUIContent content, GUIElementStyle style)
  23. {
  24. return new GUIButton(this, content, style, new GUIOption[0]);
  25. }
  26. public GUIButton AddButton(GUIContent content, params GUIOption[] options)
  27. {
  28. return new GUIButton(this, content, null, options);
  29. }
  30. public GUIToggle AddToggle(GUIContent content, GUIElementStyle style, params GUIOption[] options)
  31. {
  32. return new GUIToggle(this, content, null, style, options);
  33. }
  34. public GUIToggle AddToggle(GUIContent content, GUIElementStyle style)
  35. {
  36. return new GUIToggle(this, content, null, style, new GUIOption[0]);
  37. }
  38. public GUIToggle AddToggle(GUIContent content, params GUIOption[] options)
  39. {
  40. return new GUIToggle(this, content, null, null, options);
  41. }
  42. public GUIToggle AddToggle(GUIContent content, GUIToggleGroup toggleGroup, GUIElementStyle style, params GUIOption[] options)
  43. {
  44. return new GUIToggle(this, content, toggleGroup, style, options);
  45. }
  46. public GUIToggle AddToggle(GUIContent content, GUIToggleGroup toggleGroup, GUIElementStyle style)
  47. {
  48. return new GUIToggle(this, content, toggleGroup, style, new GUIOption[0]);
  49. }
  50. public GUIToggle AddToggle(GUIContent content, GUIToggleGroup toggleGroup, params GUIOption[] options)
  51. {
  52. return new GUIToggle(this, content, toggleGroup, null, options);
  53. }
  54. public GUITexture AddTexture(SpriteTexture texture, GUIImageScaleMode scale, GUIElementStyle style, params GUIOption[] options)
  55. {
  56. return new GUITexture(this, texture, scale, style, options);
  57. }
  58. public GUITexture AddTexture(SpriteTexture texture, GUIImageScaleMode scale, params GUIOption[] options)
  59. {
  60. return new GUITexture(this, texture, scale, null, options);
  61. }
  62. public GUITexture AddTexture(SpriteTexture texture, GUIElementStyle style, params GUIOption[] options)
  63. {
  64. return new GUITexture(this, texture, GUIImageScaleMode.StretchToFit, style, options);
  65. }
  66. public GUITexture AddTexture(SpriteTexture texture, params GUIOption[] options)
  67. {
  68. return new GUITexture(this, texture, GUIImageScaleMode.StretchToFit, null, options);
  69. }
  70. public GUITextBox AddTextBox(bool multiline, GUIElementStyle style, params GUIOption[] options)
  71. {
  72. return new GUITextBox(this, multiline, style, options);
  73. }
  74. public GUITextBox AddTextBox(bool multiline, params GUIOption[] options)
  75. {
  76. return new GUITextBox(this, multiline, null, options);
  77. }
  78. public GUITextBox AddTextBox(GUIElementStyle style, params GUIOption[] options)
  79. {
  80. return new GUITextBox(this, false, style, options);
  81. }
  82. public GUITextBox AddTextBox(params GUIOption[] options)
  83. {
  84. return new GUITextBox(this, false, null, options);
  85. }
  86. public GUIScrollArea AddScrollArea(ScrollBarType vertBarType, ScrollBarType horzBarType, GUIElementStyle style, params GUIOption[] options)
  87. {
  88. return new GUIScrollArea(this, vertBarType, horzBarType, null, style, options);
  89. }
  90. public GUIScrollArea AddScrollArea(ScrollBarType vertBarType, ScrollBarType horzBarType, params GUIOption[] options)
  91. {
  92. return new GUIScrollArea(this, vertBarType, horzBarType, null, null, options);
  93. }
  94. public GUIScrollArea AddScrollArea(GUIElementStyle style, params GUIOption[] options)
  95. {
  96. return new GUIScrollArea(this, ScrollBarType.ShowIfDoesntFit, ScrollBarType.ShowIfDoesntFit, null, style, options);
  97. }
  98. public GUIScrollArea AddScrollArea(params GUIOption[] options)
  99. {
  100. return new GUIScrollArea(this, ScrollBarType.ShowIfDoesntFit, ScrollBarType.ShowIfDoesntFit, null, null, options);
  101. }
  102. public GUIScrollArea AddScrollArea(ScrollBarType vertBarType, ScrollBarType horzBarType, GUIElementStyle scrollBarStyle, GUIElementStyle scrollAreaStyle, params GUIOption[] options)
  103. {
  104. return new GUIScrollArea(this, vertBarType, horzBarType, scrollBarStyle, scrollAreaStyle, options);
  105. }
  106. public GUIScrollArea AddScrollArea(GUIElementStyle scrollBarStyle, GUIElementStyle scrollAreaStyle, params GUIOption[] options)
  107. {
  108. return new GUIScrollArea(this, ScrollBarType.ShowIfDoesntFit, ScrollBarType.ShowIfDoesntFit, scrollBarStyle, scrollAreaStyle, options);
  109. }
  110. public GUIListBox AddListBox(LocString[] elements, GUIElementStyle style, params GUIOption[] options)
  111. {
  112. return new GUIListBox(this, elements, style, options);
  113. }
  114. public GUIListBox AddListBox(LocString[] elements, params GUIOption[] options)
  115. {
  116. return new GUIListBox(this, elements, null, options);
  117. }
  118. public GUIFixedSpace AddSpace(int size)
  119. {
  120. return new GUIFixedSpace(this, size);
  121. }
  122. public GUIFlexibleSpace AddFlexibleSpace()
  123. {
  124. return new GUIFlexibleSpace(this);
  125. }
  126. [MethodImpl(MethodImplOptions.InternalCall)]
  127. protected static extern void Internal_CreateInstanceXFromArea(GUILayout instance, GUIArea parentArea);
  128. [MethodImpl(MethodImplOptions.InternalCall)]
  129. protected static extern void Internal_CreateInstanceXFromLayout(GUILayout instance, GUILayout parentLayout);
  130. [MethodImpl(MethodImplOptions.InternalCall)]
  131. protected static extern void Internal_CreateInstanceYFromScrollArea(GUILayout instance, GUIScrollArea parentArea);
  132. [MethodImpl(MethodImplOptions.InternalCall)]
  133. protected static extern void Internal_CreateInstanceYFromLayout(GUILayout instance, GUILayout parentLayout);
  134. }
  135. }