GUIOption.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. using System.Runtime.InteropServices;
  2. namespace BansheeEngine
  3. {
  4. [StructLayout(LayoutKind.Sequential)]
  5. public struct GUIOption
  6. {
  7. internal enum Type
  8. {
  9. FixedWidth,
  10. FlexibleWidth,
  11. FixedHeight,
  12. FlexibleHeight
  13. }
  14. internal int min, max;
  15. internal Type type;
  16. public static GUIOption FixedWidth(int width)
  17. {
  18. GUIOption option = new GUIOption();
  19. option.min = option.max = width;
  20. option.type = Type.FixedWidth;
  21. return option;
  22. }
  23. public static GUIOption FixedHeight(int height)
  24. {
  25. GUIOption option = new GUIOption();
  26. option.min = option.max = height;
  27. option.type = Type.FixedHeight;
  28. return option;
  29. }
  30. public static GUIOption FlexibleWidth(int minWidth, int maxWidth)
  31. {
  32. GUIOption option = new GUIOption();
  33. option.min = minWidth;
  34. option.max = maxWidth;
  35. option.type = Type.FlexibleWidth;
  36. return option;
  37. }
  38. public static GUIOption FlexibleHeight(int minHeight, int maxHeight)
  39. {
  40. GUIOption option = new GUIOption();
  41. option.min = minHeight;
  42. option.max = maxHeight;
  43. option.type = Type.FlexibleHeight;
  44. return option;
  45. }
  46. }
  47. }