1
0

groupclickwnd.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. /* This class simulates a very basic button thru the use of a group. the group needs to have a guiobject (ie: a transparent layer)
  2. with id "mousetrap" on top of the rest of its content. */
  3. #ifndef __GROUPCLICKWND_H
  4. #define __GROUPCLICKWND_H
  5. #include <api/wnd/wndclass/guiobjwnd.h>
  6. #include <api/script/objects/c_script/h_guiobject.h>
  7. class MouseTrap;
  8. /**
  9. Class
  10. @short
  11. @author Nullsoft
  12. @ver 1.0
  13. @see
  14. */
  15. class GroupClickWnd : public GuiObjectWnd {
  16. public:
  17. /**
  18. Method
  19. @see
  20. @ret
  21. @param
  22. */
  23. GroupClickWnd();
  24. /**
  25. Method
  26. @see
  27. @ret
  28. @param
  29. */
  30. virtual ~GroupClickWnd();
  31. /**
  32. Method
  33. @see
  34. @ret
  35. @param
  36. */
  37. virtual void content_onLeftButtonDown();
  38. /**
  39. Method
  40. @see
  41. @ret
  42. @param
  43. */
  44. virtual void content_onLeftButtonUp();
  45. /**
  46. Method
  47. @see
  48. @ret
  49. @param
  50. */
  51. virtual void content_onRightButtonDown();
  52. /**
  53. Method
  54. @see
  55. @ret
  56. @param
  57. */
  58. virtual void content_onRightButtonUp();
  59. /**
  60. Method
  61. @see
  62. @ret
  63. @param
  64. */
  65. virtual void content_onEnterArea();
  66. /**
  67. Method
  68. @see
  69. @ret
  70. @param
  71. */
  72. virtual void content_onLeaveArea();
  73. /**
  74. Method
  75. @see
  76. @ret
  77. @param
  78. */
  79. virtual void groupclick_onLeftPush();
  80. /**
  81. Method
  82. @see
  83. @ret
  84. @param
  85. */
  86. virtual void groupclick_onRightPush();
  87. /**
  88. Method
  89. @see
  90. @ret
  91. @param
  92. */
  93. virtual void abstract_onNewContent();
  94. private:
  95. int inarea;
  96. MouseTrap *trap;
  97. };
  98. /**
  99. Class
  100. @short
  101. @author Nullsoft
  102. @ver 1.0
  103. @see
  104. */
  105. class MouseTrap : public H_GuiObject {
  106. public:
  107. /**
  108. Method
  109. @see
  110. @ret
  111. @param
  112. */
  113. MouseTrap(GroupClickWnd *w, ScriptObject *obj) : H_GuiObject(obj), window(w) { }
  114. /**
  115. Method
  116. @see
  117. @ret
  118. @param
  119. */
  120. virtual ~MouseTrap() {}
  121. /**
  122. Method
  123. @see
  124. @ret
  125. @param
  126. */
  127. virtual void hook_onLeftButtonDown(int x, int y);
  128. /**
  129. Method
  130. @see
  131. @ret
  132. @param
  133. */
  134. virtual void hook_onLeftButtonUp(int x, int y);
  135. /**
  136. Method
  137. @see
  138. @ret
  139. @param
  140. */
  141. virtual void hook_onRightButtonDown(int x, int y);
  142. /**
  143. Method
  144. @see
  145. @ret
  146. @param
  147. */
  148. virtual void hook_onRightButtonUp(int x, int y);
  149. /**
  150. Method
  151. @see
  152. @ret
  153. @param
  154. */
  155. virtual void hook_onEnterArea();
  156. /**
  157. Method
  158. @see
  159. @ret
  160. @param
  161. */
  162. virtual void hook_onLeaveArea();
  163. private:
  164. GroupClickWnd *window;
  165. };
  166. #endif