iup_widget_screenposition.e 2.2 KB

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