MyGUI  3.2.0
MyGUI_WidgetInput.h
Go to the documentation of this file.
1 
6 /*
7  This file is part of MyGUI.
8 
9  MyGUI is free software: you can redistribute it and/or modify
10  it under the terms of the GNU Lesser General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  MyGUI is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU Lesser General Public License for more details.
18 
19  You should have received a copy of the GNU Lesser General Public License
20  along with MyGUI. If not, see <http://www.gnu.org/licenses/>.
21 */
22 #ifndef __MYGUI_WIDGET_INPUT_H__
23 #define __MYGUI_WIDGET_INPUT_H__
24 
25 #include "MyGUI_Prerequest.h"
26 #include "MyGUI_Macros.h"
27 #include "MyGUI_WidgetDefines.h"
28 #include "MyGUI_WidgetToolTip.h"
29 #include "MyGUI_MouseButton.h"
30 #include "MyGUI_KeyCode.h"
31 #include "MyGUI_MaskPickInfo.h"
32 #include "MyGUI_Delegate.h"
33 #include "MyGUI_EventPair.h"
34 
35 namespace MyGUI
36 {
37 
62  // делегаты для событий виджета
73 
75  {
76  public:
77  WidgetInput();
78  virtual ~WidgetInput();
79 
81  void setNeedToolTip(bool _value);
83  bool getNeedToolTip() const;
84 
86  void setPointer(const std::string& _value);
88  const std::string& getPointer() const;
89 
91  void setNeedKeyFocus(bool _value);
96  bool getNeedKeyFocus() const;
97 
99  void setNeedMouseFocus(bool _value);
104  bool getNeedMouseFocus() const;
105 
111  void setInheritsPick(bool _value);
113  bool getInheritsPick() const;
114 
116  void setMaskPick(const std::string& _filename);
118  void setMaskPick(const MaskPickInfo& _info);
119 
120  bool isMaskPickInside(const IntPoint& _point, const IntCoord& _coord) const;
121 
122  bool getRootMouseFocus() const;
123  bool getRootKeyFocus() const;
124 
132 
140 
149 
158 
166 
176 
186 
193 
200 
208 
216 
225 
233 
242 
251 
259 
260  /*internal:*/
261  void _riseMouseLostFocus(Widget* _new);
262  void _riseMouseSetFocus(Widget* _old);
263  void _riseMouseDrag(int _left, int _top, MouseButton _id);
264  void _riseMouseMove(int _left, int _top);
265  void _riseMouseWheel(int _rel);
266  void _riseMouseButtonPressed(int _left, int _top, MouseButton _id);
267  void _riseMouseButtonReleased(int _left, int _top, MouseButton _id);
268  void _riseMouseButtonClick();
269  void _riseMouseButtonDoubleClick();
270  void _riseKeyLostFocus(Widget* _new);
271  void _riseKeySetFocus(Widget* _old);
272  void _riseKeyButtonPressed(KeyCode _key, Char _char);
273  void _riseKeyButtonReleased(KeyCode _key);
274  void _riseMouseChangeRootFocus(bool _focus);
275  void _riseKeyChangeRootFocus(bool _focus);
276 
277  void _setRootMouseFocus(bool _value);
278  void _setRootKeyFocus(bool _value);
279 
280  protected:
281  virtual void onMouseLostFocus(Widget* _new);
282  virtual void onMouseSetFocus(Widget* _old);
283  virtual void onMouseDrag(int _left, int _top, MouseButton _id);
284  virtual void onMouseMove(int _left, int _top);
285  virtual void onMouseWheel(int _rel);
286  virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id);
287  virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id);
288  virtual void onMouseButtonClick();
289  virtual void onMouseButtonDoubleClick();
290  virtual void onKeyLostFocus(Widget* _new);
291  virtual void onKeySetFocus(Widget* _old);
292  virtual void onKeyButtonPressed(KeyCode _key, Char _char);
293  virtual void onKeyButtonReleased(KeyCode _key);
294  virtual void onMouseChangeRootFocus(bool _focus);
295  virtual void onKeyChangeRootFocus(bool _focus);
296 
297  private:
298  std::string mPointer;
299  MaskPickInfo mOwnMaskPickInfo;
300 
301  bool mNeedToolTip;
302  bool mInheritsPick;
303  bool mNeedKeyFocus;
304  bool mNeedMouseFocus;
305 
306  bool mRootMouseFocus;
307  bool mRootKeyFocus;
308  };
309 
310 } // namespace MyGUI
311 
312 #endif // __MYGUI_WIDGET_INPUT_H__
EventHandle_WidgetInt eventMouseWheel
delegates::CMultiDelegate2< Widget *, int > EventHandle_WidgetInt
delegates::CMultiDelegate4< Widget *, int, int, MouseButton > EventHandle_WidgetIntIntButton
delegates::CMultiDelegate2< Widget *, const ToolTipInfo & > EventHandle_WidgetToolTip
delegates::CMultiDelegate2< Widget *, KeyCode > EventHandle_WidgetKeyCode
delegates::CMultiDelegate2< Widget *, bool > EventHandle_WidgetBool
delegates::CMultiDelegate3< Widget *, KeyCode, Char > EventHandle_WidgetKeyCodeChar
EventHandle_WidgetBool eventRootKeyChangeFocus
EventHandle_WidgetVoid eventMouseButtonClick
EventHandle_WidgetIntIntButton eventMouseButtonReleased
EventHandle_WidgetBool eventRootMouseChangeFocus
EventHandle_WidgetKeyCodeChar eventKeyButtonPressed
delegates::CMultiDelegate2< Widget *, Widget * > EventHandle_WidgetWidget
EventHandle_WidgetWidget eventMouseLostFocus
EventHandle_WidgetIntInt eventMouseMove
delegates::CMultiDelegate1< Widget * > EventHandle_WidgetVoid
EventHandle_WidgetWidget eventKeySetFocus
#define MYGUI_EXPORT
delegates::CMultiDelegate3< Widget *, int, int > EventHandle_WidgetIntInt
unsigned int Char
Definition: MyGUI_Types.h:66
EventHandle_WidgetVoid eventMouseButtonDoubleClick
EventHandle_WidgetWidget eventKeyLostFocus
EventHandle_WidgetWidget eventMouseSetFocus
EventHandle_WidgetIntIntButton eventMouseButtonPressed
EventPair3to4< EventHandle_WidgetIntInt, EventHandle_WidgetIntIntButton > eventMouseDrag
delegates::CMultiDelegate2< Widget *, size_t > EventHandle_WidgetSizeT
EventHandle_WidgetToolTip eventToolTip
EventHandle_WidgetKeyCode eventKeyButtonReleased