iup_widget_default_enter_esc.e 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. deferred class IUP_WIDGET_DEFAULT_ENTER_ESC
  2. -- Commands to handle default Enter and ESC in dialogs.
  3. inherit
  4. IUP_WIDGET_INTERNALS
  5. feature {ANY}
  6. set_default_enter (name: STRING)
  7. -- Name of the button activated when the user press Enter when focus is
  8. -- in another control of the dialog. Use set_widget_name to
  9. -- associate a button to a name.
  10. do
  11. iup_open.set_attribute(Current, "DEFAULTENTER", name)
  12. end
  13. get_default_enter: STRING
  14. -- Default enter.
  15. do
  16. Result := iup_open.get_attribute(Current, "DEFAULTENTER")
  17. end
  18. set_default_enter_widget (wgt: IUP_WIDGET)
  19. -- Same as "set_default_enter" but using directly the widget.
  20. do
  21. iup_open.set_attribute_widget(Current, "DEFAULTENTER", wgt)
  22. end
  23. get_default_enter_widget: IUP_WIDGET
  24. do
  25. result := iup_open.get_attribute_widget(Current, "DEFAULTENTER")
  26. end
  27. set_default_escape (name: STRING)
  28. -- Name of the button activated when the user press Esc when focus is in
  29. -- another control of the dialog. Use set_widget_name to associate a
  30. -- button to a name.
  31. do
  32. iup_open.set_attribute(Current, "DEFAULTESC", name)
  33. end
  34. get_default_escape: STRING
  35. -- Default esc.
  36. do
  37. Result := iup_open.get_attribute(Current, "DEFAULTESC")
  38. end
  39. set_default_escape_widget (wgt: IUP_WIDGET)
  40. -- Same as "set_default_escape" but using directly the widget.
  41. do
  42. iup_open.set_attribute_widget(Current, "DEFAULTESC", wgt)
  43. end
  44. get_default_escape_widget: IUP_WIDGET
  45. do
  46. result := iup_open.get_attribute_widget(Current, "DEFAULTESC")
  47. end
  48. end
  49. -- The MIT License (MIT)
  50. -- Copyright (c) 2016, 2017, 2019 by German A. Arias
  51. -- Permission is hereby granted, free of charge, to any person obtaining a copy
  52. -- of this software and associated documentation files (the "Software"), to deal
  53. -- in the Software without restriction, including without limitation the rights
  54. -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  55. -- copies of the Software, and to permit persons to whom the Software is
  56. -- furnished to do so, subject to the following conditions:
  57. --
  58. -- The above copyright notice and this permission notice shall be included in
  59. -- all copies or substantial portions of the Software.
  60. --
  61. -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  62. -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  63. -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  64. -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  65. -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  66. -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
  67. -- SOFTWARE.