iup_flat_label.e 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. class IUP_FLAT_LABEL
  2. -- Creates an interface element that is a label, but it does not have native
  3. -- decorations. Its visual presentation can contain a text and/or an image.
  4. --
  5. -- It behaves just like an IUP_LABEL, but since it is not a native control it
  6. -- has more flexibility for additional options.
  7. --
  8. -- It inherits from IUP_CANVAS.
  9. --
  10. -- Notes:
  11. --
  12. -- The IUP_FLAT_LABEL can contain text and image simultaneously.
  13. --
  14. -- The natural size will be a combination of the size of the image and the
  15. -- title, if any, plus PADDING and SPACING (if both image and title are
  16. -- present).
  17. --
  18. -- The IUP_LABEL SEPARATOR attribute to configure a separator (horizontal or
  19. -- vertical lines) is not supported. ELLIPSIS, MARKUP and WORDWRAP IUP_LABEL
  20. -- attributes are also not supported. Mnemonics are not supported.
  21. inherit
  22. IUP_CANVAS
  23. redefine
  24. set_border
  25. end
  26. IUP_WIDGET_FGCOLOR
  27. IUP_WIDGET_SPACING
  28. IUP_WIDGET_TITLE
  29. IUP_WIDGET_PADDING
  30. IUP_WIDGET_FLAT_TEXT
  31. IUP_WIDGET_BACK_IMAGE_1
  32. IUP_WIDGET_FRONT_IMAGE_1
  33. IUP_WIDGET_IMAGE_1
  34. create {ANY}
  35. flat_label
  36. feature {ANY}
  37. flat_label (text: STRING)
  38. -- Create a new flat label with the provided text.
  39. local
  40. a_flat_label: POINTER
  41. do
  42. a_flat_label := int_flat_label (text.to_external)
  43. set_widget(a_flat_label)
  44. end
  45. -- Attributes
  46. set_border (state: BOOLEAN)
  47. -- (creation only): Shows a border around the canvas. Default: "False".
  48. do
  49. Precursor (state)
  50. end
  51. feature {}
  52. -- Internals
  53. int_flat_label (text: POINTER): POINTER
  54. external "plug_in"
  55. alias "{
  56. location: "${sys}/plugins"
  57. module_name: "iup"
  58. feature_name: "IupFlatLabel"
  59. }"
  60. end
  61. end -- class IUP_FLAT_LABEL
  62. -- The MIT License (MIT)
  63. -- Copyright (c) 2018, 2019 by German A. Arias
  64. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  65. -- of this software and associated documentation files (the "Software"), to deal
  66. -- in the Software without restriction, including without limitation the rights
  67. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  68. -- copies of the Software, and to permit persons to whom the Software is
  69. -- furnished to do so, subject to the following conditions:
  70. --
  71. -- The above copyright notice and this permission notice shall be included in
  72. -- all copies or substantial portions of the Software.
  73. --
  74. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  75. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  76. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  77. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  78. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  79. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  80. -- SOFTWARE.