本文整理汇总了C++中CGUIAddonWindow::OnMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIAddonWindow::OnMessage方法的具体用法?C++ CGUIAddonWindow::OnMessage怎么用?C++ CGUIAddonWindow::OnMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIAddonWindow
的用法示例。
在下文中一共展示了CGUIAddonWindow::OnMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set_focus_id
//@{
bool Interface_GUIWindow::set_focus_id(void* kodiBase, void* handle, int control_id)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
CGUIAddonWindow* pAddonWindow = static_cast<CGUIAddonWindow*>(handle);
if (!addon || !pAddonWindow)
{
CLog::Log(
LOGERROR,
"Interface_GUIWindow::%s - invalid handler data (kodiBase='%p', handle='%p') on addon '%s'",
__FUNCTION__, kodiBase, handle, addon ? addon->ID().c_str() : "unknown");
return false;
}
if (!pAddonWindow->GetControl(control_id))
{
CLog::Log(LOGERROR, "Interface_GUIWindow - %s: %s - Control does not exist in window",
__FUNCTION__, addon->Name().c_str());
return false;
}
Interface_GUIGeneral::lock();
CGUIMessage msg(GUI_MSG_SETFOCUS, pAddonWindow->m_windowId, control_id);
pAddonWindow->OnMessage(msg);
Interface_GUIGeneral::unlock();
return true;
}
示例2: set_control_label
void Interface_GUIWindow::set_control_label(void* kodiBase, void* handle, int control_id, const char *label)
{
CAddonDll* addon = static_cast<CAddonDll*>(kodiBase);
CGUIAddonWindow* pAddonWindow = static_cast<CGUIAddonWindow*>(handle);
if (!addon || !pAddonWindow || !label)
{
CLog::Log(LOGERROR, "Interface_GUIWindow::%s - invalid handler data (kodiBase='%p', handle='%p', label='%p') on addon '%s'",
__FUNCTION__, addon, pAddonWindow, label, addon ? addon->ID().c_str() : "unknown");
return;
}
Interface_GUIGeneral::lock();
CGUIMessage msg(GUI_MSG_LABEL_SET, pAddonWindow->m_windowId, control_id);
msg.SetLabel(label);
pAddonWindow->OnMessage(msg);
Interface_GUIGeneral::unlock();
}