Example #1
0
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;
}
Example #2
0
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;;
}