iup_widget_highlight.e 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. deferred class IUP_WIDGET_HIGHLIGHT
  2. -- Commands to handle the additional features to highlight state in flat
  3. -- controls.
  4. inherit
  5. IUP_WIDGET_INTERNALS
  6. feature {ANY}
  7. set_rgb_highlight_color (red: INTEGER; green: INTEGER; blue: INTEGER)
  8. -- color used to indicate a highlight state. Default: "200 225 245".
  9. do
  10. iup_open.set_attribute(Current, "HLCOLOR", rgb_to_string(red, green, blue))
  11. end
  12. reset_highlight_color
  13. -- BGCOLOR will be used.
  14. do
  15. iup_open.set_attribute_null(Current, "HLCOLOR")
  16. end
  17. set_rgb_text_highlight_color (red: INTEGER; green: INTEGER; blue: INTEGER)
  18. -- text color used to indicate a highlight state. If not defined FGCOLOR
  19. -- will be used instead.
  20. do
  21. iup_open.set_attribute(Current, "TEXTHLCOLOR", rgb_to_string(red, green, blue))
  22. end
  23. is_highlighted: BOOLEAN
  24. -- Returns the button state if highlighted.
  25. local
  26. str: STRING
  27. do
  28. str := iup_open.get_attribute(Current, "HIGHLIGHTED")
  29. Result := yesno_to_boolean(str)
  30. end
  31. end
  32. -- The MIT License (MIT)
  33. -- Copyright (c) 2019 by German A. Arias
  34. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  35. -- of this software and associated documentation files (the "Software"), to deal
  36. -- in the Software without restriction, including without limitation the rights
  37. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  38. -- copies of the Software, and to permit persons to whom the Software is
  39. -- furnished to do so, subject to the following conditions:
  40. --
  41. -- The above copyright notice and this permission notice shall be included in
  42. -- all copies or substantial portions of the Software.
  43. --
  44. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  45. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  46. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  47. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  48. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  49. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  50. -- SOFTWARE.