本文整理汇总了C++中MenuManager::HandleGeneralCommands方法的典型用法代码示例。如果您正苦于以下问题:C++ MenuManager::HandleGeneralCommands方法的具体用法?C++ MenuManager::HandleGeneralCommands怎么用?C++ MenuManager::HandleGeneralCommands使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MenuManager
的用法示例。
在下文中一共展示了MenuManager::HandleGeneralCommands方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnCommand
BOOL CTeenSpiritDlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
TRACEST(_T("CTeenSpiritDlg::OnCommand"), wParam);
PrgAPI* pAPI = PRGAPI();
switch (wParam)
{
case CToolbarWnd::CMD_About:
return pAPI->GetActionManager()->ShowAboutDlg(this);
case CToolbarWnd::CMD_Collections:
return pAPI->GetActionManager()->ShowCollectionsDlg(this);
case CToolbarWnd::CMD_Search:
return pAPI->GetAdvancedSearchDlg()->ShowWindow(SW_SHOW);
case CToolbarWnd::CMD_History:
return pAPI->GetActionManager()->ShowHistoryDlg(this);
case CToolbarWnd::CMD_Options:
return pAPI->GetActionManager()->ShowOptionsDlg(this);
case CToolbarWnd::CMD_Games:
return pAPI->GetActionManager()->ShowGamesDlg(this);
case CToolbarWnd::CMD_Min:
return SendMessage(WM_SYSCOMMAND, SC_MINIMIZE, 0);
case CToolbarWnd::CMD_Restore:
return SendMessage(WM_SYSCOMMAND, SC_RESTORE, 0);
case CToolbarWnd::CMD_Close:
return SendMessage(WM_SYSCOMMAND, SC_CLOSE, 0);
break;
default:
{
if (wParam > MENU_First && wParam < MENU_Last)
{
MenuManager* pMM = pAPI->GetMenuManager();
MenuCommandsEnum cmd = (MenuCommandsEnum) wParam;
if (pMM->HandleGeneralCommands(cmd) || pMM->HandlePlayerCommands(*pAPI->GetMediaPlayer(), cmd, 0))
return TRUE;
}
}
return CDialog::OnCommand(wParam, lParam);
}
return TRUE;
}
示例2: OnButton
BOOL PlayListPane::OnButton(UINT idx)
{
TRACEST(_T("PlayListPane::OnCommand"), idx);
switch (idx)
{
case MI_ShowNumbers:
m_PlayList.SetConfigurationOption(CPlayListListCtrl::C_ShowNumbers,
m_PlayList.GetConfigurationOption(CPlayListListCtrl::C_ShowNumbers) == 0 ? 1 : 0);
break;
default:
{
PrgAPI* pAPI = PRGAPI();
MediaPlayer* pPlayer = pAPI->GetMediaPlayer();
MenuManager* pMM = pAPI->GetMenuManager();
MenuCommandsEnum cmd = (MenuCommandsEnum) idx;
if (!pMM->HandlePlayerCommands(*pPlayer, cmd, pPlayer->GetPlayListPos()) || (pMM->HandleGeneralCommands(cmd)))
return FALSE;
}
}
return TRUE;;
}