iup_cbox.e 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. class IUP_CBOX
  2. -- Container for position elements in absolute coordinates. It is a
  3. -- concrete layout container.
  4. -- The IupCbox is equivalent of a IUP_VBOX or IUP_HBOX where all the
  5. -- children have the FLOATING attribute set to YES, but children must use
  6. -- CX and CY attributes instead of the POSITION attribute.
  7. inherit
  8. IUP_CONTAINER
  9. IUP_WIDGET_EXPAND
  10. IUP_WIDGET_SIZE
  11. IUP_WIDGET_RASTERSIZE
  12. IUP_WIDGET_USERSIZE
  13. IUP_WIDGET_WID
  14. IUP_WIDGET_FONT
  15. IUP_WIDGET_CLIENTSIZE
  16. IUP_WIDGET_CLIENTOFFSET
  17. IUP_WIDGET_POSITION
  18. IUP_WIDGET_MAXMIN_SIZE
  19. IUP_WIDGET_CHILD
  20. IUP_WIDGET_NAME
  21. IUP_WIDGET_CUSTOM_ATTRIBUTES
  22. create {ANY}
  23. cbox_empty,
  24. cbox
  25. feature {ANY}
  26. cbox_empty
  27. -- Create an empty cbox
  28. local
  29. p, a_cbox: POINTER
  30. do
  31. a_cbox := int_cbox_empty (p)
  32. set_widget(a_cbox)
  33. end
  34. cbox (col: ARRAY[IUP_WIDGET])
  35. -- Create a new cbox containing the list of widgets
  36. local
  37. i: INTEGER; arg: ARRAY[POINTER]; s: IUP_WIDGET; a_cbox: POINTER
  38. do
  39. i := col.count
  40. create arg.make_filled(default_pointer, 1, i + 1)
  41. i := 0
  42. across
  43. col as ic
  44. loop
  45. i := i + 1
  46. s := ic.item
  47. arg.put(s.widget, i)
  48. end
  49. a_cbox := int_cbox (get_pointer(arg.to_c))
  50. set_widget(a_cbox)
  51. end
  52. feature {NONE}
  53. -- Internals
  54. int_cbox_empty (arguments: POINTER): POINTER
  55. external
  56. "C inline use %"eiffel-iup.h%""
  57. alias
  58. "return IupCbox ($arguments)"
  59. end
  60. int_cbox (arguments: POINTER): POINTER
  61. external
  62. "C inline use %"eiffel-iup.h%""
  63. alias
  64. "return IupCboxv ($arguments);"
  65. end
  66. end -- class IUP_CBOX
  67. -- The MIT License (MIT)
  68. -- Copyright (c) 2016, 2017, 2019, 2020 by German A. Arias
  69. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  70. -- of this software and associated documentation files (the "Software"), to deal
  71. -- in the Software without restriction, including without limitation the rights
  72. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  73. -- copies of the Software, and to permit persons to whom the Software is
  74. -- furnished to do so, subject to the following conditions:
  75. --
  76. -- The above copyright notice and this permission notice shall be included in
  77. -- all copies or substantial portions of the Software.
  78. --
  79. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  80. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  81. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  82. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  83. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  84. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  85. -- SOFTWARE.