本文整理汇总了C++中CGUIWindow::IsModalDialog方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIWindow::IsModalDialog方法的具体用法?C++ CGUIWindow::IsModalDialog怎么用?C++ CGUIWindow::IsModalDialog使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIWindow
的用法示例。
在下文中一共展示了CGUIWindow::IsModalDialog方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnAction
bool CGUIWindowManager::OnAction(const CAction &action) const
{
CSingleLock lock(g_graphicsContext);
unsigned int topMost = m_activeDialogs.size();
while (topMost)
{
CGUIWindow *dialog = m_activeDialogs[--topMost];
lock.Leave();
if (dialog->IsModalDialog())
{ // we have the topmost modal dialog
if (!dialog->IsAnimating(ANIM_TYPE_WINDOW_CLOSE))
{
bool fallThrough = (dialog->GetID() == WINDOW_DIALOG_FULLSCREEN_INFO);
if (dialog->OnAction(action))
return true;
// dialog didn't want the action - we'd normally return false
// but for some dialogs we want to drop the actions through
if (fallThrough)
break;
return false;
}
return true; // do nothing with the action until the anim is finished
}
lock.Enter();
if (topMost > m_activeDialogs.size())
topMost = m_activeDialogs.size();
}
lock.Leave();
CGUIWindow* window = GetWindow(GetActiveWindow());
if (window)
return window->OnAction(action);
return false;
}
示例2: OnAction
bool CGUIWindowManager::OnAction(const CAction &action)
{
if (g_powerManager.IsSuspended())
{
g_powerManager.Resume();
return true;
}
// If the screen saver is active, it is on top of
// existing dialogs. Pass the actions to the screen
// saver and not to the dialogs
if (!g_application.GetInSlideshowScreensaver())
{
CSingleLock lock(g_graphicsContext);
unsigned int topMost = m_activeDialogs.size();
while (topMost)
{
CGUIWindow *dialog = m_activeDialogs[--topMost];
lock.Leave();
if (dialog->IsModalDialog())
{ // we have the topmost modal dialog
if (!dialog->IsAnimating(ANIM_TYPE_WINDOW_CLOSE))
{
bool fallThrough = (dialog->GetID() == WINDOW_DIALOG_FULLSCREEN_INFO);
if (dialog->OnAction(action))
return true;
// dialog didn't want the action - we'd normally return false
// but for some dialogs we want to drop the actions through
if (fallThrough)
break;
return false;
}
return true; // do nothing with the action until the anim is finished
}
// music or video overlay are handled as a special case, as they're modeless, but we allow
// clicking on them with the mouse.
if (action.id == ACTION_MOUSE && (dialog->GetID() == WINDOW_VIDEO_OVERLAY ||
dialog->GetID() == WINDOW_MUSIC_OVERLAY))
{
if (dialog->OnAction(action))
return true;
}
lock.Enter();
if (topMost > m_activeDialogs.size())
topMost = m_activeDialogs.size();
}
lock.Leave();
}
CGUIWindow* window = GetWindow(GetActiveWindow());
if (window)
return window->OnAction(action);
return false;
}
示例3: OnAction
bool CGUIWindowManager::OnAction(const CAction &action)
{
/*
参数:
1、
返回:
1、
说明:
1、
*/
CSingleLock lock(g_graphicsContext);
unsigned int topMost = m_activeDialogs.size();
while (topMost)
{
CGUIWindow *dialog = m_activeDialogs[--topMost];
lock.Leave();
if (dialog->IsModalDialog())
{ // we have the topmost modal dialog
if (!dialog->IsAnimating(ANIM_TYPE_WINDOW_CLOSE))
{
bool fallThrough = (dialog->GetID() == WINDOW_DIALOG_FULLSCREEN_INFO);
if (dialog->OnAction(action))
return true;
// dialog didn't want the action - we'd normally return false
// but for some dialogs we want to drop the actions through
if (fallThrough)
break;
return false;
}
return true; // do nothing with the action until the anim is finished
}
// music or video overlay are handled as a special case, as they're modeless, but we allow
// clicking on them with the mouse.
if (action.IsMouse() && (dialog->GetID() == WINDOW_DIALOG_VIDEO_OVERLAY || dialog->GetID() == WINDOW_DIALOG_MUSIC_OVERLAY))
{
if (dialog->OnAction(action))
return true;
}
lock.Enter();
if (topMost > m_activeDialogs.size())
topMost = m_activeDialogs.size();
}
lock.Leave();
CGUIWindow* window = GetWindow(GetActiveWindow());
if (window)
return window->OnAction(action);
return false;
}
示例4: GetTopMostModalDialogID
/// \brief Get the ID of the top most routed window
/// \return id ID of the window or WINDOW_INVALID if no routed window available
int CGUIWindowManager::GetTopMostModalDialogID(bool ignoreClosing /*= false*/) const
{
CSingleLock lock(g_graphicsContext);
for (crDialog it = m_activeDialogs.rbegin(); it != m_activeDialogs.rend(); ++it)
{
CGUIWindow *dialog = *it;
if (dialog->IsModalDialog() && (!ignoreClosing || !dialog->IsAnimating(ANIM_TYPE_WINDOW_CLOSE)))
{ // have a modal window
return dialog->GetID();
}
}
return WINDOW_INVALID;
}
示例5: GetTopMostModalDialogID
/// \brief Get the ID of the top most routed window
/// \return id ID of the window or WINDOW_INVALID if no routed window available
int CGUIWindowManager::GetTopMostModalDialogID() const
{
CSingleLock lock(g_graphicsContext);
for (crDialog it = m_activeDialogs.rbegin(); it != m_activeDialogs.rend(); ++it)
{
CGUIWindow *dialog = *it;
if (dialog->IsModalDialog())
{ // have a modal window
return dialog->GetID();
}
}
return WINDOW_INVALID;
}
示例6: HasModalDialog
bool CGUIWindowManager::HasModalDialog() const
{
CSingleLock lock(g_graphicsContext);
for (ciDialog it = m_activeDialogs.begin(); it != m_activeDialogs.end(); ++it)
{
CGUIWindow *window = *it;
if (window->IsModalDialog())
{ // have a modal window
if (!window->IsAnimating(ANIM_TYPE_WINDOW_CLOSE))
return true;
}
}
return false;
}
示例7: GetTopMostModalDialogID
/// \brief Get the ID of the top most routed window
/// \return id ID of the window or WINDOW_INVALID if no routed window available
int CGUIWindowManager::GetTopMostModalDialogID() const
{
// If the screen saver is active, don't tell anyone that there
// are any dialogs open, so the window will get the events and
// not the dialogs
if (g_application.GetInSlideshowScreensaver())
return WINDOW_INVALID;
CSingleLock lock(g_graphicsContext);
for (crDialog it = m_activeDialogs.rbegin(); it != m_activeDialogs.rend(); ++it)
{
CGUIWindow *dialog = *it;
if (dialog->IsModalDialog())
{ // have a modal window
return dialog->GetID();
}
}
return WINDOW_INVALID;
}
示例8: HasModalDialog
bool CGUIWindowManager::HasModalDialog() const
{
// If the screen saver is active, don't tell anyone that there
// are any dialogs open, so the window will get the events and
// not the dialogs
if (g_application.GetInSlideshowScreensaver())
return false;
CSingleLock lock(g_graphicsContext);
for (ciDialog it = m_activeDialogs.begin(); it != m_activeDialogs.end(); ++it)
{
CGUIWindow *window = *it;
if (window->IsModalDialog())
{ // have a modal window
if (!window->IsAnimating(ANIM_TYPE_WINDOW_CLOSE))
return true;
}
}
return false;
}
示例9: SendMessage
bool CGUIWindowManager::SendMessage(CGUIMessage& message)
{
bool handled = false;
// CLog::Log(LOGDEBUG,"SendMessage: mess=%d send=%d control=%d param1=%d", message.GetMessage(), message.GetSenderId(), message.GetControlId(), message.GetParam1());
// Send the message to all none window targets
for (int i = 0; i < (int) m_vecMsgTargets.size(); i++)
{
IMsgTargetCallback* pMsgTarget = m_vecMsgTargets[i];
if (pMsgTarget)
{
if (pMsgTarget->OnMessage( message )) handled = true;
}
}
// A GUI_MSG_NOTIFY_ALL is send to any active modal dialog
// and all windows whether they are active or not
if (message.GetMessage()==GUI_MSG_NOTIFY_ALL)
{
CSingleLock lock(g_graphicsContext);
for (rDialog it = m_activeDialogs.rbegin(); it != m_activeDialogs.rend(); ++it)
{
CGUIWindow *dialog = *it;
dialog->OnMessage(message);
}
for (WindowMap::iterator it = m_mapWindows.begin(); it != m_mapWindows.end(); it++)
{
CGUIWindow *pWindow = (*it).second;
pWindow->OnMessage(message);
}
return true;
}
// Normal messages are sent to:
// 1. All active modeless dialogs
// 2. The topmost dialog that accepts the message
// 3. The underlying window (only if it is the sender or receiver if a modal dialog is active)
bool hasModalDialog(false);
bool modalAcceptedMessage(false);
// don't use an iterator for this loop, as some messages mean that m_activeDialogs is altered,
// which will invalidate any iterator
CSingleLock lock(g_graphicsContext);
unsigned int topWindow = m_activeDialogs.size();
while (topWindow)
{
CGUIWindow* dialog = m_activeDialogs[--topWindow];
lock.Leave();
if (!modalAcceptedMessage && dialog->IsModalDialog())
{ // modal window
hasModalDialog = true;
if (!modalAcceptedMessage && dialog->OnMessage( message ))
{
modalAcceptedMessage = handled = true;
}
}
else if (!dialog->IsModalDialog())
{ // modeless
if (dialog->OnMessage( message ))
handled = true;
}
lock.Enter();
if (topWindow > m_activeDialogs.size())
topWindow = m_activeDialogs.size();
}
lock.Leave();
// now send to the underlying window
CGUIWindow* window = GetWindow(GetActiveWindow());
if (window)
{
if (hasModalDialog)
{
// only send the message to the underlying window if it's the recipient
// or sender (or we have no sender)
if (message.GetSenderId() == window->GetID() ||
message.GetControlId() == window->GetID() ||
message.GetSenderId() == 0 )
{
if (window->OnMessage(message)) handled = true;
}
}
else
{
if (window->OnMessage(message)) handled = true;
}
}
return handled;
}