本文整理汇总了C++中CGUIAction::ExecuteActions方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIAction::ExecuteActions方法的具体用法?C++ CGUIAction::ExecuteActions怎么用?C++ CGUIAction::ExecuteActions使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIAction
的用法示例。
在下文中一共展示了CGUIAction::ExecuteActions方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInfo
bool CGUIControl::OnInfo()
{
CGUIAction action = GetAction(ACTION_SHOW_INFO);
if (action.HasAnyActions())
return action.ExecuteActions(GetID(), GetParentID());
return false;
}
示例2: OnClick
void CGUIButtonControl::OnClick()
{
// Save values, as the click message may deactivate the window
int controlID = GetID();
int parentID = GetParentID();
CGUIAction clickActions = m_clickActions;
// button selected, send a message
CGUIMessage msg(GUI_MSG_CLICKED, controlID, parentID, 0);
SendWindowMessage(msg);
clickActions.ExecuteActions(controlID, parentID);
}
示例3: OnMove
bool CGUIWindow::OnMove(int fromControl, int moveAction)
{
const CGUIControl *control = GetFirstFocusableControl(fromControl);
if (!control) control = GetControl(fromControl);
if (!control)
{ // no current control??
CLog::Log(LOGERROR, "Unable to find control %i in window %u",
fromControl, GetID());
return false;
}
vector<int> moveHistory;
int nextControl = fromControl;
while (control)
{ // grab the next control direction
moveHistory.push_back(nextControl);
CGUIAction action;
if (!control->GetNavigationAction(moveAction, action))
return false;
action.ExecuteActions(nextControl, GetParentID());
nextControl = action.GetNavigation();
if (!nextControl) // 0 isn't valid control id
return false;
// check our history - if the nextControl is in it, we can't focus it
for (unsigned int i = 0; i < moveHistory.size(); i++)
{
if (nextControl == moveHistory[i])
return false; // no control to focus so do nothing
}
control = GetFirstFocusableControl(nextControl);
if (control)
break; // found a focusable control
control = GetControl(nextControl); // grab the next control and try again
}
if (!control)
return false; // no control to focus
// if we get here we have our new control so focus it (and unfocus the current control)
SET_CONTROL_FOCUS(nextControl, 0);
return true;
}