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