本文整理汇总了C++中CGUIWindow::Close方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIWindow::Close方法的具体用法?C++ CGUIWindow::Close怎么用?C++ CGUIWindow::Close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIWindow
的用法示例。
在下文中一共展示了CGUIWindow::Close方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DeInitialize
void CGUIWindowManager::DeInitialize()
{
CSingleLock lock(g_graphicsContext);
for (WindowMap::iterator it = m_mapWindows.begin(); it != m_mapWindows.end(); it++)
{
CGUIWindow* pWindow = (*it).second;
if (IsWindowActive(it->first))
{
pWindow->DisableAnimations();
pWindow->Close(true);
}
pWindow->ResetControlStates();
pWindow->FreeResources(true);
}
UnloadNotOnDemandWindows();
m_vecMsgTargets.erase( m_vecMsgTargets.begin(), m_vecMsgTargets.end() );
// destroy our custom windows...
for (int i = 0; i < (int)m_vecCustomWindows.size(); i++)
{
CGUIWindow *pWindow = m_vecCustomWindows[i];
Remove(pWindow->GetID());
delete pWindow;
}
// clear our vectors of windows
m_vecCustomWindows.clear();
m_activeDialogs.clear();
m_initialized = false;
}
示例2: CloseDialogs
void CGUIWindowManager::CloseDialogs(bool forceClose)
{
CSingleLock lock(g_graphicsContext);
while (m_activeDialogs.size() > 0)
{
CGUIWindow* win = m_activeDialogs[0];
win->Close(forceClose);
}
}
示例3: CloseDialogs
void CGUIWindowManager::CloseDialogs(bool forceClose)
{
CSingleLock lock(g_graphicsContext);
std::vector<CGUIWindow*> vecCloseDialogs;
vecCloseDialogs.insert(vecCloseDialogs.begin(),m_activeDialogs.begin(),m_activeDialogs.end());
for (size_t dlg=0; dlg < vecCloseDialogs.size(); dlg++)
{
CGUIWindow* win = vecCloseDialogs[dlg];
//attention: the Close() function below will remove the dialog from m_activeDialogs using this thread, using the same lock.
win->Close(forceClose);
}
}
示例4: ProcessMessage
//.........这里部分代码省略.........
{
CGUIDialog* pDialog = (CGUIDialog*)g_windowManager.GetWindow(pMsg->param1);
if (!pDialog) return ;
pDialog->DoModal();
}
break;
case TMSG_NETWORKMESSAGE:
{
g_application.getNetwork().NetworkMessage((CNetwork::EMESSAGE)pMsg->param1, pMsg->param2);
}
break;
case TMSG_GUI_DO_MODAL:
{
CGUIDialog *pDialog = (CGUIDialog *)pMsg->lpVoid;
if (pDialog)
pDialog->DoModal(pMsg->param1, pMsg->strParam);
}
break;
case TMSG_GUI_SHOW:
{
CGUIDialog *pDialog = (CGUIDialog *)pMsg->lpVoid;
if (pDialog)
pDialog->Show();
}
break;
case TMSG_GUI_WINDOW_CLOSE:
{
CGUIWindow *window = (CGUIWindow *)pMsg->lpVoid;
if (window)
window->Close(pMsg->param2 & 0x1 ? true : false, pMsg->param1, pMsg->param2 & 0x2 ? true : false);
}
break;
case TMSG_GUI_ACTIVATE_WINDOW:
{
g_windowManager.ActivateWindow(pMsg->param1, pMsg->params, pMsg->param2 & 0x1 ? true : false, pMsg->param2 & 0x2 ? true : false);
}
break;
case TMSG_GUI_ADDON_DIALOG:
{
if (pMsg->lpVoid)
{ // TODO: This is ugly - really these python dialogs should just be normal XBMC dialogs
((ADDON::CGUIAddonWindowDialog *) pMsg->lpVoid)->Show_Internal(pMsg->param2 > 0);
}
}
break;
#ifdef HAS_PYTHON
case TMSG_GUI_PYTHON_DIALOG:
{
// This hack is not much better but at least I don't need to make ApplicationMessenger
// know about Addon (Python) specific classes.
CAction caction(pMsg->param1);
((CGUIWindow*)pMsg->lpVoid)->OnAction(caction);
}
break;
#endif
case TMSG_GUI_ACTION:
{
if (pMsg->lpVoid)
示例5: ProcessMessage
//.........这里部分代码省略.........
{
CGUIDialog* pDialog = (CGUIDialog*)g_windowManager.GetWindow(pMsg->dwParam1);
if (!pDialog) return ;
pDialog->DoModal();
}
break;
case TMSG_NETWORKMESSAGE:
{
g_application.getNetwork().NetworkMessage((CNetwork::EMESSAGE)pMsg->dwParam1, (int)pMsg->dwParam2);
}
break;
case TMSG_GUI_DO_MODAL:
{
CGUIDialog *pDialog = (CGUIDialog *)pMsg->lpVoid;
if (pDialog)
pDialog->DoModal((int)pMsg->dwParam1, pMsg->strParam);
}
break;
case TMSG_GUI_SHOW:
{
CGUIDialog *pDialog = (CGUIDialog *)pMsg->lpVoid;
if (pDialog)
pDialog->Show();
}
break;
case TMSG_GUI_WINDOW_CLOSE:
{
CGUIWindow *window = (CGUIWindow *)pMsg->lpVoid;
if (window)
window->Close(pMsg->dwParam2 & 0x1 ? true : false, pMsg->dwParam1, pMsg->dwParam2 & 0x2 ? true : false);
}
break;
case TMSG_GUI_ACTIVATE_WINDOW:
{
g_windowManager.ActivateWindow(pMsg->dwParam1, pMsg->params, pMsg->dwParam2 > 0);
}
break;
case TMSG_GUI_PYTHON_DIALOG:
{
if (pMsg->lpVoid)
{ // TODO: This is ugly - really these python dialogs should just be normal XBMC dialogs
if (pMsg->dwParam1)
((CGUIPythonWindowXMLDialog *)pMsg->lpVoid)->Show_Internal(pMsg->dwParam2 > 0);
else
((CGUIPythonWindowDialog *)pMsg->lpVoid)->Show_Internal(pMsg->dwParam2 > 0);
}
}
break;
case TMSG_GUI_ACTION:
{
if (pMsg->lpVoid)
{
CAction *action = (CAction *)pMsg->lpVoid;
if (pMsg->dwParam1 == WINDOW_INVALID)
g_application.OnAction(*action);
else
{
CGUIWindow *pWindow = g_windowManager.GetWindow(pMsg->dwParam1);
if (pWindow)
示例6: OnApplicationMessage
void CGUIWindowManager::OnApplicationMessage(ThreadMessage* pMsg)
{
switch (pMsg->dwMessage)
{
case TMSG_GUI_DIALOG_OPEN:
{
if (pMsg->lpVoid)
static_cast<CGUIDialog*>(pMsg->lpVoid)->Open(pMsg->strParam);
else
{
CGUIDialog* pDialog = static_cast<CGUIDialog*>(GetWindow(pMsg->param1));
if (pDialog)
pDialog->Open(pMsg->strParam);
}
}
break;
case TMSG_GUI_WINDOW_CLOSE:
{
CGUIWindow *window = static_cast<CGUIWindow *>(pMsg->lpVoid);
if (window)
window->Close((pMsg->param1 & 0x1) ? true : false, pMsg->param1, (pMsg->param1 & 0x2) ? true : false);
}
break;
case TMSG_GUI_ACTIVATE_WINDOW:
{
ActivateWindow(pMsg->param1, pMsg->params, pMsg->param2 > 0);
}
break;
case TMSG_GUI_ADDON_DIALOG:
{
if (pMsg->lpVoid)
{ // TODO: This is ugly - really these python dialogs should just be normal XBMC dialogs
static_cast<ADDON::CGUIAddonWindowDialog *>(pMsg->lpVoid)->Show_Internal(pMsg->param2 > 0);
}
}
break;
#ifdef HAS_PYTHON
case TMSG_GUI_PYTHON_DIALOG:
{
// This hack is not much better but at least I don't need to make ApplicationMessenger
// know about Addon (Python) specific classes.
CAction caction(pMsg->param1);
static_cast<CGUIWindow*>(pMsg->lpVoid)->OnAction(caction);
}
break;
#endif
case TMSG_GUI_ACTION:
{
if (pMsg->lpVoid)
{
CAction *action = static_cast<CAction *>(pMsg->lpVoid);
if (pMsg->param1 == WINDOW_INVALID)
g_application.OnAction(*action);
else
{
CGUIWindow *pWindow = GetWindow(pMsg->param1);
if (pWindow)
pWindow->OnAction(*action);
else
CLog::Log(LOGWARNING, "Failed to get window with ID %i to send an action to", pMsg->param1);
}
delete action;
}
}
break;
case TMSG_GUI_MESSAGE:
if (pMsg->lpVoid)
{
CGUIMessage *message = static_cast<CGUIMessage *>(pMsg->lpVoid);
SendMessage(*message, pMsg->param1);
delete message;
}
break;
case TMSG_GUI_DIALOG_YESNO:
if (!pMsg->lpVoid && pMsg->param1 < 0 && pMsg->param2 < 0)
return;
auto dialog = static_cast<CGUIDialogYesNo*>(GetWindow(WINDOW_DIALOG_YES_NO));
if (!dialog)
return;
if (pMsg->lpVoid)
pMsg->SetResult(dialog->ShowAndGetInput(*static_cast<HELPERS::DialogYesNoMessage*>(pMsg->lpVoid)));
else
{
HELPERS::DialogYesNoMessage options;
options.heading = pMsg->param1;
options.text = pMsg->param2;
pMsg->SetResult(dialog->ShowAndGetInput(options));
}
break;
}
//.........这里部分代码省略.........
示例7: OnApplicationMessage
void CGUIWindowManager::OnApplicationMessage(ThreadMessage* pMsg)
{
switch (pMsg->dwMessage)
{
case TMSG_GUI_DIALOG_OPEN:
{
if (pMsg->lpVoid)
static_cast<CGUIDialog*>(pMsg->lpVoid)->Open();
else
{
CGUIDialog* pDialog = static_cast<CGUIDialog*>(GetWindow(pMsg->param1));
if (pDialog)
pDialog->Open();
}
}
break;
case TMSG_GUI_WINDOW_CLOSE:
{
CGUIWindow *window = static_cast<CGUIWindow *>(pMsg->lpVoid);
if (window)
window->Close(pMsg->param1 & 0x1 ? true : false, pMsg->param1, pMsg->param1 & 0x2 ? true : false);
}
break;
case TMSG_GUI_ACTIVATE_WINDOW:
{
ActivateWindow(pMsg->param1, pMsg->params, pMsg->param2 > 0);
}
break;
case TMSG_GUI_ADDON_DIALOG:
{
if (pMsg->lpVoid)
{ // TODO: This is ugly - really these python dialogs should just be normal XBMC dialogs
static_cast<ADDON::CGUIAddonWindowDialog *>(pMsg->lpVoid)->Show_Internal(pMsg->param2 > 0);
}
}
break;
#ifdef HAS_PYTHON
case TMSG_GUI_PYTHON_DIALOG:
{
// This hack is not much better but at least I don't need to make ApplicationMessenger
// know about Addon (Python) specific classes.
CAction caction(pMsg->param1);
static_cast<CGUIWindow*>(pMsg->lpVoid)->OnAction(caction);
}
break;
#endif
case TMSG_GUI_ACTION:
{
if (pMsg->lpVoid)
{
CAction *action = static_cast<CAction *>(pMsg->lpVoid);
if (pMsg->param1 == WINDOW_INVALID)
g_application.OnAction(*action);
else
{
CGUIWindow *pWindow = GetWindow(pMsg->param1);
if (pWindow)
pWindow->OnAction(*action);
else
CLog::Log(LOGWARNING, "Failed to get window with ID %i to send an action to", pMsg->param1);
}
delete action;
}
}
break;
case TMSG_GUI_MESSAGE:
{
if (pMsg->lpVoid)
{
CGUIMessage *message = static_cast<CGUIMessage *>(pMsg->lpVoid);
SendMessage(*message, pMsg->param1);
delete message;
}
}
break;
}
}