iup_widget_screenposition.e 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. deferred class IUP_WIDGET_SCREENPOSITION
  2. -- Commands to handle the attributes related with screenposition.
  3. inherit
  4. IUP_WIDGET_INTERNALS
  5. feature {ANY}
  6. get_screen_position: TUPLE[INTEGER, INTEGER]
  7. -- Returns the absolute horizontal and vertical position of the top
  8. -- left corner of the client area relative to the origin of the
  9. -- main screen in pixels. It is similar to POSITION but relative to
  10. -- the origin of the main screen, instead of the origin of the
  11. -- client area. The origin of the main screen is at the upper left
  12. -- corner, in Windows it is affected by the position of the Start
  13. -- Menu when it is at the top or left side of the screen.
  14. -- This is a read-only attribute.
  15. --
  16. -- IMPORTANT: For the dialog, it is the position of the top left
  17. -- corner of the window, NOT the client area. It is the same
  18. -- position used in showxy and popup. In GTK, if the dialog
  19. -- is hidden the values can be outdated.
  20. local
  21. position: STRING
  22. do
  23. position := iup_open.get_attribute(Current, "SCREENPOSITION")
  24. Result := components_of_position(position)
  25. end
  26. end
  27. -- The MIT License (MIT)
  28. -- Copyright (c) 2016, 2019 by German A. Arias
  29. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  30. -- of this software and associated documentation files (the "Software"), to deal
  31. -- in the Software without restriction, including without limitation the rights
  32. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  33. -- copies of the Software, and to permit persons to whom the Software is
  34. -- furnished to do so, subject to the following conditions:
  35. --
  36. -- The above copyright notice and this permission notice shall be included in
  37. -- all copies or substantial portions of the Software.
  38. --
  39. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  40. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  41. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  42. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  43. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  44. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  45. -- SOFTWARE.