OpenMW
apps/openmw/mwgui/controllers.hpp
Go to the documentation of this file.
00001 #ifndef MWGUI_CONTROLLERS_H
00002 #define MWGUI_CONTROLLERS_H
00003 
00004 #include <MyGUI_Widget.h>
00005 #include <MyGUI_ControllerItem.h>
00006 
00007 
00008 namespace MWGui
00009 {
00010     namespace Controllers
00011     {
00012         class ControllerRepeatClick :
00013             public MyGUI::ControllerItem
00014         {
00015             MYGUI_RTTI_DERIVED( ControllerRepeatClick )
00016 
00017         public:
00018             ControllerRepeatClick();
00019             virtual ~ControllerRepeatClick();
00020 
00021             void setRepeat(float init, float step);
00022             void setEnabled(bool enable);
00023             virtual void setProperty(const std::string& _key, const std::string& _value);
00024 
00025             // Events
00026             typedef MyGUI::delegates::CMultiDelegate2<MyGUI::Widget*, MyGUI::ControllerItem*> EventHandle_RepeatClickVoid;
00027 
00031             EventHandle_RepeatClickVoid eventRepeatClick;
00032 
00033         private:
00034             bool addTime(MyGUI::Widget* _widget, float _time);
00035             void prepareItem(MyGUI::Widget* _widget);
00036 
00037         private:
00038             float mInit;
00039             float mStep;
00040             bool mEnabled;
00041             float mTimeLeft;
00042         };
00043     }
00044 }
00045 
00046 #endif