restore clearText binding, don't display menu if its empty
This commit is contained in:
parent
1c4bbfb7f3
commit
215d426b42
|
@ -9,6 +9,12 @@ function UIPopupMenu.create()
|
|||
end
|
||||
|
||||
function UIPopupMenu:display(pos)
|
||||
-- don't display if not options was added
|
||||
if self:getChildCount() == 0 then
|
||||
self:destroy()
|
||||
return
|
||||
end
|
||||
|
||||
displayUI(self, {x = pos.x, y = pos.y})
|
||||
self:bindRectToParent()
|
||||
self:grabMouse()
|
||||
|
|
|
@ -85,6 +85,7 @@ void Application::registerLuaFunctions()
|
|||
g_lua.bindClassMemberFunction<UIWidget>("ungrabMouse", &UIWidget::ungrabMouse);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("grabKeyboard", &UIWidget::grabKeyboard);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("ungrabKeyboard", &UIWidget::ungrabKeyboard);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("clearText", &UIWidget::clearText);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("isActive", &UIWidget::isActive);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("isEnabled", &UIWidget::isEnabled);
|
||||
g_lua.bindClassMemberFunction<UIWidget>("isDisabled", &UIWidget::isDisabled);
|
||||
|
|
Loading…
Reference in New Issue