iup_widget_floating.e 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. deferred class IUP_WIDGET_FLOATING
  2. -- Commands to handle the attributes related with floating.
  3. inherit
  4. IUP_WIDGET_INTERNALS
  5. feature {ANY}
  6. set_floating (state: STRING)
  7. -- If an element has FLOATING=YES then its size and position will
  8. -- be ignored by the layout processing in IUP_VBOX, IUP_HBOX and
  9. -- IUP_ZBOX. But the element size and position will still be updated
  10. -- in the native system allowing the usage of SIZE/RASTERSIZE
  11. -- and POSITION to manually position and size the element. And
  12. -- must ensure that the element will be on top of other using ZORDER,
  13. -- if here is overlap.
  14. -- This is useful when you do not want that an invisible element
  15. -- to be computed in the box size.
  16. -- If the value IGNORE is used then it will behave as YES, but
  17. -- also it will not update the the size and position in the
  18. -- native system.
  19. --
  20. -- Values: "YES", "IGNORE" or "NO".
  21. -- Default: "NO".
  22. require
  23. is_valid: is_yes_no_ignore(state)
  24. do
  25. iup_open.set_attribute(Current, "FLOATING", state)
  26. end
  27. get_floating: STRING
  28. -- Return the floating status of the element.
  29. do
  30. Result := iup_open.get_attribute(Current, "FLOATING")
  31. end
  32. enable_floating
  33. -- Like set_floating with YES.
  34. do
  35. iup_open.set_attribute(Current, "FLOATING", "YES")
  36. end
  37. ignore_floating
  38. -- Like set_floating with IGNORE.
  39. do
  40. iup_open.set_attribute(Current, "FLOATING", "IGNORE")
  41. end
  42. disable_floating
  43. -- Like set_floating with NO.
  44. do
  45. iup_open.set_attribute(Current, "FLOATING", "NO")
  46. end
  47. end
  48. -- The MIT License (MIT)
  49. -- Copyright (c) 2016, 2019 by German A. Arias
  50. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  51. -- of this software and associated documentation files (the "Software"), to deal
  52. -- in the Software without restriction, including without limitation the rights
  53. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  54. -- copies of the Software, and to permit persons to whom the Software is
  55. -- furnished to do so, subject to the following conditions:
  56. --
  57. -- The above copyright notice and this permission notice shall be included in
  58. -- all copies or substantial portions of the Software.
  59. --
  60. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  61. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  62. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  63. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  64. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  65. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  66. -- SOFTWARE.