iup_widget_custom_attributes.e 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. deferred class IUP_WIDGET_CUSTOM_ATTRIBUTES
  2. -- Commands to handle custom attributes.
  3. inherit
  4. IUP_WIDGET_INTERNALS
  5. feature {ANY}
  6. set_attribute_widget (key: STRING; wgt: IUP_WIDGET)
  7. -- Stores an IUP_WIDGET object under the key.
  8. do
  9. iup_open.set_attribute_handle(Current, key, wgt)
  10. end
  11. get_attribute_widget (key: STRING): IUP_WIDGET
  12. -- Return the associated IUP_WIDGET object.
  13. do
  14. Result := iup_open.get_attribute_widget(Current, key)
  15. end
  16. set_attribute_string (key, value: STRING)
  17. -- Stores a string under the key.
  18. do
  19. iup_open.set_attribute(Current, key, value)
  20. end
  21. get_attribute_string (key: STRING): STRING
  22. -- Return the associated string.
  23. do
  24. Result := iup_open.get_attribute(Current, key)
  25. end
  26. set_attribute_integer (key: STRING; value: INTEGER)
  27. -- Stores an integer under the key.
  28. do
  29. iup_open.set_int(Current, key, value)
  30. end
  31. get_attribute_integer (key: STRING): INTEGER
  32. -- Return the associated string.
  33. do
  34. Result := iup_open.get_int (Current, key)
  35. end
  36. end
  37. -- The MIT License (MIT)
  38. -- Copyright (c) 2017, 2019 by German A. Arias
  39. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  40. -- of this software and associated documentation files (the "Software"), to deal
  41. -- in the Software without restriction, including without limitation the rights
  42. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  43. -- copies of the Software, and to permit persons to whom the Software is
  44. -- furnished to do so, subject to the following conditions:
  45. --
  46. -- The above copyright notice and this permission notice shall be included in
  47. -- all copies or substantial portions of the Software.
  48. --
  49. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  50. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  51. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  52. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  53. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  54. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  55. -- SOFTWARE.