iup_widget_visible.e 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. deferred class IUP_WIDGET_VISIBLE
  2. -- Command to handle the visible status.
  3. inherit
  4. IUP_WIDGET_INTERNALS
  5. IUP_WIDGET_FLOATING
  6. feature {ANY}
  7. set_visible (state: BOOLEAN)
  8. -- Shows or hides the element.
  9. do
  10. iup_open.set_attribute(Current, "VISIBLE", boolean_to_yesno(state))
  11. end
  12. is_visible: BOOLEAN
  13. -- Return the visible status of the element.
  14. local
  15. str: STRING
  16. do
  17. str := iup_open.get_attribute(Current, "VISIBLE")
  18. Result := yesno_to_boolean(str)
  19. end
  20. end
  21. -- The MIT License (MIT)
  22. -- Copyright (c) 2016, 2018, 2019 by German A. Arias
  23. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  24. -- of this software and associated documentation files (the "Software"), to deal
  25. -- in the Software without restriction, including without limitation the rights
  26. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  27. -- copies of the Software, and to permit persons to whom the Software is
  28. -- furnished to do so, subject to the following conditions:
  29. --
  30. -- The above copyright notice and this permission notice shall be included in
  31. -- all copies or substantial portions of the Software.
  32. --
  33. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  34. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  35. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  36. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  37. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  38. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  39. -- SOFTWARE.