Fix some minor bugs in widgets events

This commit is contained in:
Eduardo Bart 2013-01-31 00:21:39 -02:00
parent 17d09f41be
commit 1bf77c35c6
1 changed files with 3 additions and 14 deletions

View File

@ -1568,10 +1568,7 @@ bool UIWidget::onMousePress(const Point& mousePos, Fw::MouseButton button)
m_lastClickPosition = mousePos; m_lastClickPosition = mousePos;
} }
if(hasLuaField("onMousePress"))
return callLuaField<bool>("onMousePress", mousePos, button); return callLuaField<bool>("onMousePress", mousePos, button);
return false;
} }
bool UIWidget::onMouseRelease(const Point& mousePos, Fw::MouseButton button) bool UIWidget::onMouseRelease(const Point& mousePos, Fw::MouseButton button)
@ -1591,20 +1588,12 @@ bool UIWidget::onMouseWheel(const Point& mousePos, Fw::MouseWheelDirection direc
bool UIWidget::onClick(const Point& mousePos) bool UIWidget::onClick(const Point& mousePos)
{ {
if(hasLuaField("onClick")) { return callLuaField<bool>("onClick", mousePos);
callLuaField("onClick", mousePos);
return true;
}
return false;
} }
bool UIWidget::onDoubleClick(const Point& mousePos) bool UIWidget::onDoubleClick(const Point& mousePos)
{ {
if(hasLuaField("onDoubleClick")) { return callLuaField<bool>("onDoubleClick", mousePos);
callLuaField("onDoubleClick", mousePos);
return true;
}
return false;
} }
bool UIWidget::propagateOnKeyText(const std::string& keyText) bool UIWidget::propagateOnKeyText(const std::string& keyText)