MyGUI: MyGUI_ControllerPosition.h Source File

MyGUI 3.4.3

MyGUI_ControllerPosition.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_CONTROLLER_POSITION_H_
8#define MYGUI_CONTROLLER_POSITION_H_
9
10#include "MyGUI_Prerequest.h"
11#include "MyGUI_Delegate.h"
12#include "MyGUI_Types.h"
13#include "MyGUI_WidgetDefines.h"
14#include "MyGUI_ControllerItem.h"
15
16namespace MyGUI
17{
18
20 class MYGUI_EXPORT ControllerPosition : public ControllerItem
21 {
22 MYGUI_RTTI_DERIVED(ControllerPosition)
23
24 public:
25 using FrameAction = delegates::Delegate<const IntCoord&, const IntCoord&, IntCoord&, float>;
26
27 ControllerPosition();
28
29 void setCoord(const IntCoord& _destCoord);
30
31 void setSize(const IntSize& _destSize);
32
33 void setPosition(const IntPoint& _destPoint);
34
44 void setFunction(std::string_view _value);
45
49 void setTime(float _value);
50
54 void setAction(FrameAction::IDelegate* _value);
55
56 bool addTime(Widget* _widget, float _time) override;
57 void prepareItem(Widget* _widget) override;
58 void setProperty(std::string_view _key, std::string_view _value) override;
59
60 private:
61 IntCoord mStartCoord;
62 IntCoord mDestCoord;
63 float mTime{1};
64 float mElapsedTime{0};
65
66 // controller changing position
67 bool mCalcPosition{false};
68 // controller changing size
69 bool mCalcSize{false};
70
78 FrameAction eventFrameAction;
79 };
80
81} // namespace MyGUI
82
83#endif // MYGUI_CONTROLLER_POSITION_H_
MyGUI_ControllerItem.h
MyGUI_Delegate.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_Types.h
MyGUI_WidgetDefines.h
MyGUI::ControllerItem
Definition MyGUI_ControllerItem.h:26
MyGUI::ControllerPosition::ControllerPosition
ControllerPosition()
Definition MyGUI_ControllerPosition.cpp:18
MyGUI::ControllerPosition::setAction
void setAction(FrameAction::IDelegate *_value)
Definition MyGUI_ControllerPosition.cpp:135
MyGUI::ControllerPosition::setTime
void setTime(float _value)
Definition MyGUI_ControllerPosition.cpp:130
MyGUI::ControllerPosition::setFunction
void setFunction(std::string_view _value)
Definition MyGUI_ControllerPosition.cpp:116
MyGUI::ControllerPosition::addTime
bool addTime(Widget *_widget, float _time) override
Definition MyGUI_ControllerPosition.cpp:56
MyGUI::ControllerPosition::FrameAction
delegates::Delegate< const IntCoord &, const IntCoord &, IntCoord &, float > FrameAction
Definition MyGUI_ControllerPosition.h:25
MyGUI::ControllerPosition::setProperty
void setProperty(std::string_view _key, std::string_view _value) override
Definition MyGUI_ControllerPosition.cpp:102
MyGUI::ControllerPosition::setPosition
void setPosition(const IntPoint &_destPoint)
Definition MyGUI_ControllerPosition.cpp:38
MyGUI::ControllerPosition::prepareItem
void prepareItem(Widget *_widget) override
Definition MyGUI_ControllerPosition.cpp:46
MyGUI::ControllerPosition::setCoord
void setCoord(const IntCoord &_destCoord)
Definition MyGUI_ControllerPosition.cpp:23
MyGUI::ControllerPosition::setSize
void setSize(const IntSize &_destSize)
Definition MyGUI_ControllerPosition.cpp:30
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:40
MyGUI::delegates::Delegate
Definition MyGUI_Delegate.h:158
MyGUI::delegates::Delegate< const IntCoord &, const IntCoord &, IntCoord &, float >::IDelegate
DelegateFunction< Args... > IDelegate
Definition MyGUI_Delegate.h:160
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::IntPoint
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:27
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36
MyGUI::IntSize
types::TSize< int > IntSize
Definition MyGUI_Types.h:30