本文整理汇总了C++中CGUIDialog::Close方法的典型用法代码示例。如果您正苦于以下问题:C++ CGUIDialog::Close方法的具体用法?C++ CGUIDialog::Close怎么用?C++ CGUIDialog::Close使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGUIDialog
的用法示例。
在下文中一共展示了CGUIDialog::Close方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnMessage
bool CGUIDialogVideoOSD::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_VIDEO_MENU_STARTED:
{
// We have gone to the DVD menu, so close the OSD.
Close();
}
break;
case GUI_MSG_WINDOW_DEINIT: // fired when OSD is hidden
{
// Remove our subdialogs if visible
CGUIDialog *pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OSD_SETTINGS);
if (pDialog && pDialog->IsDialogRunning())
pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_AUDIO_OSD_SETTINGS);
if (pDialog && pDialog->IsDialogRunning()) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_BOOKMARKS);
if (pDialog && pDialog->IsDialogRunning()) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_CHANNELS);
if (pDialog && pDialog->IsDialogRunning()) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_GUIDE);
if (pDialog && pDialog->IsDialogRunning()) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_DIRECTOR);
if (pDialog && pDialog->IsDialogRunning()) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_CUTTER);
if (pDialog && pDialog->IsDialogRunning()) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_OSD_TELETEXT);
if (pDialog && pDialog->IsDialogRunning()) pDialog->Close(true);
}
break;
}
return CGUIDialog::OnMessage(message);
}
示例2: OnMessage
bool CGUIWindowOSD::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
// Boxee section
case GUI_MSG_CLICKED:
{
unsigned int iControl = message.GetSenderId();
if (iControl == CONTROL_RATE_BUTTON)
{
CFileItem &item = g_application.CurrentFileItem();
bool bLike;
if (CGUIDialogBoxeeRate::ShowAndGetInput(bLike))
{
BoxeeUtils::Rate(&item, bLike);
g_application.m_guiDialogKaiToast.QueueNotification(CGUIDialogKaiToast::ICON_STAR, "", g_localizeStrings.Get(51034), 5000 , KAI_YELLOW_COLOR, KAI_GREY_COLOR);
}
}
else if (iControl == CONTROL_RECOMMEND_BUTTON)
{
CGUIDialogBoxeeShare *pFriends = (CGUIDialogBoxeeShare *)g_windowManager.GetWindow(WINDOW_DIALOG_BOXEE_SHARE);
pFriends->DoModal();
}
return true;
}
// end boxee section
case GUI_MSG_VIDEO_MENU_STARTED:
{
// We have gone to the DVD menu, so close the OSD.
Close();
}
case GUI_MSG_WINDOW_DEINIT: // fired when OSD is hidden
{
// Remove our subdialogs if visible
CGUIDialog *pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OSD_SETTINGS);
if (pDialog && pDialog->IsDialogRunning())
pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_AUDIO_OSD_SETTINGS);
if (pDialog && pDialog->IsDialogRunning()) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_BOOKMARKS);
if (pDialog && pDialog->IsDialogRunning()) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_OSD_TELETEXT);
if (pDialog && pDialog->IsDialogRunning()) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_SUBTITLE_OSD_SETTINGS);
if (pDialog && pDialog->IsDialogRunning()) pDialog->Close(true);
}
break;
}
return CGUIDialog::OnMessage(message);
}
示例3: ToggleOSD
void CGameWindowFullScreen::ToggleOSD()
{
CGUIDialog *pOSD = GetOSD();
if (pOSD != nullptr)
{
if (pOSD->IsDialogRunning())
pOSD->Close();
else
pOSD->Open();
}
MarkDirtyRegion();
}
示例4: OnMessage
bool CGUIDialogVideoOSD::OnMessage(CGUIMessage& message)
{
switch ( message.GetMessage() )
{
case GUI_MSG_VIDEO_MENU_STARTED:
{
// We have gone to the DVD menu, so close the OSD.
Close();
}
break;
case GUI_MSG_WINDOW_DEINIT: // fired when OSD is hidden
{
// Remove our subdialogs if visible
CGUIDialog *pDialog = g_windowManager.GetDialog(WINDOW_DIALOG_AUDIO_DSP_OSD_SETTINGS);
if (pDialog && pDialog->IsDialogRunning())
pDialog->Close(true);
pDialog = g_windowManager.GetDialog(WINDOW_DIALOG_AUDIO_OSD_SETTINGS);
if (pDialog && pDialog->IsDialogRunning())
pDialog->Close(true);
}
break;
}
return CGUIDialog::OnMessage(message);
}
示例5: OnMessage
bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
// check whether we've come back here from a window during which time we've actually
// stopped playing videos
if (message.GetParam1() == WINDOW_INVALID && !g_application.IsPlayingVideo())
{ // why are we here if nothing is playing???
g_windowManager.PreviousWindow();
return true;
}
g_infoManager.SetShowInfo(false);
g_infoManager.SetShowCodec(false);
m_bShowCurrentTime = false;
m_bGroupSelectShow = false;
g_infoManager.SetDisplayAfterSeek(0); // Make sure display after seek is off.
// switch resolution
g_graphicsContext.SetFullScreenVideo(true);
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update(false);
#endif
// now call the base class to load our windows
CGUIWindow::OnMessage(message);
m_bShowViewModeInfo = false;
if (CUtil::IsUsingTTFSubtitles())
{
CSingleLock lock (m_fontLock);
CStdString fontPath = "special://xbmc/media/Fonts/";
fontPath += g_guiSettings.GetString("subtitles.font");
// We scale based on PAL4x3 - this at least ensures all sizing is constant across resolutions.
RESOLUTION_INFO pal(720, 576, 0);
CGUIFont *subFont = g_fontManager.LoadTTF("__subtitle__", fontPath, color[g_guiSettings.GetInt("subtitles.color")], 0, g_guiSettings.GetInt("subtitles.height"), g_guiSettings.GetInt("subtitles.style"), false, 1.0f, 1.0f, &pal, true);
CGUIFont *borderFont = g_fontManager.LoadTTF("__subtitleborder__", fontPath, 0xFF000000, 0, g_guiSettings.GetInt("subtitles.height"), g_guiSettings.GetInt("subtitles.style"), true, 1.0f, 1.0f, &pal, true);
if (!subFont || !borderFont)
CLog::Log(LOGERROR, "CGUIWindowFullScreen::OnMessage(WINDOW_INIT) - Unable to load subtitle font");
else
m_subsLayout = new CGUITextLayout(subFont, true, 0, borderFont);
}
else
m_subsLayout = NULL;
return true;
}
case GUI_MSG_WINDOW_DEINIT:
{
CGUIWindow::OnMessage(message);
CGUIDialog *pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_OSD_TELETEXT);
if (pDialog) pDialog->Close(true);
CGUIDialogSlider *slider = (CGUIDialogSlider *)g_windowManager.GetWindow(WINDOW_DIALOG_SLIDER);
if (slider) slider->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OSD);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_FULLSCREEN_INFO);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_CHANNELS);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_GUIDE);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_DIRECTOR);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_CUTTER);
if (pDialog) pDialog->Close(true);
FreeResources(true);
CSingleLock lock (g_graphicsContext);
g_graphicsContext.SetFullScreenVideo(false);
lock.Leave();
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update(false);
#endif
CSingleLock lockFont(m_fontLock);
if (m_subsLayout)
{
g_fontManager.Unload("__subtitle__");
g_fontManager.Unload("__subtitleborder__");
delete m_subsLayout;
m_subsLayout = NULL;
}
return true;
}
case GUI_MSG_CLICKED:
{
unsigned int iControl = message.GetSenderId();
if (iControl == CONTROL_GROUP_CHOOSER && g_PVRManager.IsStarted())
{
//.........这里部分代码省略.........
示例6: OnMessage
bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
// check whether we've come back here from a window during which time we've actually
// stopped playing videos
if (message.GetParam1() == WINDOW_INVALID && !g_application.IsPlayingVideo())
{ // why are we here if nothing is playing???
g_windowManager.PreviousWindow();
return true;
}
g_infoManager.SetShowInfo(false);
g_infoManager.SetShowCodec(false);
m_bShowCurrentTime = false;
g_infoManager.SetDisplayAfterSeek(0); // Make sure display after seek is off.
// switch resolution
g_graphicsContext.SetFullScreenVideo(true);
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update(false);
#endif
// now call the base class to load our windows
CGUIWindow::OnMessage(message);
m_bShowViewModeInfo = false;
if (CUtil::IsUsingTTFSubtitles())
{
CSingleLock lock (m_fontLock);
CStdString fontPath = "special://xbmc/media/Fonts/";
fontPath += g_guiSettings.GetString("subtitles.font");
// We scale based on PAL4x3 - this at least ensures all sizing is constant across resolutions.
RESOLUTION_INFO pal(720, 576, 0);
CGUIFont *subFont = g_fontManager.LoadTTF("__subtitle__", fontPath, color[g_guiSettings.GetInt("subtitles.color")], 0, g_guiSettings.GetInt("subtitles.height"), g_guiSettings.GetInt("subtitles.style"), false, 1.0f, 1.0f, &pal, true);
CGUIFont *borderFont = g_fontManager.LoadTTF("__subtitleborder__", fontPath, 0xFF000000, 0, g_guiSettings.GetInt("subtitles.height"), g_guiSettings.GetInt("subtitles.style"), true, 1.0f, 1.0f, &pal, true);
if (!subFont || !borderFont)
CLog::Log(LOGERROR, "CGUIWindowFullScreen::OnMessage(WINDOW_INIT) - Unable to load subtitle font");
else
m_subsLayout = new CGUITextLayout(subFont, true, 0, borderFont);
}
else
m_subsLayout = NULL;
return true;
}
case GUI_MSG_WINDOW_DEINIT:
{
CGUIWindow::OnMessage(message);
CGUIDialog *pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_OSD_TELETEXT);
if (pDialog) pDialog->Close(true);
CGUIDialogSlider *slider = (CGUIDialogSlider *)g_windowManager.GetWindow(WINDOW_DIALOG_SLIDER);
if (slider) slider->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OSD);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_FULLSCREEN_INFO);
if (pDialog) pDialog->Close(true);
FreeResources(true);
CSingleLock lock (g_graphicsContext);
g_graphicsContext.SetFullScreenVideo(false);
lock.Leave();
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update(false);
#endif
CSingleLock lockFont(m_fontLock);
if (m_subsLayout)
{
g_fontManager.Unload("__subtitle__");
g_fontManager.Unload("__subtitleborder__");
delete m_subsLayout;
m_subsLayout = NULL;
}
return true;
}
case GUI_MSG_SETFOCUS:
case GUI_MSG_LOSTFOCUS:
if (message.GetSenderId() != WINDOW_FULLSCREEN_VIDEO) return true;
break;
}
return CGUIWindow::OnMessage(message);
}
示例7: OnMessage
bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
// check whether we've come back here from a window during which time we've actually
// stopped playing videos
if (message.GetParam1() == WINDOW_INVALID && !g_application.IsPlayingVideo())
{ // why are we here if nothing is playing???
m_gWindowManager.PreviousWindow();
return true;
}
m_bLastRender = false;
g_infoManager.SetShowInfo(false);
g_infoManager.SetShowCodec(false);
m_bShowCurrentTime = false;
g_infoManager.SetDisplayAfterSeek(0); // Make sure display after seek is off.
#ifdef HAS_XBOX_HARDWARE
// Disable nav sounds if spindown is active as they are loaded
// from HDD all the time.
if (
!g_application.CurrentFileItem().IsHD() &&
(g_guiSettings.GetInt("harddisk.remoteplayspindown") || g_guiSettings.GetInt("harddisk.spindowntime"))
)
{
if (!g_guiSettings.GetBool("lookandfeel.soundsduringplayback"))
g_audioManager.Enable(false);
}
#endif
// setup the brightness, contrast and resolution
CUtil::SetBrightnessContrastGammaPercent(g_stSettings.m_currentVideoSettings.m_Brightness, g_stSettings.m_currentVideoSettings.m_Contrast, g_stSettings.m_currentVideoSettings.m_Gamma, false);
// switch resolution
CSingleLock lock (g_graphicsContext);
g_graphicsContext.SetFullScreenVideo(true);
#ifdef HAS_VIDEO_PLAYBACK
RESOLUTION res = g_renderManager.GetResolution();
g_graphicsContext.SetVideoResolution(res, false, false);
#endif
lock.Leave();
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update(false);
#endif
// now call the base class to load our windows
CGUIWindow::OnMessage(message);
m_bShowViewModeInfo = false;
if (CUtil::IsUsingTTFSubtitles())
{
CSingleLock lock (m_fontLock);
CStdString fontPath = _P("Q:\\media\\Fonts\\");
fontPath += g_guiSettings.GetString("subtitles.font");
#ifdef __APPLE__
// We scale based on PAL16x9 - this at least ensures all sizing is constant across resolutions.
// I'm picking 16x9 because the 4x3 aspect below gives me squashed subtitles.
//
CGUIFont *subFont = g_fontManager.LoadTTF("__subtitle__", PTH_IC(fontPath), color[g_guiSettings.GetInt("subtitles.color")], 0, g_guiSettings.GetInt("subtitles.height"), g_guiSettings.GetInt("subtitles.style"), 1.0f, 1.0f, PAL_16x9);
#else
// We scale based on PAL4x3 - this at least ensures all sizing is constant across resolutions
CGUIFont *subFont = g_fontManager.LoadTTF("__subtitle__", PTH_IC(fontPath), color[g_guiSettings.GetInt("subtitles.color")], 0, g_guiSettings.GetInt("subtitles.height"), g_guiSettings.GetInt("subtitles.style"), 1.0f, 1.0f, PAL_4x3);
#endif
if (!subFont)
CLog::Log(LOGERROR, "CGUIWindowFullScreen::OnMessage(WINDOW_INIT) - Unable to load subtitle font");
else
m_subsLayout = new CGUITextLayout(subFont, true);
}
else
m_subsLayout = NULL;
return true;
}
case GUI_MSG_WINDOW_DEINIT:
{
CGUIWindow::OnMessage(message);
CGUIDialog *pDialog = (CGUIDialog *)m_gWindowManager.GetWindow(WINDOW_OSD);
if (pDialog) pDialog->Close(true);
FreeResources(true);
CSingleLock lock (g_graphicsContext);
CUtil::RestoreBrightnessContrastGamma();
g_graphicsContext.SetFullScreenVideo(false);
#ifndef HAS_SDL
g_graphicsContext.SetVideoResolution(g_guiSettings.m_LookAndFeelResolution, TRUE);
#endif
lock.Leave();
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update(false);
#endif
//.........这里部分代码省略.........
示例8: OnMessage
bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
// check whether we've come back here from a window during which time we've actually
// stopped playing videos
if (message.GetParam1() == WINDOW_INVALID && !g_application.m_pPlayer->IsPlayingVideo())
{ // why are we here if nothing is playing???
g_windowManager.PreviousWindow();
return true;
}
g_infoManager.SetShowInfo(false);
g_infoManager.SetShowCodec(false);
m_bShowCurrentTime = false;
m_bGroupSelectShow = false;
g_infoManager.SetDisplayAfterSeek(0); // Make sure display after seek is off.
// switch resolution
g_graphicsContext.SetFullScreenVideo(true);
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update();
#endif
// now call the base class to load our windows
CGUIWindow::OnMessage(message);
m_bShowViewModeInfo = false;
return true;
}
case GUI_MSG_WINDOW_DEINIT:
{
CGUIDialog *pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_OSD_TELETEXT);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_SLIDER);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OSD);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_FULLSCREEN_INFO);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_CHANNELS);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_GUIDE);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_DIRECTOR);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_CUTTER);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_SUBTITLES);
if (pDialog) pDialog->Close(true);
CGUIWindow::OnMessage(message);
CSettings::Get().Save();
CSingleLock lock (g_graphicsContext);
g_graphicsContext.SetFullScreenVideo(false);
lock.Leave();
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update();
#endif
return true;
}
case GUI_MSG_CLICKED:
{
unsigned int iControl = message.GetSenderId();
if (iControl == CONTROL_GROUP_CHOOSER && g_PVRManager.IsStarted())
{
// Get the currently selected label of the Select button
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), iControl);
OnMessage(msg);
CStdString strLabel = msg.GetLabel();
CPVRChannelPtr playingChannel;
if (g_PVRManager.GetCurrentChannel(playingChannel))
{
CPVRChannelGroupPtr selectedGroup = g_PVRChannelGroups->Get(playingChannel->IsRadio())->GetByName(strLabel);
if (selectedGroup)
{
g_PVRManager.SetPlayingGroup(selectedGroup);
CLog::Log(LOGDEBUG, "%s - switched to group '%s'", __FUNCTION__, selectedGroup->GroupName().c_str());
if (!selectedGroup->IsGroupMember(*playingChannel))
{
CLog::Log(LOGDEBUG, "%s - channel '%s' is not a member of '%s', switching to channel 1 of the new group",
__FUNCTION__, playingChannel->ChannelName().c_str(), selectedGroup->GroupName().c_str());
CFileItemPtr switchChannel = selectedGroup->GetByChannelNumber(1);
if (switchChannel && switchChannel->HasPVRChannelInfoTag())
g_application.OnAction(CAction(ACTION_CHANNEL_SWITCH, (float) switchChannel->GetPVRChannelInfoTag()->ChannelNumber()));
else
{
CLog::Log(LOGERROR, "%s - cannot find channel '1' in group %s", __FUNCTION__, selectedGroup->GroupName().c_str());
CApplicationMessenger::Get().MediaStop(false);
}
//.........这里部分代码省略.........
示例9: OnMessage
bool CGUIWindowFullScreen::OnMessage(CGUIMessage& message)
{
switch (message.GetMessage())
{
case GUI_MSG_WINDOW_INIT:
{
// check whether we've come back here from a window during which time we've actually
// stopped playing videos
if (message.GetParam1() == WINDOW_INVALID && !g_application.m_pPlayer->IsPlayingVideo())
{ // why are we here if nothing is playing???
g_windowManager.PreviousWindow();
return true;
}
g_infoManager.SetShowInfo(false);
g_infoManager.SetShowCodec(false);
m_bShowCurrentTime = false;
g_infoManager.SetDisplayAfterSeek(0); // Make sure display after seek is off.
// switch resolution
g_graphicsContext.SetFullScreenVideo(true);
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update();
#endif
// now call the base class to load our windows
CGUIWindow::OnMessage(message);
m_bShowViewModeInfo = false;
return true;
}
case GUI_MSG_WINDOW_DEINIT:
{
CGUIDialog *pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_OSD_TELETEXT);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_SLIDER);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_VIDEO_OSD);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_FULLSCREEN_INFO);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_CHANNELS);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_PVR_OSD_GUIDE);
if (pDialog) pDialog->Close(true);
pDialog = (CGUIDialog *)g_windowManager.GetWindow(WINDOW_DIALOG_SUBTITLES);
if (pDialog) pDialog->Close(true);
CGUIWindow::OnMessage(message);
CSettings::Get().Save();
CSingleLock lock (g_graphicsContext);
g_graphicsContext.SetFullScreenVideo(false);
lock.Leave();
#ifdef HAS_VIDEO_PLAYBACK
// make sure renderer is uptospeed
g_renderManager.Update();
g_renderManager.FrameFinish();
#endif
return true;
}
case GUI_MSG_SETFOCUS:
case GUI_MSG_LOSTFOCUS:
if (message.GetSenderId() != WINDOW_FULLSCREEN_VIDEO) return true;
break;
}
return CGUIWindow::OnMessage(message);
}
示例10: OnAction
bool CGUIWindowBoxeeWizardNetwork::OnAction(const CAction &action)
{
int iControl = GetFocusedControlID();
if (action.wID == ACTION_PREVIOUS_MENU || (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_BACK))
{
Close();
}
else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_INTERFACES)
{
ShowWirelessNetworksIfNeeded();
CGUIListContainer *pList = (CGUIListContainer *)GetControl(CONTROL_INTERFACES);
if (pList)
pList->SetSingleSelectedItem();
return true;
}
else if (action.wID == ACTION_MOVE_LEFT && iControl == CONTROL_WIRELESS)
{
ShowInterfaces();
SET_CONTROL_FOCUS(CONTROL_INTERFACES, 0);
CGUIListContainer *pList = (CGUIListContainer *)GetControl(CONTROL_WIRELESS);
if (pList)
pList->SetSingleSelectedItem();
return true;
}
else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_WIRELESS)
{
ShowPasswordIfNeeded();
CGUIListContainer *pList = (CGUIListContainer *)GetControl(CONTROL_WIRELESS);
if (pList)
pList->SetSingleSelectedItem();
return true;
}
else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_PASSWORD)
{
CGUIButtonControl* passwordButton = (CGUIButtonControl*) GetControl(iControl);
CStdString password = passwordButton->GetLabel();
if (CGUIDialogKeyboard::ShowAndGetInput(password, g_localizeStrings.Get(789), false))
{
passwordButton->SetLabel(password);
CONTROL_ENABLE(CONTROL_NEXT);
SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
}
return true;
}
else if (action.wID == ACTION_SELECT_ITEM && iControl == CONTROL_ENC)
{
CGUIButtonControl* encSelectionButton = (CGUIButtonControl*) GetControl(CONTROL_ENC_SELECTION);
CGUIMessage msg(GUI_MSG_ITEM_SELECTED, GetID(), CONTROL_ENC);
OnMessage(msg);
int iItem = msg.GetParam1();
encSelectionButton->SetLabel(ENC_LABELS[iItem]);
SET_CONTROL_HIDDEN(CONTROL_ENC);
if (iItem == ENC_NONE)
{
SET_CONTROL_HIDDEN(CONTROL_PASSWORD_GROUP);
SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
}
else
{
SET_CONTROL_FOCUS(CONTROL_PASSWORD, 0);
}
return true;
}
else if (action.wID == ACTION_MOVE_LEFT && (iControl == CONTROL_ENC_SELECTION || iControl == CONTROL_PASSWORD))
{
SET_CONTROL_HIDDEN(CONTROL_ENC_GROUP);
SET_CONTROL_HIDDEN(CONTROL_PASSWORD_GROUP);
SET_CONTROL_FOCUS(CONTROL_WIRELESS, 0);
return true;
}
else if (action.wID == ACTION_MOVE_DOWN && iControl == CONTROL_ENC_SELECTION)
{
if (GetControl(CONTROL_PASSWORD_GROUP)->IsVisible())
{
SET_CONTROL_FOCUS(CONTROL_PASSWORD, 0);
}
else if (!GetControl(CONTROL_NEXT)->IsDisabled())
{
SET_CONTROL_FOCUS(CONTROL_NEXT, 0);
}
return true;
}
else if (action.wID == ACTION_MOVE_UP && (iControl == CONTROL_NEXT || iControl == CONTROL_BACK))
{
if (GetControl(CONTROL_PASSWORD_GROUP)->IsVisible())
{
SET_CONTROL_FOCUS(CONTROL_PASSWORD, 0);
}
else if (GetControl(CONTROL_ENC_GROUP)->IsVisible())
{
SET_CONTROL_FOCUS(CONTROL_ENC_SELECTION, 0);
}
else
{
//.........这里部分代码省略.........
示例11: ProcessMessage
//.........这里部分代码省略.........
CGUIMessage *msg = (CGUIMessage *)pMsg->lpVoid;
if (msg)
{
CGUIWindow* pWindow = g_windowManager.GetWindow(pMsg->dwParam1);
if (pWindow)
pWindow->OnMessage(*msg);
if (!pMsg->hWaitEvent) // no one waits for this message to return.
delete msg;
}
}
break;
case TMSG_SET_CONTROL_LABEL:
{
CGUIWindow* pWindow = g_windowManager.GetWindow(pMsg->dwParam1);
if (pWindow)
{
CGUIControl *control = (CGUIControl *)pWindow->GetControl(pMsg->dwParam2);
if (control)
{
CGUIMessage msg(GUI_MSG_LABEL_SET, pMsg->dwParam1, pMsg->dwParam2);
msg.SetLabel(pMsg->strParam);
control->OnMessage(msg);
}
}
}
break;
case TMSG_CLOSE_DIALOG:
{
CGUIDialog *dlg = (CGUIDialog *)pMsg->lpVoid;
bool bForce = (bool)pMsg->dwParam1;
if (dlg)
dlg->Close(bForce);
}
break;
case TMSG_PREVIOUS_WINDOW:
{
g_windowManager.PreviousWindow();
}
break;
case TMSG_TOGGLEFULLSCREEN:
{
CAction action;
action.id = ACTION_TOGGLE_FULLSCREEN;
g_application.OnAction(action);
}
break;
case TMSG_FREE_WINDOW_RESOURCES:
{
CGUIWindow *win = (CGUIWindow *)pMsg->lpVoid;
if (win)
win->FreeResources();
}
break;
case TMSG_FREE_TEXTURE:
{
CGUITextureBase *t = (CGUITextureBase *)pMsg->lpVoid;
if (t)
t->FreeResources(!!pMsg->dwParam1);
}