- MGR: Fix show / hide on Mac broken by previous changes

svn path=/trunk/boinc/; revision=16361
This commit is contained in:
Charlie Fenton 2008-10-30 09:14:33 +00:00
parent 42e6166a9d
commit 5a78a07094
4 changed files with 22 additions and 14 deletions

View File

@ -8894,3 +8894,10 @@ Rom & Charlie 29 Oct 2008
BOINCx64.ism
win_build/
sim.vcproj
Charlie 30 Oct 2008
- MGR: Fix show / hide on Mac broken by previous changes.
clientgui/
BOINCBaseFrame.cpp, .h
BOINCGUIApp.cpp

View File

@ -757,7 +757,7 @@ bool CBOINCBaseFrame::RestoreState() {
return true;
}
/*
bool CBOINCBaseFrame::Show(bool bShow) {
if (bShow) {
wxGetApp().ShowApplication(true);
@ -768,9 +768,8 @@ bool CBOINCBaseFrame::Show(bool bShow) {
}
}
}
return wxFrame::Show(show);
return wxFrame::Show(bShow);
}
*/
int CBOINCBaseFrame::_GetCurrentViewPage() {

View File

@ -91,7 +91,7 @@ public:
void ExecuteBrowserLink( const wxString& strLink );
//bool Show( bool bShow = true );
bool Show( bool bShow = true );
protected:

View File

@ -746,6 +746,7 @@ void CBOINCGUIApp::FireReloadSkin() {
bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) {
CBOINCBaseFrame* pNewFrame = NULL;
CBOINCBaseFrame* pOldFrame = m_pFrame;
// Create the new window
if ((iGUISelection != m_iGUISelected) || !m_pFrame) {
@ -774,18 +775,18 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) {
if (pNewFrame) {
SetTopWindow(pNewFrame);
// Store the new frame for future use
m_pFrame = pNewFrame;
// Hide the old one if it exists
if (m_pFrame) m_pFrame->Hide();
if (pOldFrame) pOldFrame->Hide();
// Show the new frame if needed, and prevent Mac OSX from
// hiding the application
if (pNewFrame && bShowWindow) pNewFrame->Show();
// Delete the old one if it exists
if (m_pFrame) m_pFrame->Destroy();
// Store the new frame for future use
m_pFrame = pNewFrame;
if (pOldFrame) pOldFrame->Destroy();
}
}
@ -889,18 +890,19 @@ bool CBOINCGUIApp::IsApplicationVisible() {
/// @param bShow
/// true will show the process, false will hide the process.
///
#ifdef __WXMAC__
void CBOINCGUIApp::ShowApplication(bool bShow) {
#ifndef __WXMAC__
bool b = bShow;
b = true;
#else
if (bShow) {
SetFrontProcess(&m_psnCurrentProcess);
} else {
ShowHideProcess(&m_psnCurrentProcess, false);
}
#endif
}
#else
void CBOINCGUIApp::ShowApplication(bool) {
}
#endif
bool CBOINCGUIApp::IsModalDialogDisplayed() {
if (m_bSafeMessageBoxDisplayed) return true;