fix combobox
This commit is contained in:
parent
a475384b73
commit
6ace984440
|
@ -36,7 +36,8 @@ function UIComboBox:addOption(text, data)
|
||||||
end
|
end
|
||||||
|
|
||||||
function UIComboBox:onMousePress(mousePos, mouseButton)
|
function UIComboBox:onMousePress(mousePos, mouseButton)
|
||||||
local menu = createWidget(self:getStyleName() .. 'PopupMenu', self)
|
local menu = createWidget(self:getStyleName() .. 'PopupMenu')
|
||||||
|
menu:setId(self:getId() .. 'PopupMenu')
|
||||||
for i,v in ipairs(self.options) do
|
for i,v in ipairs(self.options) do
|
||||||
menu:addOption(v.text, function() self:setCurrentOption(v.text) end)
|
menu:addOption(v.text, function() self:setCurrentOption(v.text) end)
|
||||||
end
|
end
|
||||||
|
|
|
@ -92,7 +92,8 @@ void UIManager::inputEvent(const InputEvent& event)
|
||||||
if(UIWidgetPtr parent = widget->getParent())
|
if(UIWidgetPtr parent = widget->getParent())
|
||||||
parent->focusChild(widget, Fw::MouseFocusReason);
|
parent->focusChild(widget, Fw::MouseFocusReason);
|
||||||
}
|
}
|
||||||
widget->onMousePress(event.mousePos, event.mouseButton);
|
if(widget->onMousePress(event.mousePos, event.mouseButton))
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue