MyGUI  3.4.1
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() const override;
53 
55  TextBox* getCaptionWidget() const;
56 
58  void setMinSize(const IntSize& _value);
60  void setMinSize(int _width, int _height);
62  IntSize getMinSize() const;
63 
65  void setMaxSize(const IntSize& _value);
67  void setMaxSize(int _width, int _height);
69  IntSize getMaxSize() const;
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  enum class Snap {Position, Size};
135  void getSnappedCoord(IntCoord& _coord, Snap snapMode) const;
136  IntCoord _getActionScale(Widget* _widget) const;
137 
138  ControllerFadeAlpha* createControllerFadeAlpha(float _alpha, float _coef, bool _enable);
139 
140  private:
141  TextBox* mWidgetCaption;
142 
143  // размеры окна перед началом его изменений
144  IntCoord mPreActionCoord;
145 
146  // наши главные фокусы
147  bool mMouseRootFocus;
148  bool mKeyRootFocus;
149 
150  // автоматическое или ручное управление альфой
151  bool mIsAutoAlpha;
152 
153  // минимальные и максимальные размеры окна
154  IntRect mMinmax;
155 
156  bool mSnap; // прилеплять ли к краям
157 
158  IntCoord mCurrentActionScale;
159  bool mAnimateSmooth;
160 
161  bool mMovable;
162  };
163 
164 } // namespace MyGUI
165 
166 #endif // MYGUI_WINDOW_H_
#define MYGUI_EXPORT
#define MYGUI_RTTI_DERIVED(DerivedType)
Definition: MyGUI_RTTI.h:48
widget description should be here.
Definition: MyGUI_TextBox.h:21
A UTF-16 string with implicit conversion to/from std::string and std::wstring.
widget description should be here.
Definition: MyGUI_Widget.h:37
void setCoord(const IntCoord &_value) override
void setPosition(const IntPoint &_value) override
void setSize(const IntSize &_value) override
widget description should be here.
Definition: MyGUI_Window.h:30
EventPair< EventHandle_WidgetVoid, EventHandle_WindowPtr > eventWindowChangeCoord
Definition: MyGUI_Window.h:107
EventPair< EventHandle_WidgetString, EventHandle_WindowPtrCStringRef > eventWindowButtonPressed
Definition: MyGUI_Window.h:101
delegates::CMultiDelegate1< Window * > EventHandle_WindowPtr
Definition: MyGUI_Window.h:22
delegates::CMultiDelegate2< Widget *, const std::string & > EventHandle_WidgetString
Definition: MyGUI_Window.h:19
delegates::CMultiDelegate2< Window *, const std::string & > EventHandle_WindowPtrCStringRef
Definition: MyGUI_Window.h:21