MyGUI  3.4.0
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"
14 
15 namespace MyGUI
16 {
17 
18  // OBSOLETE
20 
23 
28  public TextBox, // FIXME пока для кэпшена вместо виджета текст (Bug #190)
29  public MemberObsolete<Window>
30  {
32 
33  public:
34  Window();
35 
37  void setVisible(bool _value) override;
38 
40  void setVisibleSmooth(bool _value);
42  void destroySmooth();
43 
45  void setAutoAlpha(bool _value);
47  bool getAutoAlpha() const;
48 
50  void setCaption(const UString& _value) override;
52  const UString& getCaption() override;
53 
55  TextBox* getCaptionWidget();
56 
58  void setMinSize(const IntSize& _value);
60  void setMinSize(int _width, int _height);
62  IntSize getMinSize();
63 
65  void setMaxSize(const IntSize& _value);
67  void setMaxSize(int _width, int _height);
69  IntSize getMaxSize();
70 
72  void setPosition(const IntPoint& _value) override;
74  void setSize(const IntSize& _value) override;
76  void setCoord(const IntCoord& _value) override;
77 
78  using Widget::setPosition;
79  using Widget::setSize;
80  using Widget::setCoord;
81 
83  void setSnap(bool _value);
85  bool getSnap() const;
86 
88  const IntCoord& getActionScale() const;
89 
91  void setMovable(bool _value);
93  bool getMovable() const;
94 
95  /*events:*/
102 
108 
109  protected:
110  void initialiseOverride() override;
111  void shutdownOverride() override;
112 
113  void onMouseChangeRootFocus(bool _focus) override;
114  void onKeyChangeRootFocus(bool _focus) override;
115  void onMouseDrag(int _left, int _top, MouseButton _id) override;
116  void onMouseButtonPressed(int _left, int _top, MouseButton _id) override;
117  void onMouseButtonReleased(int _left, int _top, MouseButton _id) override;
118 
119  void notifyMousePressed(MyGUI::Widget* _sender, int _left, int _top, MouseButton _id);
120  void notifyMouseReleased(MyGUI::Widget* _sender, int _left, int _top, MouseButton _id);
121  void notifyPressedButtonEvent(MyGUI::Widget* _sender);
122  void notifyMouseDrag(MyGUI::Widget* _sender, int _left, int _top, MouseButton _id);
123  void notifyMouseWheel(MyGUI::Widget* _sender, int _rel);
124 
125  // просто обновляет альфу взависимости от флагов
126  void updateAlpha();
127 
128  void animateStop(Widget* _widget, ControllerItem* _controller);
129 
130  void setPropertyOverride(const std::string& _key, const std::string& _value) override;
131 
132  private:
133  float getAlphaVisible() const;
134  void getSnappedCoord(IntCoord& _coord);
135  IntCoord _getActionScale(Widget* _widget);
136 
137  ControllerFadeAlpha* createControllerFadeAlpha(float _alpha, float _coef, bool _enable);
138 
139  private:
140  TextBox* mWidgetCaption;
141 
142  // размеры окна перед началом его изменений
143  IntCoord mPreActionCoord;
144 
145  // наши главные фокусы
146  bool mMouseRootFocus;
147  bool mKeyRootFocus;
148 
149  // автоматическое или ручное управление альфой
150  bool mIsAutoAlpha;
151 
152  // минимальные и максимальные размеры окна
153  IntRect mMinmax;
154 
155  bool mSnap; // прилеплять ли к краям
156 
157  IntCoord mCurrentActionScale;
158  bool mAnimateSmooth;
159 
160  bool mMovable;
161  };
162 
163 } // namespace MyGUI
164 
165 #endif // MYGUI_WINDOW_H_
MyGUI::Widget::setPosition
void setPosition(const IntPoint &_value) override
Definition: MyGUI_Widget.cpp:630
MyGUI::EventHandle_WindowPtrCStringRef
delegates::CMultiDelegate2< Window *, const std::string & > EventHandle_WindowPtrCStringRef
Definition: MyGUI_Window.h:21
MyGUI_EventPair.h
MyGUI::types::TRect< int >
MyGUI::Window
Window properties. Skin childs. Window widget description should be here.
Definition: MyGUI_Window.h:30
MyGUI::delegates::MultiDelegate
Definition: MyGUI_Delegate.h:183
MyGUI::Widget
Widget properties. Skin childs. Widget widget description should be here.
Definition: MyGUI_Widget.h:37
MyGUI::types::TPoint< int >
MyGUI::ControllerItem
Definition: MyGUI_ControllerItem.h:27
MyGUI::EventPair
Definition: MyGUI_EventPair.h:17
MyGUI::UString
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
Definition: MyGUI_UString.h:168
MyGUI::MouseButton
Definition: MyGUI_MouseButton.h:16
MyGUI::EventHandle_WidgetString
delegates::CMultiDelegate2< Widget *, const std::string & > EventHandle_WidgetString
Definition: MyGUI_Window.h:19
MyGUI_Prerequest.h
MyGUI::TextBox
TextBox properties. Skin childs. TextBox widget description should be here.
Definition: MyGUI_TextBox.h:21
MyGUI::Widget::setSize
void setSize(const IntSize &_value) override
Definition: MyGUI_Widget.cpp:647
MyGUI_ControllerFadeAlpha.h
MyGUI::Window::eventWindowButtonPressed
EventPair< EventHandle_WidgetString, EventHandle_WindowPtrCStringRef > eventWindowButtonPressed
Definition: MyGUI_Window.h:101
MYGUI_RTTI_DERIVED
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:48
MyGUI::MemberObsolete
Definition: MyGUI_DeprecatedTypes.h:14
MyGUI::types::TSize< int >
MyGUI::Widget::setCoord
void setCoord(const IntCoord &_value) override
Definition: MyGUI_Widget.cpp:684
MYGUI_EXPORT
#define MYGUI_EXPORT
Definition: MyGUI_Platform.h:89
MyGUI::Window::eventWindowChangeCoord
EventPair< EventHandle_WidgetVoid, EventHandle_WindowPtr > eventWindowChangeCoord
Definition: MyGUI_Window.h:107
MyGUI::EventHandle_WindowPtr
delegates::CMultiDelegate1< Window * > EventHandle_WindowPtr
Definition: MyGUI_Window.h:22
MyGUI::ControllerFadeAlpha
Definition: MyGUI_ControllerFadeAlpha.h:20
MyGUI::types::TCoord< int >
MyGUI
Definition: MyGUI_ActionController.h:15
MyGUI_TextBox.h