iup_message_error.e 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. class IUP_MESSAGE_ERROR
  2. -- Shows a modal dialog containing an error message.
  3. inherit
  4. IUP_GET_POINTER
  5. create {ANY}
  6. message_error_with_parent,
  7. message_error
  8. feature {ANY}
  9. message_error_with_parent (parent: IUP_DIALOG; message: STRING)
  10. -- Shows a modal dialog containing an error message:
  11. --
  12. -- parent: parent dialog.
  13. -- message: text message contents. It can be a language pre-defined
  14. -- string without the "_@" prefix.
  15. --
  16. -- The dialog is shown centered relative to its parent. The
  17. -- dialog title will be the same title of the parent dialog.
  18. do
  19. int_parent := parent.widget
  20. int_message := message
  21. end
  22. message_error (message: STRING)
  23. -- Like "message_error_with_parent" but without a parent dialog.
  24. -- The title defaults to "Error!" and tries the global attribute
  25. -- "PARENTDIALOG" as the parent dialog. The dialog title will be the same
  26. -- title of the parent dialog.
  27. do
  28. int_message := message
  29. end
  30. launch
  31. do
  32. int_message_error (int_parent, get_pointer(int_message.to_c))
  33. end
  34. feature {NONE}
  35. -- Internal
  36. int_parent: POINTER
  37. int_message: STRING
  38. int_message_error (wgt, m: POINTER)
  39. external
  40. "C inline use %"eiffel-iup.h%""
  41. alias
  42. "IupMessageError ($wgt, $m);"
  43. end
  44. end -- class IUP_MESSAGE_ERROR
  45. -- The MIT License (MIT)
  46. -- Copyright (c) 2017, 2019 by German A. Arias
  47. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  48. -- of this software and associated documentation files (the "Software"), to deal
  49. -- in the Software without restriction, including without limitation the rights
  50. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  51. -- copies of the Software, and to permit persons to whom the Software is
  52. -- furnished to do so, subject to the following conditions:
  53. --
  54. -- The above copyright notice and this permission notice shall be included in
  55. -- all copies or substantial portions of the Software.
  56. --
  57. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  58. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  59. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  60. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  61. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  62. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  63. -- SOFTWARE.