iup_widget_name.e 1.9 KB

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