iup_message.e 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. class IUP_MESSAGE
  2. -- Shows a dialog centralized on the screen, showing the message and the “OK”
  3. -- button. The ‘%N’ character can be added to the message to indicate line
  4. -- change.
  5. --
  6. -- The dialog uses a global attribute called "PARENTDIALOG" as the parent
  7. -- dialog if it is defined. It also uses a global attribute called "ICON" as
  8. -- the dialog icon if it is defined (used only in Motif, in Windows MessageBox
  9. -- does not have an icon in the title bar).
  10. inherit
  11. IUP_WIDGET
  12. create {ANY}
  13. message
  14. feature {ANY}
  15. message (title: STRING; text: STRING)
  16. -- Create a message dialog with title and text provided
  17. do
  18. int_message (get_pointer(title.to_c), get_pointer(text.to_c))
  19. end
  20. feature {NONE}
  21. -- Internal
  22. int_message (title: POINTER; text: POINTER)
  23. external
  24. "C inline use %"eiffel-iup.h%""
  25. alias
  26. "IupMessage ($title, $text);"
  27. end
  28. end -- class IUP_MESSAGE
  29. -- The MIT License (MIT)
  30. -- Copyright (c) 2016, 2017, 2019 by German A. Arias
  31. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  32. -- of this software and associated documentation files (the "Software"), to deal
  33. -- in the Software without restriction, including without limitation the rights
  34. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  35. -- copies of the Software, and to permit persons to whom the Software is
  36. -- furnished to do so, subject to the following conditions:
  37. --
  38. -- The above copyright notice and this permission notice shall be included in
  39. -- all copies or substantial portions of the Software.
  40. --
  41. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  42. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  43. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  44. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  45. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  46. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  47. -- SOFTWARE.