iup_widget_popup.e 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. deferred class IUP_WIDGET_POPUP
  2. -- Command to popup dialogs.
  3. inherit
  4. IUP_WIDGET_INTERNALS
  5. feature {ANY}
  6. popup_predefined_xy (x, y: STRING): STRING
  7. -- Displays a dialog or menu in a given position on the screen using
  8. -- predefined values. If there was an error returns IUP_ERROR.
  9. --
  10. -- x: The following predefined values can be used:
  11. --
  12. -- IUP_LEFT: Positions the dialog on the left corner of the main screen
  13. -- IUP_CENTER: Horizontally centralizes the dialog on the main screen
  14. -- IUP_RIGHT: Positions the dialog on the right corner of the main screen
  15. -- IUP_MOUSEPOS: Positions the dialog on the mouse position
  16. -- IUP_CENTERPARENT: Horizontally centralizes the dialog relative to its
  17. -- parent
  18. -- IUP_CURRENT: use the current position of the dialog.
  19. --
  20. -- y: The following predefined calues can be used:
  21. --
  22. -- IUP_TOP: Positions the dialog on the top of the main screen
  23. -- IUP_CENTER: Vertically centralizes the dialog on the main screen
  24. -- IUP_BOTTOM: Positions the dialog on the base of the main screen
  25. -- IUP_MOUSEPOS: Positions the dialog on the mouse position
  26. -- IUP_CENTERPARENT: Vertically centralizes the dialog relative to its
  27. -- parent
  28. -- IUP_CURRENT: use the current position of the dialog.
  29. do
  30. Result := iup_open.popup_predefined_xy (Current, x, y)
  31. end
  32. popup (x, y: INTEGER): STRING
  33. -- Shows a widget and restricts user interaction only to the specified
  34. -- element.
  35. --
  36. -- x: horizontal position of the top left corner of the window or menu,
  37. -- relative to the origin of the main screen.
  38. -- y: vertical position of the top left corner of the window or menu,
  39. -- relative to the origin of the main screen.
  40. do
  41. Result := iup_open.popup(Current, x, y)
  42. end
  43. end
  44. -- The MIT License (MIT)
  45. -- Copyright (c) 2016, 2017, 2019 by German A. Arias
  46. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  47. -- of this software and associated documentation files (the "Software"), to deal
  48. -- in the Software without restriction, including without limitation the rights
  49. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  50. -- copies of the Software, and to permit persons to whom the Software is
  51. -- furnished to do so, subject to the following conditions:
  52. --
  53. -- The above copyright notice and this permission notice shall be included in
  54. -- all copies or substantial portions of the Software.
  55. --
  56. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  57. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  58. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  59. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  60. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  61. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  62. -- SOFTWARE.