iup_flat_separator.e 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. class IUP_FLAT_SEPARATOR
  2. -- Creates an interface element that is a Separator, but it does not have
  3. -- native decorations. It inherits from IUP_CANVAS.
  4. inherit
  5. IUP_CANVAS
  6. redefine
  7. set_expand
  8. end
  9. IUP_WIDGET_CLIENTSIZE
  10. IUP_WIDGET_CLIENTOFFSET
  11. create {ANY}
  12. flat_separator
  13. feature {ANY}
  14. flat_separator
  15. -- Create a new flat separator.
  16. local
  17. a_flat_separator: POINTER
  18. do
  19. a_flat_separator := int_flat_separator
  20. set_widget(a_flat_separator)
  21. end
  22. -- Attributes
  23. set_bar_size (value: INTEGER)
  24. -- (non inheritable): controls the size of the separator in the opposite
  25. -- direction of its orientation. Default: 5.
  26. require
  27. value > 0
  28. do
  29. iup_open.set_attribute(Current, "BARSIZE", value.out)
  30. end
  31. set_rgb_color (red: INTEGER; green: INTEGER; blue: INTEGER)
  32. -- (non inheritable): Changes the color of the separator.
  33. -- Default: "192 192 192" (using the RGB values).
  34. do
  35. iup_open.set_attribute(Current, "COLOR", rgb_to_string(red, green, blue))
  36. end
  37. set_vertical_orientation
  38. -- The default value.
  39. do
  40. iup_open.set_attribute(Current, "ORIENTATION", "VERTICAL")
  41. end
  42. set_horizontal_orientation
  43. do
  44. iup_open.set_attribute(Current, "ORIENTATION", "HORIZONTAL")
  45. end
  46. set_expand (type: STRING)
  47. -- (non inheritable): Its behavior depends on the orientation. It will
  48. -- expand in the direction of the separator, but occupying only the
  49. -- available space.
  50. do
  51. Precursor (type)
  52. end
  53. set_style_line
  54. do
  55. iup_open.set_attribute(Current, "STYLE", "LINE")
  56. end
  57. set_style_sunken_line
  58. -- The default value.
  59. do
  60. iup_open.set_attribute(Current, "STYLE", "SUNKENLINE")
  61. end
  62. set_style_dual_lines
  63. do
  64. iup_open.set_attribute(Current, "STYLE", "DUALLINES")
  65. end
  66. set_style_grip
  67. do
  68. iup_open.set_attribute(Current, "STYLE", "GRIP")
  69. end
  70. set_style_fill
  71. do
  72. iup_open.set_attribute(Current, "STYLE", "FILL")
  73. end
  74. feature {NONE}
  75. -- Internals
  76. int_flat_separator: POINTER
  77. external
  78. "C inline use %"eiffel-iup.h%""
  79. alias
  80. "return IupFlatSeparator ();"
  81. end
  82. end -- class IUP_SEPARATOR
  83. -- The MIT License (MIT)
  84. -- Copyright (c) 2018, 2019 by German A. Arias
  85. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  86. -- of this software and associated documentation files (the "Software"), to deal
  87. -- in the Software without restriction, including without limitation the rights
  88. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  89. -- copies of the Software, and to permit persons to whom the Software is
  90. -- furnished to do so, subject to the following conditions:
  91. --
  92. -- The above copyright notice and this permission notice shall be included in
  93. -- all copies or substantial portions of the Software.
  94. --
  95. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  96. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  97. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  98. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  99. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  100. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  101. -- SOFTWARE.