iup_widget_popup.e 2.9 KB

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