MyGUI
3.2.1
|
00001 /* 00002 * This source file is part of MyGUI. For the latest info, see http://mygui.info/ 00003 * Distributed under the MIT License 00004 * (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT) 00005 */ 00006 00007 #ifndef __MYGUI_CONTROLLER_POSITION_H__ 00008 #define __MYGUI_CONTROLLER_POSITION_H__ 00009 00010 #include "MyGUI_Prerequest.h" 00011 #include "MyGUI_Delegate.h" 00012 #include "MyGUI_Types.h" 00013 #include "MyGUI_WidgetDefines.h" 00014 #include "MyGUI_ControllerItem.h" 00015 00016 namespace MyGUI 00017 { 00018 00020 class MYGUI_EXPORT ControllerPosition : 00021 public ControllerItem 00022 { 00023 MYGUI_RTTI_DERIVED( ControllerPosition ) 00024 00025 public: 00026 typedef delegates::CDelegate4<const IntCoord&, const IntCoord&, IntCoord&, float> FrameAction; 00027 00028 ControllerPosition(); 00029 virtual ~ControllerPosition(); 00030 00031 void setCoord(const IntCoord& _value); 00032 00033 void setSize(const IntSize& _value); 00034 00035 void setPosition(const IntPoint& _value); 00036 00037 void setFunction(const std::string& _value); 00038 00042 void setTime(float _value); 00043 00047 void setAction(FrameAction::IDelegate* _value); 00048 00049 virtual void setProperty(const std::string& _key, const std::string& _value); 00050 00051 private: 00052 bool addTime(Widget* _widget, float _time); 00053 void prepareItem(Widget* _widget); 00054 00055 IntCoord mStartCoord; 00056 IntCoord mDestCoord; 00057 float mTime; 00058 float mElapsedTime; 00059 00060 // controller changing position 00061 bool mCalcPosition; 00062 // controller changing size 00063 bool mCalcSize; 00064 00072 FrameAction eventFrameAction; 00073 }; 00074 00075 } // namespace MyGUI 00076 00077 #endif // __MYGUI_CONTROLLER_POSITION_H__