MyGUI: MyGUI_ControllerRepeatClick.cpp Source File

MyGUI 3.4.3

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"
8#include "MyGUI_ControllerRepeatClick.h"
9
10namespace MyGUI
11{
12
13 bool ControllerRepeatClick::addTime(MyGUI::Widget* _widget, float _time)
14 {
15 if (mTimeLeft == 0)
16 mTimeLeft = mInit;
17
18 if (mStep <= 0)
19 return true;
20
21 mTimeLeft -= _time;
22 while (mTimeLeft <= 0)
23 {
24 mTimeLeft += mStep;
25 eventRepeatClick(_widget, this);
26 }
27 return true;
28 }
29
30 void ControllerRepeatClick::setRepeat(float init, float step)
31 {
32 mInit = init;
33 mStep = step;
34 }
35
36 void ControllerRepeatClick::setProperty(std::string_view _key, std::string_view _value)
37 {
38 }
39
40 void ControllerRepeatClick::prepareItem(MyGUI::Widget* _widget)
41 {
42 }
43}
MyGUI_ControllerRepeatClick.h
MyGUI_Precompiled.h
MyGUI::ControllerRepeatClick::prepareItem
void prepareItem(Widget *_widget) override
Definition MyGUI_ControllerRepeatClick.cpp:40
MyGUI::ControllerRepeatClick::eventRepeatClick
EventHandle_RepeatClick eventRepeatClick
Definition MyGUI_ControllerRepeatClick.h:41
MyGUI::ControllerRepeatClick::setProperty
void setProperty(std::string_view _key, std::string_view _value) override
Definition MyGUI_ControllerRepeatClick.cpp:36
MyGUI::ControllerRepeatClick::addTime
bool addTime(Widget *_widget, float _time) override
Definition MyGUI_ControllerRepeatClick.cpp:13
MyGUI::ControllerRepeatClick::setRepeat
void setRepeat(float init, float step)
Definition MyGUI_ControllerRepeatClick.cpp:30
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:40
MyGUI
Definition MyGUI_ActionController.h:15