iup_widget_name.e 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. deferred class IUP_WIDGET_NAME
  2. -- Commands to handle the attributes related with name.
  3. inherit
  4. IUP_WIDGET_INTERNALS
  5. feature {ANY}
  6. set_name (name: STRING)
  7. -- Set the name of the control inside the dialog.
  8. do
  9. iup_open.set_attribute(Current, "NAME", name)
  10. end
  11. get_name: STRING
  12. -- Return the name of the element.
  13. do
  14. Result := iup_open.get_attribute(Current, "NAME")
  15. end
  16. get_dialog_child (name: STRING): detachable IUP_WIDGET
  17. -- Returns the child element that has the NAME attribute equals to the
  18. -- given value on the same dialog hierarchy. Works also for children
  19. -- of a menu that is associated with a dialog.
  20. -- This function will only found the child if the NAME attribute
  21. -- is set at the control.
  22. do
  23. Result := iup_open.iup_get_dialog_child(Current, name)
  24. end
  25. end
  26. -- The MIT License (MIT)
  27. -- Copyright (c) 2016, 2017, 2019 by German A. Arias
  28. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  29. -- of this software and associated documentation files (the "Software"), to deal
  30. -- in the Software without restriction, including without limitation the rights
  31. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  32. -- copies of the Software, and to permit persons to whom the Software is
  33. -- furnished to do so, subject to the following conditions:
  34. --
  35. -- The above copyright notice and this permission notice shall be included in
  36. -- all copies or substantial portions of the Software.
  37. --
  38. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  39. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  40. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  41. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  42. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  43. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  44. -- SOFTWARE.