MyGUI
3.4.3
Main Page
Related Pages
Namespaces
Data Structures
Files
Examples
File List
Globals
MyGUIEngine
include
MyGUI_Window.h
Go to the documentation of this file.
1
/*
2
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
3
* Distributed under the MIT License
4
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
5
*/
6
7
#ifndef MYGUI_WINDOW_H_
8
#define MYGUI_WINDOW_H_
9
10
#include "
MyGUI_Prerequest.h
"
11
#include "
MyGUI_TextBox.h
"
12
#include "
MyGUI_EventPair.h
"
13
#include "
MyGUI_ControllerFadeAlpha.h
"
14
15
namespace
MyGUI
16
{
17
18
// OBSOLETE
19
using
EventHandle_WidgetString
=
EventPairConvertStringView
<
20
delegates::MultiDelegate<Widget*, const std::string&>
,
21
delegates::MultiDelegate<Widget*, std::string_view>
>;
22
23
using
EventHandle_WindowPtrCStringRef
=
EventPairConvertStringView
<
24
delegates::MultiDelegate<Window*, const std::string&>
,
25
delegates::MultiDelegate<Window*, std::string_view>
>;
26
using
EventHandle_WindowPtr
=
delegates::MultiDelegate<Window*>
;
27
31
class
MYGUI_EXPORT
Window
:
32
public
TextBox
,
// FIXME пока для кэпшена вместо виджета текст (Bug #190)
33
public
MemberObsolete
<Window>
34
{
35
MYGUI_RTTI_DERIVED
(
Window
)
36
37
public
:
39
void
setVisible(
bool
_visible)
override
;
40
42
void
setVisibleSmooth(
bool
_visible);
44
void
destroySmooth();
45
47
void
setAutoAlpha(
bool
_auto);
49
bool
getAutoAlpha()
const
;
50
52
void
setCaption(
const
UString
& _caption)
override
;
54
const
UString
& getCaption()
const override
;
55
57
TextBox
* getCaptionWidget()
const
;
58
60
void
setMinSize(
const
IntSize
& _value);
62
void
setMinSize(
int
_width,
int
_height);
64
IntSize
getMinSize()
const
;
65
67
void
setMaxSize(
const
IntSize
& _value);
69
void
setMaxSize(
int
_width,
int
_height);
71
IntSize
getMaxSize()
const
;
72
74
void
setPosition(
const
IntPoint
& _point)
override
;
76
void
setSize(
const
IntSize
& _size)
override
;
78
void
setCoord(
const
IntCoord
& _coord)
override
;
79
80
using
Widget::setPosition;
81
using
Widget::setSize;
82
using
Widget::setCoord;
83
85
void
setSnap(
bool
_value);
87
bool
getSnap()
const
;
88
90
const
IntCoord
& getActionScale()
const
;
91
93
void
setMovable(
bool
_value);
95
bool
getMovable()
const
;
96
97
/*events:*/
103
EventPair<EventHandle_WidgetString, EventHandle_WindowPtrCStringRef>
eventWindowButtonPressed
;
104
109
EventPair<EventHandle_WidgetVoid, EventHandle_WindowPtr>
eventWindowChangeCoord
;
110
111
protected
:
112
void
initialiseOverride()
override
;
113
void
shutdownOverride()
override
;
114
115
void
onMouseChangeRootFocus(
bool
_focus)
override
;
116
void
onKeyChangeRootFocus(
bool
_focus)
override
;
117
void
onMouseDrag(
int
_left,
int
_top,
MouseButton
_id)
override
;
118
void
onMouseButtonPressed(
int
_left,
int
_top,
MouseButton
_id)
override
;
119
void
onMouseButtonReleased(
int
_left,
int
_top,
MouseButton
_id)
override
;
120
121
void
notifyMousePressed(
MyGUI::Widget
* _sender,
int
_left,
int
_top,
MouseButton
_id);
122
void
notifyMouseReleased(
MyGUI::Widget
* _sender,
int
_left,
int
_top,
MouseButton
_id);
123
void
notifyPressedButtonEvent(
MyGUI::Widget
* _sender);
124
void
notifyMouseDrag(
MyGUI::Widget
* _sender,
int
_left,
int
_top,
MouseButton
_id);
125
void
notifyMouseWheel(
MyGUI::Widget
* _sender,
int
_rel);
126
127
// просто обновляет альфу взависимости от флагов
128
void
updateAlpha();
129
130
void
animateStop(
Widget
* _widget,
ControllerItem
* _controller);
131
132
void
setPropertyOverride(std::string_view _key, std::string_view _value)
override
;
133
134
private
:
135
float
getAlphaVisible()
const
;
136
enum class
Snap
137
{
138
Position,
139
Size
140
};
141
void
getSnappedCoord(
IntCoord
& _coord, Snap snapMode)
const
;
142
IntCoord
_getActionScale(
Widget
* _widget)
const
;
143
144
ControllerFadeAlpha
* createControllerFadeAlpha(
float
_alpha,
float
_coef,
bool
_enable);
145
146
private
:
147
TextBox
* mWidgetCaption{
nullptr
};
148
149
// размеры окна перед началом его изменений
150
IntCoord mPreActionCoord;
151
152
// наши главные фокусы
153
bool
mMouseRootFocus{
false
};
154
bool
mKeyRootFocus{
false
};
155
156
// автоматическое или ручное управление альфой
157
bool
mIsAutoAlpha{
false
};
158
159
// минимальные и максимальные размеры окна
160
IntRect
mMinmax;
161
162
bool
mSnap{
false
};
// прилеплять ли к краям
163
164
IntCoord
mCurrentActionScale;
165
bool
mAnimateSmooth{
false
};
166
167
bool
mMovable{
true
};
168
};
169
170
}
// namespace MyGUI
171
172
#endif
// MYGUI_WINDOW_H_
MyGUI_ControllerFadeAlpha.h
MyGUI_EventPair.h
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition
MyGUI_Platform.h:77
MyGUI_Prerequest.h
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition
MyGUI_RTTI.h:69
MyGUI_TextBox.h
MyGUI::ControllerFadeAlpha
Definition
MyGUI_ControllerFadeAlpha.h:19
MyGUI::ControllerItem
Definition
MyGUI_ControllerItem.h:26
MyGUI::EventPairConvertStringView
Definition
MyGUI_EventPair.h:213
MyGUI::EventPair
Definition
MyGUI_EventPair.h:99
MyGUI::MemberObsolete
Definition
MyGUI_DeprecatedTypes.h:14
MyGUI::TextBox
widget description should be here.
Definition
MyGUI_TextBox.h:20
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition
MyGUI_UString.h:144
MyGUI::Widget
widget description should be here.
Definition
MyGUI_Widget.h:40
MyGUI::Window
widget description should be here.
Definition
MyGUI_Window.h:34
MyGUI::Window::eventWindowChangeCoord
EventPair< EventHandle_WidgetVoid, EventHandle_WindowPtr > eventWindowChangeCoord
Definition
MyGUI_Window.h:109
MyGUI::Window::eventWindowButtonPressed
EventPair< EventHandle_WidgetString, EventHandle_WindowPtrCStringRef > eventWindowButtonPressed
Definition
MyGUI_Window.h:103
MyGUI::delegates::MultiDelegate
Definition
MyGUI_Delegate.h:190
MyGUI
Definition
MyGUI_ActionController.h:15
MyGUI::IntRect
types::TRect< int > IntRect
Definition
MyGUI_Types.h:33
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition
MyGUI_Types.h:36
MyGUI::MouseButton
Definition
MyGUI_MouseButton.h:16
MyGUI::types::TCoord< int >
MyGUI::types::TPoint< int >
MyGUI::types::TSize< int >
Generated by
1.12.0