implement button tooltips on top menu

This commit is contained in:
Eduardo Bart
2011-11-03 17:07:07 -02:00
parent 5988867787
commit 1b9f9bbc7d
12 changed files with 123 additions and 5 deletions

View File

@@ -841,6 +841,11 @@ void UIWidget::onStyleApply(const OTMLNodePtr& styleNode)
anchorLayout->addAnchor(asUIWidget(), anchoredEdge, hookedWidgetId, hookedEdge);
}
} else if(node->tag() == "onClick" ||
node->tag() == "onHoverChange") {
dump << node->tag();
g_lua.loadFunction(node->value(), "@" + node->source() + "[" + node->tag() + "]");
luaSetField(node->tag());
}
}
}
@@ -858,6 +863,10 @@ void UIWidget::onFocusChange(bool focused, Fw::FocusReason reason)
void UIWidget::onHoverChange(bool hovered)
{
callLuaField("onHoverChange", hovered);
// check for new hovered elements when the current widget is removed
if(!hovered && !getParent())
g_ui.getRootWidget()->updateState(Fw::HoverState);
}
bool UIWidget::onKeyPress(uchar keyCode, char keyChar, int keyboardModifiers)