MyGUI_ControllerPosition.h
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#ifndef MYGUI_CONTROLLER_POSITION_H_
#define MYGUI_CONTROLLER_POSITION_H_
#include "MyGUI_Prerequest.h"
#include "MyGUI_Delegate.h"
#include "MyGUI_Types.h"
#include "MyGUI_WidgetDefines.h"
#include "MyGUI_ControllerItem.h"
namespace MyGUI
{
class MYGUI_EXPORT ControllerPosition : public ControllerItem
{
MYGUI_RTTI_DERIVED(ControllerPosition)
public:
using FrameAction = delegates::Delegate<const IntCoord&, const IntCoord&, IntCoord&, float>;
ControllerPosition();
void setCoord(const IntCoord& _destCoord);
void setSize(const IntSize& _destSize);
void setPosition(const IntPoint& _destPoint);
void setFunction(std::string_view _value);
void setTime(float _value);
void setAction(FrameAction::IDelegate* _value);
bool addTime(Widget* _widget, float _time) override;
void prepareItem(Widget* _widget) override;
void setProperty(std::string_view _key, std::string_view _value) override;
private:
IntCoord mStartCoord;
IntCoord mDestCoord;
float mTime{1};
float mElapsedTime{0};
// controller changing position
bool mCalcPosition{false};
// controller changing size
bool mCalcSize{false};
FrameAction eventFrameAction;
};
} // namespace MyGUI
#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