OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
controllers.hpp
Go to the documentation of this file.
1 #ifndef MWGUI_CONTROLLERS_H
2 #define MWGUI_CONTROLLERS_H
3 
4 #include <string>
5 #include <MyGUI_ControllerItem.h>
6 
7 namespace MyGUI
8 {
9  class Widget;
10 }
11 
12 namespace MWGui
13 {
14  namespace Controllers
15  {
16  // Should be removed when upgrading to MyGUI 3.2.2 (current git), it has ControllerRepeatClick
18  public MyGUI::ControllerItem
19  {
20  MYGUI_RTTI_DERIVED( ControllerRepeatEvent )
21 
22  public:
24  virtual ~ControllerRepeatEvent();
25 
26  void setRepeat(float init, float step);
27  void setEnabled(bool enable);
28  virtual void setProperty(const std::string& _key, const std::string& _value);
29 
30  // Events
31  typedef MyGUI::delegates::CMultiDelegate2<MyGUI::Widget*, MyGUI::ControllerItem*> EventHandle_RepeatClickVoid;
32 
37 
38  private:
39  bool addTime(MyGUI::Widget* _widget, float _time);
40  void prepareItem(MyGUI::Widget* _widget);
41 
42  private:
43  float mInit;
44  float mStep;
45  bool mEnabled;
46  float mTimeLeft;
47  };
48 
51  public MyGUI::ControllerItem
52  {
53  MYGUI_RTTI_DERIVED( ControllerFollowMouse )
54 
55  private:
56  bool addTime(MyGUI::Widget* _widget, float _time);
57  void prepareItem(MyGUI::Widget* _widget);
58  };
59  }
60 }
61 
62 #endif
float mTimeLeft
Definition: controllers.hpp:46
void setEnabled(bool enable)
Definition: controllers.cpp:43
Automatically positions a widget below the mouse cursor.
Definition: controllers.hpp:50
virtual ~ControllerRepeatEvent()
Definition: controllers.cpp:19
EventHandle_RepeatClickVoid eventRepeatClick
Definition: controllers.hpp:36
void init(ESM::ENAMstruct &effect)
Definition: spellcreationdialog.cpp:40
bool addTime(MyGUI::Widget *_widget, float _time)
Definition: controllers.cpp:23
virtual void setProperty(const std::string &_key, const std::string &_value)
Definition: controllers.cpp:48
ControllerRepeatEvent()
Definition: controllers.cpp:11
void prepareItem(MyGUI::Widget *_widget)
Definition: controllers.cpp:52
void setRepeat(float init, float step)
Definition: controllers.cpp:37
bool addTime(MyGUI::Widget *_widget, float _time)
Definition: controllers.cpp:62
MyGUI::delegates::CMultiDelegate2< MyGUI::Widget *, MyGUI::ControllerItem * > EventHandle_RepeatClickVoid
Definition: controllers.hpp:31
float mStep
Definition: controllers.hpp:44
bool mEnabled
Definition: controllers.hpp:45
float mInit
Definition: controllers.hpp:43
Definition: controllers.hpp:17
void prepareItem(MyGUI::Widget *_widget)
Definition: controllers.cpp:58
void enable(CodeContainer &code, Literals &literals, const std::string &id)
Definition: generator.cpp:870