iup_widget_active.e 1.6 KB

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