iup_widget_rastersize.e 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. deferred class IUP_WIDGET_RASTERSIZE
  2. -- Commands to handle the attributes related with raster size.
  3. inherit
  4. IUP_WIDGET_INTERNALS
  5. feature {ANY}
  6. set_raster_size (width: INTEGER; height: INTEGER)
  7. -- Specifies the element User size in pixels.
  8. --
  9. -- You can also set only one of the parameters by setting the other value
  10. -- to 0.
  11. require
  12. non_negative: width >= 0
  13. height >= 0
  14. local
  15. size: STRING
  16. do
  17. size := width.out
  18. size.append_string("x")
  19. size.append_string(height.out)
  20. iup_open.set_attribute(Current, "RASTERSIZE", size)
  21. end
  22. get_raster_size: TUPLE[INTEGER, INTEGER]
  23. -- Returns the Current size, in pixels.
  24. local
  25. size: STRING
  26. do
  27. size := iup_open.get_attribute(Current, "RASTERSIZE")
  28. Result := components_of_size(size)
  29. end
  30. end
  31. -- The MIT License (MIT)
  32. -- Copyright (c) 2016, 2019 by German A. Arias
  33. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  34. -- of this software and associated documentation files (the "Software"), to deal
  35. -- in the Software without restriction, including without limitation the rights
  36. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  37. -- copies of the Software, and to permit persons to whom the Software is
  38. -- furnished to do so, subject to the following conditions:
  39. --
  40. -- The above copyright notice and this permission notice shall be included in
  41. -- all copies or substantial portions of the Software.
  42. --
  43. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  44. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  45. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  46. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  47. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  48. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  49. -- SOFTWARE.