iup_menu_element.e 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. deferred class IUP_MENU_ELEMENT
  2. inherit
  3. IUP_WIDGET
  4. IUP_WIDGET_CUSTOM_ATTRIBUTES
  5. feature {ANY}
  6. -- Commands to handle the hierarchy
  7. detach
  8. -- Detaches the interface element from its parent.
  9. do
  10. iup_open.iup_detach(Current)
  11. end
  12. get_parent: detachable IUP_WIDGET
  13. -- Return the parent of the element or void if does not have a parent.
  14. do
  15. Result := iup_open.iup_get_parent(Current)
  16. end
  17. get_brother: detachable IUP_WIDGET
  18. -- Return the next element in the parent where this element is
  19. -- placed or void if there is none.
  20. do
  21. Result := iup_open.iup_get_brother(Current)
  22. end
  23. get_dialog: detachable IUP_DIALOG
  24. -- Returns the dialog that contains this interface element. Works
  25. -- also for children of a menu that is associated with a dialog.
  26. -- Returns: the dialog or void if not found.
  27. do
  28. if attached {IUP_DIALOG} iup_open.iup_get_dialog(Current) as dlg then
  29. Result := dlg
  30. end
  31. end
  32. end
  33. -- The MIT License (MIT)
  34. -- Copyright (c) 2016, 2017, 2019 by German A. Arias
  35. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  36. -- of this software and associated documentation files (the "Software"), to deal
  37. -- in the Software without restriction, including without limitation the rights
  38. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  39. -- copies of the Software, and to permit persons to whom the Software is
  40. -- furnished to do so, subject to the following conditions:
  41. --
  42. -- The above copyright notice and this permission notice shall be included in
  43. -- all copies or substantial portions of the Software.
  44. --
  45. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  46. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  47. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  48. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  49. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  50. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  51. -- SOFTWARE.