iup_widget_border.e 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. deferred class IUP_WIDGET_BORDER
  2. -- Commands to handle the attributes related with border.
  3. inherit
  4. IUP_WIDGET_INTERNALS
  5. feature {ANY}
  6. set_rgb_border_color (red: INTEGER; green: INTEGER; blue: INTEGER)
  7. -- color used for borders. Default: "50 150 255". This is for the
  8. -- IUP_DROP_BUTTON drawn border.
  9. do
  10. iup_open.set_attribute(Current, "BORDERCOLOR",
  11. rgb_to_string(red, green, blue))
  12. end
  13. set_rgb_border_press_color (red: INTEGER; green: INTEGER; blue: INTEGER)
  14. -- color used for borders when pressed or selected. Default use
  15. -- BORDERCOLOR.
  16. do
  17. iup_open.set_attribute(Current, "BORDERPSCOLOR",
  18. rgb_to_string(red, green, blue))
  19. end
  20. set_rgb_border_highlight_color (red: INTEGER; green: INTEGER; blue: INTEGER)
  21. -- color used for borders when highlighted. Default use BORDERCOLOR.
  22. do
  23. iup_open.set_attribute(Current, "BORDERHLCOLOR",
  24. rgb_to_string(red, green, blue))
  25. end
  26. set_border_width (value: INTEGER)
  27. -- line width used for borders. Default: "1". Any borders can be hidden
  28. -- by simply setting this value to 0. This is for the IUP_DROP_BUTTON
  29. -- drawn border.
  30. require
  31. value >= 0
  32. do
  33. iup_open.set_attribute(Current, "BORDERWIDTH", value.out)
  34. end
  35. set_show_border (state: BOOLEAN)
  36. -- by default borders are drawn only when the button is highlighted, if
  37. -- SHOWBORDER=True borders are always show. When SHOWBORDER=True and
  38. -- BGCOLOR is not defined, the actual BGCOLOR will be a darker version of
  39. -- the background color of the native parent.
  40. do
  41. iup_open.set_attribute(Current, "SHOWBORDER", boolean_to_yesno(state))
  42. end
  43. end
  44. -- The MIT License (MIT)
  45. -- Copyright (c) 2019 by German A. Arias
  46. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  47. -- of this software and associated documentation files (the "Software"), to deal
  48. -- in the Software without restriction, including without limitation the rights
  49. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  50. -- copies of the Software, and to permit persons to whom the Software is
  51. -- furnished to do so, subject to the following conditions:
  52. --
  53. -- The above copyright notice and this permission notice shall be included in
  54. -- all copies or substantial portions of the Software.
  55. --
  56. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  57. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  58. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  59. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  60. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  61. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  62. -- SOFTWARE.