本文整理汇总了C++中CGUIEditControl::OnAction方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIEditControl::OnAction方法的具体用法?C++ CGUIEditControl::OnAction怎么用?C++ CGUIEditControl::OnAction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIEditControl
的用法示例。
在下文中一共展示了CGUIEditControl::OnAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnAction
bool CGUIDialogBoxeeBrowseMenu::OnAction(const CAction &action)
{
switch (action.id)
{
case ACTION_PARENT_DIR:
case ACTION_PREVIOUS_MENU:
{
Close();
return true;
}
break;
case ACTION_MOUSE:
case ACTION_MOVE_LEFT:
case ACTION_MOVE_RIGHT:
case ACTION_MOVE_UP:
case ACTION_MOVE_DOWN:
{
// Call parent to perform the actual action
bool bResult = CGUIDialog::OnAction(action);
return bResult;
}
break;
default:
{
// do nothing
}
break;
}
// Pass along all key presses to the edit control
if (action.id >= KEY_ASCII)
{
CGUIMessage msg(GUI_MSG_SETFOCUS, GetID(), BROWSE_MENU_BUTTON_SEARCH);
OnMessage(msg);
m_iCurrentButtonId = BROWSE_MENU_BUTTON_SEARCH;
CGUIEditControl* pSearchControl = (CGUIEditControl*)GetControl(BROWSE_MENU_BUTTON_SEARCH);
if (pSearchControl)
{
pSearchControl->OnAction(action);
}
return true;
}
return CGUIDialog::OnAction(action);
}
示例2: OnInitWindow
void CGUIDialogBoxeeBrowseMenu::OnInitWindow()
{
if (!CanOpenBrowseMenu())
{
Close(true);
return;
}
CGUIDialog::OnInitWindow();
m_downloadCounter = 0;
//CLog::Log(LOGDEBUG, "CGUIDialogBoxeeBrowseMenu::OnInitWindow - [CurrentRow=%d][CurrentButton=%d][StartActionId=%d] (browsemenu)", m_iCurrentRowIndex, m_iCurrentButtonId,m_startAction.id);
// if (!g_application.IsPlaying() && m_iCurrentButtonId == 102)
// {
// m_iCurrentButtonId = BROWSE_MENU_BUTTON_HOME;
// CGUIMessage msg(GUI_MSG_SETFOCUS, GetID(), m_iCurrentButtonId);
// OnMessage(msg);
// m_iCurrentRowIndex = 0;
// SetSelectedButtonInRow(0);
// }
if (m_openInSearch)
{
CGUIMessage msg(GUI_MSG_SETFOCUS, GetID(), BROWSE_MENU_BUTTON_SEARCH);
OnMessage(msg);
m_iCurrentButtonId = BROWSE_MENU_BUTTON_SEARCH;
return;
}
if (m_startAction.id != 0)
{
CGUIMessage msg(GUI_MSG_SETFOCUS, GetID(), BROWSE_MENU_BUTTON_SEARCH);
OnMessage(msg);
m_iCurrentButtonId = BROWSE_MENU_BUTTON_SEARCH;
CGUIEditControl* pSearchControl = (CGUIEditControl*)GetControl(BROWSE_MENU_BUTTON_SEARCH);
if (pSearchControl)
{
pSearchControl->OnAction(m_startAction);
}
ResetAction();
}
int iCurrentWindow = g_windowManager.GetActiveWindow();
bool setFocusOnButton = false;
if ((m_iCurrentWindowId != iCurrentWindow) || (!g_application.IsPlaying() && m_iCurrentButtonId == BTN_NOW_PLAYING))
{
m_iCurrentWindowId = iCurrentWindow;
setFocusOnButton = true;
switch(iCurrentWindow)
{
case WINDOW_BOXEE_BROWSE_MOVIES:
{
m_iCurrentButtonId = BROWSE_MENU_BUTTON_MOVIES;
}
break;
case WINDOW_BOXEE_BROWSE_TVSHOWS:
{
m_iCurrentButtonId = BROWSE_MENU_BUTTON_TV;
}
break;
case WINDOW_BOXEE_BROWSE_APPS:
{
m_iCurrentButtonId = BROWSE_MENU_BUTTON_APPS;
}
break;
case WINDOW_BOXEE_BROWSE_LOCAL:
case WINDOW_BOXEE_BROWSE_ALBUMS:
case WINDOW_BOXEE_BROWSE_PHOTOS:
case WINDOW_BOXEE_BROWSE_TRACKS:
{
m_iCurrentButtonId = BROWSE_MENU_BUTTON_FILES;
}
break;
case WINDOW_BOXEE_BROWSE_DISCOVER:
{
m_iCurrentButtonId = BROWSE_MENU_BUTTON_FRIENDS;
}
break;
case WINDOW_BOXEE_BROWSE_QUEUE:
{
m_iCurrentButtonId = BROWSE_MENU_BUTTON_WATCH_LATER;
}
break;
case WINDOW_BOXEE_LIVETV:
{
m_iCurrentButtonId = BROWSE_MENU_BUTTON_LIVETV;
}
break;
default:
{
setFocusOnButton = false;
}
break;
}
//.........这里部分代码省略.........