MyGUI  3.2.2
MyGUI_ControllerRepeatClick.cpp
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 #include "MyGUI_Precompiled.h"
9 
10 namespace MyGUI
11 {
13  mInit(0.5f),
14  mStep(0.1f),
15  mTimeLeft(0)
16  {
17  }
18 
20  {
21  }
22 
23  bool ControllerRepeatClick::addTime(MyGUI::Widget* _widget, float _time)
24  {
25  if(mTimeLeft == 0)
26  mTimeLeft = mInit;
27 
28  if (mStep <= 0)
29  return true;
30 
31  mTimeLeft -= _time;
32  while (mTimeLeft <= 0)
33  {
34  mTimeLeft += mStep;
35  eventRepeatClick(_widget, this);
36  }
37  return true;
38  }
39 
40  void ControllerRepeatClick::setRepeat(float init, float step)
41  {
42  mInit = init;
43  mStep = step;
44  }
45 
46  void ControllerRepeatClick::setProperty(const std::string& _key, const std::string& _value)
47  {
48  }
49 
51  {
52  }
53 }
54 
Widget properties. Skin childs. Widget widget description should be here.
Definition: MyGUI_Widget.h:29
virtual void prepareItem(Widget *_widget)
EventHandle_RepeatClick eventRepeatClick
virtual void setProperty(const std::string &_key, const std::string &_value)
virtual bool addTime(Widget *_widget, float _time)
void setRepeat(float init, float step)