UIEvents.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. //
  2. // Copyright (c) 2008-2014 the Urho3D project.
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. #pragma once
  23. #include "../Core/Object.h"
  24. namespace Atomic
  25. {
  26. EVENT(E_WIDGETEVENT, WidgetEvent)
  27. {
  28. PARAM(P_HANDLER, Handler); // UIWidget pointer of widget's OnEvent we are in
  29. PARAM(P_TARGET, Target); // UIWidget pointer
  30. PARAM(P_TYPE, Type); // EVENT_TYPE enum
  31. PARAM(P_X, X); // int
  32. PARAM(P_Y, Y); // int
  33. PARAM(P_DELTAX, DeltaX); // int
  34. PARAM(P_DELTAY, DeltaY); // int
  35. PARAM(P_COUNT, Count); // int
  36. PARAM(P_KEY, Key); // int
  37. PARAM(P_SPECIALKEY, SpecialKey); // enum SPECIAL_KEY
  38. PARAM(P_MODIFIERKEYS, ModifierKeys); // enum MODIFIER_KEYS
  39. PARAM(P_REFID, RefID); // string (TBID)
  40. PARAM(P_TOUCH, Touch); // bool
  41. // EventHandled can be set by event receivers to stop event bubble
  42. PARAM(P_HANDLED, Handled); // [OUT] -> bool
  43. }
  44. EVENT(E_WIDGETLOADED, WidgetLoaded)
  45. {
  46. PARAM(P_WIDGET, Widget); // UIWidget pointer
  47. }
  48. EVENT(E_WIDGETFOCUSCHANGED, WidgetFocusChanged)
  49. {
  50. PARAM(P_WIDGET, Widget); // UIWidget pointer
  51. PARAM(P_FOCUSED, Focused); // bool
  52. }
  53. EVENT(E_WIDGETDELETED, WidgetDeleted)
  54. {
  55. PARAM(P_WIDGET, Widget); // UIWidget pointer
  56. }
  57. EVENT(E_DRAGBEGIN, DragBegin)
  58. {
  59. PARAM(P_TARGET, Source); // UIWidget source
  60. PARAM(P_DRAGOBJECT, DragObject); // UIDragObject pointer
  61. }
  62. EVENT(E_DRAGENTERWIDGET, DragEnterWidget)
  63. {
  64. PARAM(P_WIDGET, Widget); // UIWidget pointer
  65. PARAM(P_DRAGOBJECT, DragObject); // UIDragObject pointer
  66. }
  67. EVENT(E_DRAGEXITWIDGET, DragExitWidget)
  68. {
  69. PARAM(P_WIDGET, Widget); // UIWidget pointer
  70. PARAM(P_DRAGOBJECT, DragObject); // UIDragObject pointer
  71. }
  72. EVENT(E_DRAGENDED, DragEnded)
  73. {
  74. PARAM(P_TARGET, Target); // UIWidget pointer
  75. PARAM(P_DRAGOBJECT, DragObject); // UIDragObject pointer
  76. }
  77. EVENT(E_POPUPMENUSELECT, PopupMenuSelect)
  78. {
  79. PARAM(P_BUTTON, Button); // UIButton that created popup
  80. PARAM(P_REFID, RefID); // string tbid
  81. }
  82. EVENT(E_UISHORTCUT, UIShortcut)
  83. {
  84. PARAM(P_KEY, Key); // int
  85. PARAM(P_QUALIFIERS, Qualifiers); // int
  86. }
  87. }