MyGUI_ControllerRepeatClick.cpp
Go to the documentation of this file.
/*
* This source file is part of MyGUI. For the latest info, see http://mygui.info/
* Distributed under the MIT License
* (See accompanying file COPYING.MIT or copy at http://opensource.org/licenses/MIT)
*/
#include "MyGUI_Precompiled.h"
#include "MyGUI_ControllerRepeatClick.h"
namespace MyGUI
{
bool ControllerRepeatClick::addTime(MyGUI::Widget* _widget, float _time)
{
if (mTimeLeft == 0)
mTimeLeft = mInit;
if (mStep <= 0)
return true;
mTimeLeft -= _time;
while (mTimeLeft <= 0)
{
mTimeLeft += mStep;
eventRepeatClick(_widget, this);
}
return true;
}
void ControllerRepeatClick::setRepeat(float init, float step)
{
mInit = init;
mStep = step;
}
void ControllerRepeatClick::setProperty(std::string_view _key, std::string_view _value)
{
}
void ControllerRepeatClick::prepareItem(MyGUI::Widget* _widget)
{
}
}
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