MyGUI
3.2.0
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
MyGUIEngine
include
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
// делегаты для событий виджета
63
typedef
delegates::CMultiDelegate1<Widget*>
EventHandle_WidgetVoid
;
64
typedef
delegates::CMultiDelegate2<Widget*, Widget*>
EventHandle_WidgetWidget
;
65
typedef
delegates::CMultiDelegate2<Widget*, bool>
EventHandle_WidgetBool
;
66
typedef
delegates::CMultiDelegate2<Widget*, int>
EventHandle_WidgetInt
;
67
typedef
delegates::CMultiDelegate2<Widget*, size_t>
EventHandle_WidgetSizeT
;
68
typedef
delegates::CMultiDelegate3<Widget*, int, int>
EventHandle_WidgetIntInt
;
69
typedef
delegates::CMultiDelegate4<Widget*, int, int, MouseButton>
EventHandle_WidgetIntIntButton
;
70
typedef
delegates::CMultiDelegate2<Widget*, KeyCode>
EventHandle_WidgetKeyCode
;
71
typedef
delegates::CMultiDelegate3<Widget*, KeyCode, Char>
EventHandle_WidgetKeyCodeChar
;
72
typedef
delegates::CMultiDelegate2<Widget*, const ToolTipInfo& >
EventHandle_WidgetToolTip
;
73
74
class
MYGUI_EXPORT
WidgetInput
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
130
EventHandle_WidgetWidget
131
eventMouseLostFocus
;
132
138
EventHandle_WidgetWidget
139
eventMouseSetFocus
;
140
147
EventPair3to4<EventHandle_WidgetIntInt, EventHandle_WidgetIntIntButton>
148
eventMouseDrag
;
149
156
EventHandle_WidgetIntInt
157
eventMouseMove
;
158
164
EventHandle_WidgetInt
165
eventMouseWheel
;
166
174
EventHandle_WidgetIntIntButton
175
eventMouseButtonPressed
;
176
184
EventHandle_WidgetIntIntButton
185
eventMouseButtonReleased
;
186
191
EventHandle_WidgetVoid
192
eventMouseButtonClick
;
193
198
EventHandle_WidgetVoid
199
eventMouseButtonDoubleClick
;
200
206
EventHandle_WidgetWidget
207
eventKeyLostFocus
;
208
214
EventHandle_WidgetWidget
215
eventKeySetFocus
;
216
223
EventHandle_WidgetKeyCodeChar
224
eventKeyButtonPressed
;
225
231
EventHandle_WidgetKeyCode
232
eventKeyButtonReleased
;
233
240
EventHandle_WidgetBool
241
eventRootMouseChangeFocus
;
242
249
EventHandle_WidgetBool
250
eventRootKeyChangeFocus
;
251
257
EventHandle_WidgetToolTip
258
eventToolTip
;
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__
Generated by
1.8.3.1