MyGUI_WidgetInput.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_WidgetInput.h"
#include "MyGUI_Widget.h"
namespace MyGUI
{
void WidgetInput::setMaskPick(const std::string& _filename)
{
if (_filename.empty())
mOwnMaskPickInfo = MaskPickInfo();
else if (!mOwnMaskPickInfo.load(_filename))
MYGUI_LOG(Error, "mask not load '" << _filename << "'");
}
void WidgetInput::setMaskPick(const MaskPickInfo& _info)
{
mOwnMaskPickInfo = _info;
}
bool WidgetInput::isMaskPickInside(const IntPoint& _point, const IntCoord& _coord) const
{
return mOwnMaskPickInfo.empty() || mOwnMaskPickInfo.pick(_point, _coord);
}
void WidgetInput::_riseMouseLostFocus(Widget* _new)
{
onMouseLostFocus(_new);
eventMouseLostFocus(static_cast<Widget*>(this), _new);
}
void WidgetInput::_riseMouseSetFocus(Widget* _old)
{
onMouseSetFocus(_old);
eventMouseSetFocus(static_cast<Widget*>(this), _old);
}
void WidgetInput::_riseMouseDrag(int _left, int _top, MouseButton _id)
{
onMouseDrag(_left, _top, _id);
eventMouseDrag(static_cast<Widget*>(this), _left, _top, _id);
}
void WidgetInput::_riseMouseMove(int _left, int _top)
{
onMouseMove(_left, _top);
eventMouseMove(static_cast<Widget*>(this), _left, _top);
}
void WidgetInput::_riseMouseWheel(int _rel)
{
onMouseWheel(_rel);
eventMouseWheel(static_cast<Widget*>(this), _rel);
}
void WidgetInput::_riseMouseButtonPressed(int _left, int _top, MouseButton _id)
{
onMouseButtonPressed(_left, _top, _id);
eventMouseButtonPressed(static_cast<Widget*>(this), _left, _top, _id);
}
void WidgetInput::_riseMouseButtonReleased(int _left, int _top, MouseButton _id)
{
onMouseButtonReleased(_left, _top, _id);
eventMouseButtonReleased(static_cast<Widget*>(this), _left, _top, _id);
}
void WidgetInput::_riseMouseButtonClick()
{
onMouseButtonClick();
eventMouseButtonClick(static_cast<Widget*>(this));
}
void WidgetInput::_riseMouseButtonDoubleClick()
{
onMouseButtonDoubleClick();
eventMouseButtonDoubleClick(static_cast<Widget*>(this));
}
void WidgetInput::_riseKeyLostFocus(Widget* _new)
{
onKeyLostFocus(_new);
eventKeyLostFocus(static_cast<Widget*>(this), _new);
}
void WidgetInput::_riseKeySetFocus(Widget* _old)
{
onKeySetFocus(_old);
eventKeySetFocus(static_cast<Widget*>(this), _old);
}
void WidgetInput::_riseKeyButtonPressed(KeyCode _key, Char _char)
{
onKeyButtonPressed(_key, _char);
eventKeyButtonPressed(static_cast<Widget*>(this), _key, _char);
}
void WidgetInput::_riseKeyButtonReleased(KeyCode _key)
{
onKeyButtonReleased(_key);
eventKeyButtonReleased(static_cast<Widget*>(this), _key);
}
void WidgetInput::_riseMouseChangeRootFocus(bool _focus)
{
onMouseChangeRootFocus(_focus);
eventRootMouseChangeFocus(static_cast<Widget*>(this), _focus);
}
void WidgetInput::_riseKeyChangeRootFocus(bool _focus)
{
onKeyChangeRootFocus(_focus);
eventRootKeyChangeFocus(static_cast<Widget*>(this), _focus);
}
void WidgetInput::setNeedToolTip(bool _value)
{
mNeedToolTip = _value;
}
bool WidgetInput::getNeedToolTip() const
{
return mNeedToolTip;
}
void WidgetInput::setPointer(std::string_view _value)
{
mPointer = _value;
}
const std::string& WidgetInput::getPointer() const
{
return mPointer;
}
void WidgetInput::setNeedKeyFocus(bool _value)
{
mNeedKeyFocus = _value;
}
bool WidgetInput::getNeedKeyFocus() const
{
return mNeedKeyFocus;
}
void WidgetInput::setNeedMouseFocus(bool _value)
{
mNeedMouseFocus = _value;
}
bool WidgetInput::getNeedMouseFocus() const
{
return mNeedMouseFocus;
}
void WidgetInput::setInheritsPick(bool _value)
{
mInheritsPick = _value;
}
bool WidgetInput::getInheritsPick() const
{
return mInheritsPick;
}
bool WidgetInput::getRootMouseFocus() const
{
return mRootMouseFocus;
}
bool WidgetInput::getRootKeyFocus() const
{
return mRootKeyFocus;
}
void WidgetInput::_setRootMouseFocus(bool _value)
{
mRootMouseFocus = _value;
}
void WidgetInput::_setRootKeyFocus(bool _value)
{
mRootKeyFocus = _value;
}
void WidgetInput::onMouseLostFocus(Widget* _new)
{
}
void WidgetInput::onMouseSetFocus(Widget* _old)
{
}
void WidgetInput::onMouseDrag(int _left, int _top, MouseButton _id)
{
}
void WidgetInput::onMouseMove(int _left, int _top)
{
}
void WidgetInput::onMouseWheel(int _rel)
{
}
void WidgetInput::onMouseButtonPressed(int _left, int _top, MouseButton _id)
{
}
void WidgetInput::onMouseButtonReleased(int _left, int _top, MouseButton _id)
{
}
void WidgetInput::onMouseButtonClick()
{
}
void WidgetInput::onMouseButtonDoubleClick()
{
}
void WidgetInput::onKeyLostFocus(Widget* _new)
{
}
void WidgetInput::onKeySetFocus(Widget* _old)
{
}
void WidgetInput::onKeyButtonPressed(KeyCode _key, Char _char)
{
}
void WidgetInput::onKeyButtonReleased(KeyCode _key)
{
}
void WidgetInput::onMouseChangeRootFocus(bool _focus)
{
}
void WidgetInput::onKeyChangeRootFocus(bool _focus)
{
}
} // namespace MyGUI
MYGUI_LOG
#define MYGUI_LOG(level, text)
Definition MyGUI_Diagnostic.h:17
MyGUI_Precompiled.h
MyGUI_Widget.h
MyGUI_WidgetInput.h
MyGUI::MaskPickInfo
Definition MyGUI_MaskPickInfo.h:17
MyGUI::MaskPickInfo::empty
bool empty() const
Definition MyGUI_MaskPickInfo.cpp:72
MyGUI::Widget
widget description should be here.
Definition MyGUI_Widget.h:40
MyGUI::WidgetInput::_riseMouseMove
void _riseMouseMove(int _left, int _top)
Definition MyGUI_WidgetInput.cpp:50
MyGUI::WidgetInput::eventMouseButtonDoubleClick
EventHandle_WidgetVoid eventMouseButtonDoubleClick
Definition MyGUI_WidgetInput.h:174
MyGUI::WidgetInput::eventMouseButtonClick
EventHandle_WidgetVoid eventMouseButtonClick
Definition MyGUI_WidgetInput.h:168
MyGUI::WidgetInput::getRootKeyFocus
bool getRootKeyFocus() const
Definition MyGUI_WidgetInput.cpp:177
MyGUI::WidgetInput::_riseMouseButtonDoubleClick
void _riseMouseButtonDoubleClick()
Definition MyGUI_WidgetInput.cpp:80
MyGUI::WidgetInput::onMouseButtonDoubleClick
virtual void onMouseButtonDoubleClick()
Definition MyGUI_WidgetInput.cpp:224
MyGUI::WidgetInput::onKeyLostFocus
virtual void onKeyLostFocus(Widget *_new)
Definition MyGUI_WidgetInput.cpp:228
MyGUI::WidgetInput::eventKeyLostFocus
EventHandle_WidgetWidget eventKeyLostFocus
Definition MyGUI_WidgetInput.h:181
MyGUI::WidgetInput::onMouseMove
virtual void onMouseMove(int _left, int _top)
Definition MyGUI_WidgetInput.cpp:204
MyGUI::WidgetInput::getInheritsPick
bool getInheritsPick() const
Definition MyGUI_WidgetInput.cpp:167
MyGUI::WidgetInput::eventMouseMove
EventHandle_WidgetIntInt eventMouseMove
Definition MyGUI_WidgetInput.h:137
MyGUI::WidgetInput::setNeedMouseFocus
void setNeedMouseFocus(bool _value)
Definition MyGUI_WidgetInput.cpp:152
MyGUI::WidgetInput::onMouseDrag
virtual void onMouseDrag(int _left, int _top, MouseButton _id)
Definition MyGUI_WidgetInput.cpp:200
MyGUI::WidgetInput::onMouseSetFocus
virtual void onMouseSetFocus(Widget *_old)
Definition MyGUI_WidgetInput.cpp:196
MyGUI::WidgetInput::setMaskPick
void setMaskPick(const std::string &_filename)
Definition MyGUI_WidgetInput.cpp:14
MyGUI::WidgetInput::eventMouseButtonReleased
EventHandle_WidgetIntIntButton eventMouseButtonReleased
Definition MyGUI_WidgetInput.h:162
MyGUI::WidgetInput::getPointer
const std::string & getPointer() const
Definition MyGUI_WidgetInput.cpp:137
MyGUI::WidgetInput::setNeedKeyFocus
void setNeedKeyFocus(bool _value)
Definition MyGUI_WidgetInput.cpp:142
MyGUI::WidgetInput::_riseKeyButtonReleased
void _riseKeyButtonReleased(KeyCode _key)
Definition MyGUI_WidgetInput.cpp:104
MyGUI::WidgetInput::_riseKeySetFocus
void _riseKeySetFocus(Widget *_old)
Definition MyGUI_WidgetInput.cpp:92
MyGUI::WidgetInput::getNeedToolTip
bool getNeedToolTip() const
Definition MyGUI_WidgetInput.cpp:127
MyGUI::WidgetInput::_riseKeyButtonPressed
void _riseKeyButtonPressed(KeyCode _key, Char _char)
Definition MyGUI_WidgetInput.cpp:98
MyGUI::WidgetInput::onMouseWheel
virtual void onMouseWheel(int _rel)
Definition MyGUI_WidgetInput.cpp:208
MyGUI::WidgetInput::getNeedMouseFocus
bool getNeedMouseFocus() const
Definition MyGUI_WidgetInput.cpp:157
MyGUI::WidgetInput::_riseMouseWheel
void _riseMouseWheel(int _rel)
Definition MyGUI_WidgetInput.cpp:56
MyGUI::WidgetInput::_riseMouseDrag
void _riseMouseDrag(int _left, int _top, MouseButton _id)
Definition MyGUI_WidgetInput.cpp:44
MyGUI::WidgetInput::eventMouseButtonPressed
EventHandle_WidgetIntIntButton eventMouseButtonPressed
Definition MyGUI_WidgetInput.h:153
MyGUI::WidgetInput::eventMouseSetFocus
EventHandle_WidgetWidget eventMouseSetFocus
Definition MyGUI_WidgetInput.h:121
MyGUI::WidgetInput::_riseMouseButtonReleased
void _riseMouseButtonReleased(int _left, int _top, MouseButton _id)
Definition MyGUI_WidgetInput.cpp:68
MyGUI::WidgetInput::isMaskPickInside
bool isMaskPickInside(const IntPoint &_point, const IntCoord &_coord) const
Definition MyGUI_WidgetInput.cpp:27
MyGUI::WidgetInput::eventKeyButtonPressed
EventHandle_WidgetKeyCodeChar eventKeyButtonPressed
Definition MyGUI_WidgetInput.h:196
MyGUI::WidgetInput::onMouseButtonPressed
virtual void onMouseButtonPressed(int _left, int _top, MouseButton _id)
Definition MyGUI_WidgetInput.cpp:212
MyGUI::WidgetInput::setInheritsPick
void setInheritsPick(bool _value)
Definition MyGUI_WidgetInput.cpp:162
MyGUI::WidgetInput::_riseMouseSetFocus
void _riseMouseSetFocus(Widget *_old)
Definition MyGUI_WidgetInput.cpp:38
MyGUI::WidgetInput::onMouseLostFocus
virtual void onMouseLostFocus(Widget *_new)
Definition MyGUI_WidgetInput.cpp:192
MyGUI::WidgetInput::_riseMouseButtonPressed
void _riseMouseButtonPressed(int _left, int _top, MouseButton _id)
Definition MyGUI_WidgetInput.cpp:62
MyGUI::WidgetInput::setPointer
void setPointer(std::string_view _value)
Definition MyGUI_WidgetInput.cpp:132
MyGUI::WidgetInput::_riseMouseLostFocus
void _riseMouseLostFocus(Widget *_new)
Definition MyGUI_WidgetInput.cpp:32
MyGUI::WidgetInput::setNeedToolTip
void setNeedToolTip(bool _value)
Definition MyGUI_WidgetInput.cpp:122
MyGUI::WidgetInput::eventMouseLostFocus
EventHandle_WidgetWidget eventMouseLostFocus
Definition MyGUI_WidgetInput.h:114
MyGUI::WidgetInput::onMouseButtonReleased
virtual void onMouseButtonReleased(int _left, int _top, MouseButton _id)
Definition MyGUI_WidgetInput.cpp:216
MyGUI::WidgetInput::eventKeySetFocus
EventHandle_WidgetWidget eventKeySetFocus
Definition MyGUI_WidgetInput.h:188
MyGUI::WidgetInput::_riseKeyChangeRootFocus
void _riseKeyChangeRootFocus(bool _focus)
Definition MyGUI_WidgetInput.cpp:116
MyGUI::WidgetInput::onKeySetFocus
virtual void onKeySetFocus(Widget *_old)
Definition MyGUI_WidgetInput.cpp:232
MyGUI::WidgetInput::onMouseChangeRootFocus
virtual void onMouseChangeRootFocus(bool _focus)
Definition MyGUI_WidgetInput.cpp:244
MyGUI::WidgetInput::eventRootKeyChangeFocus
EventHandle_WidgetBool eventRootKeyChangeFocus
Definition MyGUI_WidgetInput.h:219
MyGUI::WidgetInput::getNeedKeyFocus
bool getNeedKeyFocus() const
Definition MyGUI_WidgetInput.cpp:147
MyGUI::WidgetInput::_riseKeyLostFocus
void _riseKeyLostFocus(Widget *_new)
Definition MyGUI_WidgetInput.cpp:86
MyGUI::WidgetInput::_setRootKeyFocus
void _setRootKeyFocus(bool _value)
Definition MyGUI_WidgetInput.cpp:187
MyGUI::WidgetInput::eventRootMouseChangeFocus
EventHandle_WidgetBool eventRootMouseChangeFocus
Definition MyGUI_WidgetInput.h:211
MyGUI::WidgetInput::onKeyButtonPressed
virtual void onKeyButtonPressed(KeyCode _key, Char _char)
Definition MyGUI_WidgetInput.cpp:236
MyGUI::WidgetInput::onMouseButtonClick
virtual void onMouseButtonClick()
Definition MyGUI_WidgetInput.cpp:220
MyGUI::WidgetInput::onKeyChangeRootFocus
virtual void onKeyChangeRootFocus(bool _focus)
Definition MyGUI_WidgetInput.cpp:248
MyGUI::WidgetInput::eventMouseDrag
EventPairAddParameter< EventHandle_WidgetIntInt, EventHandle_WidgetIntIntButton > eventMouseDrag
Definition MyGUI_WidgetInput.h:129
MyGUI::WidgetInput::_setRootMouseFocus
void _setRootMouseFocus(bool _value)
Definition MyGUI_WidgetInput.cpp:182
MyGUI::WidgetInput::onKeyButtonReleased
virtual void onKeyButtonReleased(KeyCode _key)
Definition MyGUI_WidgetInput.cpp:240
MyGUI::WidgetInput::_riseMouseButtonClick
void _riseMouseButtonClick()
Definition MyGUI_WidgetInput.cpp:74
MyGUI::WidgetInput::_riseMouseChangeRootFocus
void _riseMouseChangeRootFocus(bool _focus)
Definition MyGUI_WidgetInput.cpp:110
MyGUI::WidgetInput::eventMouseWheel
EventHandle_WidgetInt eventMouseWheel
Definition MyGUI_WidgetInput.h:144
MyGUI::WidgetInput::getRootMouseFocus
bool getRootMouseFocus() const
Definition MyGUI_WidgetInput.cpp:172
MyGUI::WidgetInput::eventKeyButtonReleased
EventHandle_WidgetKeyCode eventKeyButtonReleased
Definition MyGUI_WidgetInput.h:203
MyGUI
Definition MyGUI_ActionController.h:15
MyGUI::IntPoint
types::TPoint< int > IntPoint
Definition MyGUI_Types.h:27
MyGUI::Char
unsigned int Char
Definition MyGUI_Types.h:50
MyGUI::IntCoord
types::TCoord< int > IntCoord
Definition MyGUI_Types.h:36
MyGUI::KeyCode
Definition MyGUI_KeyCode.h:16
MyGUI::MouseButton
Definition MyGUI_MouseButton.h:16