iup_widget_clientoffset.e 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. deferred class IUP_WIDGET_CLIENTOFFSET
  2. -- Commands to handle the attributes related with clientoffset.
  3. inherit
  4. IUP_WIDGET_INTERNALS
  5. feature {ANY}
  6. get_client_offset: TUPLE[INTEGER, INTEGER]
  7. -- Returns the container native offset to the Client area, see
  8. -- the Layout Guide. Useful for IupFrame, IupTabs and IupDialog
  9. -- that have decorations. Can also be consulted in other
  10. -- containers, it will simply return "0x0".
  11. -- This attribute can be used in conjunction with the POSITION
  12. -- attribute of a child so the coordinates of a child relative to
  13. -- the native parent can be obtained.
  14. -- The returned values are integer corresponding to the horizontal
  15. -- and vertical offsets, respectively, in pixels.
  16. -- This is a read-only attribute.
  17. local
  18. offset: STRING
  19. do
  20. offset := iup_open.get_attribute(Current, "CLIENTOFFSET")
  21. Result := components_of_size(offset)
  22. end
  23. end
  24. -- The MIT License (MIT)
  25. -- Copyright (c) 2016, 2019 by German A. Arias
  26. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  27. -- of this software and associated documentation files (the "Software"), to deal
  28. -- in the Software without restriction, including without limitation the rights
  29. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  30. -- copies of the Software, and to permit persons to whom the Software is
  31. -- furnished to do so, subject to the following conditions:
  32. --
  33. -- The above copyright notice and this permission notice shall be included in
  34. -- all copies or substantial portions of the Software.
  35. --
  36. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  37. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  38. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  39. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  40. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  41. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  42. -- SOFTWARE.