本文整理汇总了C++中CGUIControl::HasVisibleID方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIControl::HasVisibleID方法的具体用法?C++ CGUIControl::HasVisibleID怎么用?C++ CGUIControl::HasVisibleID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIControl
的用法示例。
在下文中一共展示了CGUIControl::HasVisibleID方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SendControlMessage
bool CGUIControlGroup::SendControlMessage(CGUIMessage &message)
{
// see if a child matches, and send to the child control if so
for (iControls it = m_children.begin();it != m_children.end(); ++it)
{
CGUIControl* control = *it;
if (control->HasVisibleID(message.GetControlId()))
{
if (control->OnMessage(message))
return true;
}
}
// Unhandled - send to all matching invisible controls as well
bool handled(false);
for (iControls it = m_children.begin(); it != m_children.end(); ++it)
{
CGUIControl* control = *it;
if (control->HasID(message.GetControlId()))
{
if (control->OnMessage(message))
handled = true;
}
}
return handled;
}
示例2: HasVisibleID
bool CGUIControlGroup::HasVisibleID(int id) const
{
// call base class first as the group may be the requested control
if (CGUIControl::HasVisibleID(id)) return true;
// if the group isn't visible, then none of it's children can be
if (!IsVisible()) return false;
for (ciControls it = m_children.begin(); it != m_children.end(); ++it)
{
CGUIControl *child = *it;
if (child->HasVisibleID(id))
return true;
}
return false;
}
示例3: OnMessage
//.........这里部分代码省略.........
SendWindowMessage(message);
return true;
}
case GUI_MSG_SETFOCUS:
{
// first try our last focused control...
if (m_focusedControl)
{
CGUIControl *control = GetFirstFocusableControl(m_focusedControl);
if (control)
{
CGUIMessage msg(GUI_MSG_SETFOCUS, GetParentID(), control->GetID());
return control->OnMessage(msg);
}
}
// ok, no previously focused control, try the default control first
if (m_defaultControl)
{
CGUIControl *control = GetFirstFocusableControl(m_defaultControl);
if (control)
{
CGUIMessage msg(GUI_MSG_SETFOCUS, GetParentID(), control->GetID());
return control->OnMessage(msg);
}
}
// no success with the default control, so just find one to focus
CGUIControl *control = GetFirstFocusableControl(0);
if (control)
{
CGUIMessage msg(GUI_MSG_SETFOCUS, GetParentID(), control->GetID());
return control->OnMessage(msg);
}
// unsuccessful
return false;
break;
}
case GUI_MSG_LOSTFOCUS:
{
// set all subcontrols unfocused
for (iControls it = m_children.begin(); it != m_children.end(); ++it)
(*it)->SetFocus(false);
if (!HasID(message.GetParam1()))
{ // we don't have the new id, so unfocus
SetFocus(false);
if (m_parentControl)
m_parentControl->OnMessage(message);
}
return true;
}
break;
case GUI_MSG_PAGE_CHANGE:
case GUI_MSG_REFRESH_THUMBS:
case GUI_MSG_REFRESH_LIST:
{ // send to all child controls (make sure the target is the control id)
for (iControls it = m_children.begin(); it != m_children.end(); ++it)
{
CGUIMessage msg(message.GetMessage(), message.GetSenderId(), (*it)->GetID(), message.GetParam1());
(*it)->OnMessage(msg);
}
return true;
}
break;
}
bool handled(false);
//not intented for any specific control, send to all childs and our base handler.
if (message.GetControlId() == 0)
{
for (iControls it = m_children.begin();it != m_children.end(); ++it)
{
CGUIControl* control = *it;
handled |= control->OnMessage(message);
}
return CGUIControl::OnMessage(message) || handled;
}
// if it's intended for us, then so be it
if (message.GetControlId() == GetID())
return CGUIControl::OnMessage(message);
// else, see if a child matches, and send to the child control if so
for (iControls it = m_children.begin();it != m_children.end(); ++it)
{
CGUIControl* control = *it;
if (control->HasVisibleID(message.GetControlId()))
{
if (control->OnMessage(message))
return true;
}
}
// Unhandled - send to all matching invisible controls as well
for (iControls it = m_children.begin(); it != m_children.end(); ++it)
{
CGUIControl* control = *it;
if (control->HasID(message.GetControlId()))
{
if (control->OnMessage(message))
handled = true;
}
}
return handled;
}