mirror of https://github.com/BOINC/boinc.git
*** empty log message ***
svn path=/trunk/boinc/; revision=11396
This commit is contained in:
parent
d5a0931c1f
commit
596f7343cb
|
@ -11757,3 +11757,12 @@ Rom 29 Oct 2006
|
|||
sg_ProjectsComponent.cpp, .h
|
||||
sg_StatImageLoader.cpp, .h
|
||||
SkinManager.cpp
|
||||
|
||||
Charlie 29 Oct 2006
|
||||
- Mac: fix some Mac-specific Simple GUI bugs.
|
||||
|
||||
clientgui/
|
||||
AdvancedFrame.cpp, h
|
||||
BOINCBaseFrame.cpp, .h
|
||||
BOINCGUIApp.cpp, .h
|
||||
sg_BoincSimpleGUI.cpp
|
||||
|
|
|
@ -1927,24 +1927,4 @@ void CAdvancedFrame::UpdateNetworkModeControls( CC_STATUS& status ) {
|
|||
}
|
||||
|
||||
|
||||
#ifdef __WXMAC__
|
||||
|
||||
bool CAdvancedFrame::Show(bool show) {
|
||||
ProcessSerialNumber psn;
|
||||
|
||||
GetCurrentProcess(&psn);
|
||||
if (show) {
|
||||
SetFrontProcess(&psn); // Shows process if hidden
|
||||
} else {
|
||||
GetWindowDimensions();
|
||||
if (IsProcessVisible(&psn))
|
||||
ShowHideProcess(&psn, false);
|
||||
}
|
||||
|
||||
return wxFrame::Show(show);
|
||||
}
|
||||
|
||||
#endif // __WXMAC__
|
||||
|
||||
|
||||
const char *BOINC_RCSID_d881a56dc5 = "$Id$";
|
||||
|
|
|
@ -100,10 +100,6 @@ public:
|
|||
// relevent code in OnPageChanged function
|
||||
// and the base/statistics view.
|
||||
|
||||
#ifdef __WXMAC__
|
||||
bool Show( bool show = true );
|
||||
#endif
|
||||
|
||||
wxTimer* m_pRefreshStateTimer;
|
||||
wxTimer* m_pFrameRenderTimer;
|
||||
wxTimer* m_pFrameListPanelRenderTimer;
|
||||
|
|
|
@ -554,6 +554,26 @@ bool CBOINCBaseFrame::RestoreState() {
|
|||
}
|
||||
|
||||
|
||||
#ifdef __WXMAC__
|
||||
bool CBOINCBaseFrame::Show(bool show) {
|
||||
ProcessSerialNumber psn;
|
||||
|
||||
GetCurrentProcess(&psn);
|
||||
if (show) {
|
||||
SetFrontProcess(&psn); // Shows process if hidden
|
||||
} else {
|
||||
// GetWindowDimensions();
|
||||
if (wxGetApp().GetCurrentGUISelection() == m_windowType)
|
||||
if (IsProcessVisible(&psn))
|
||||
ShowHideProcess(&psn, false);
|
||||
}
|
||||
|
||||
return wxFrame::Show(show);
|
||||
}
|
||||
|
||||
#endif // __WXMAC__
|
||||
|
||||
|
||||
void CFrameAlertEvent::ProcessResponse(const int response) const {
|
||||
CMainDocument* pDoc = wxGetApp().GetDocument();
|
||||
|
||||
|
|
|
@ -82,6 +82,11 @@ public:
|
|||
|
||||
void ExecuteBrowserLink( const wxString& strLink );
|
||||
|
||||
#ifdef __WXMAC__
|
||||
bool Show( bool show = true );
|
||||
int m_windowType; // BOINC_SIMPLEGUI or BOINC_ADVANCEDGUI
|
||||
#endif
|
||||
|
||||
protected:
|
||||
|
||||
CBOINCDialUpManager* m_pDialupManager;
|
||||
|
|
|
@ -942,6 +942,11 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) {
|
|||
if (pNewFrame) {
|
||||
SetTopWindow(pNewFrame);
|
||||
|
||||
#ifdef __WXMAC__
|
||||
// So closing old view doesn't hide application
|
||||
pNewFrame->m_windowType = iGUISelection;
|
||||
m_iGUISelected = iGUISelection;
|
||||
#endif
|
||||
// Delete the old one if it exists
|
||||
if (m_pFrame) m_pFrame->Destroy();
|
||||
|
||||
|
@ -949,7 +954,7 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) {
|
|||
m_pFrame = pNewFrame;
|
||||
}
|
||||
}
|
||||
#else
|
||||
#else // ifndef SIMPLEGUI
|
||||
if (!m_pFrame) {
|
||||
// Initialize the advanced gui window
|
||||
iGUISelection = BOINC_ADVANCEDGUI;
|
||||
|
|
|
@ -113,6 +113,7 @@ public:
|
|||
#endif
|
||||
#ifdef __WXMAC__
|
||||
CMacSystemMenu* GetMacSystemMenu() { return m_pMacSystemMenu; }
|
||||
int GetCurrentGUISelection() { return m_iGUISelected; }
|
||||
#endif
|
||||
|
||||
wxArrayString& GetSupportedLanguages() { return m_astrLanguages; }
|
||||
|
|
|
@ -136,6 +136,30 @@ bool CSimpleFrame::RestoreState() {
|
|||
int x = pConfig->Read(wxT("X_Position"), ((wxPoint) wxDefaultPosition).x);
|
||||
int y = pConfig->Read(wxT("Y_Position"), ((wxPoint) wxDefaultPosition).y);
|
||||
|
||||
// Read the size of the BSG
|
||||
int width, height;
|
||||
GetSize(&width, &height);
|
||||
|
||||
#ifdef __WXMAC__
|
||||
|
||||
// If the user has changed the arrangement of multiple
|
||||
// displays, make sure the window title bar is still on-screen.
|
||||
Rect titleRect = {y, x, y+22, x+width };
|
||||
InsetRect(&titleRect, 5, 5); // Make sure at least a 5X5 piece visible
|
||||
RgnHandle displayRgn = NewRgn();
|
||||
CopyRgn(GetGrayRgn(), displayRgn); // Region encompassing all displays
|
||||
Rect menuRect = ((**GetMainDevice())).gdRect;
|
||||
menuRect.bottom = GetMBarHeight() + menuRect.top;
|
||||
RgnHandle menuRgn = NewRgn();
|
||||
RectRgn(menuRgn, &menuRect); // Region hidden by menu bar
|
||||
DiffRgn(displayRgn, menuRgn, displayRgn); // Subtract menu bar retion
|
||||
if (!RectInRgn(&titleRect, displayRgn))
|
||||
x = y = 30;
|
||||
DisposeRgn(menuRgn);
|
||||
DisposeRgn(displayRgn);
|
||||
|
||||
#else
|
||||
|
||||
// If either co-ordinate is less then 0 then set it equal to 0 to ensure
|
||||
// it displays on the screen.
|
||||
if ( x < 0 ) x = 0;
|
||||
|
@ -145,16 +169,12 @@ bool CSimpleFrame::RestoreState() {
|
|||
int maxX = wxSystemSettings::GetMetric( wxSYS_SCREEN_X );
|
||||
int maxY = wxSystemSettings::GetMetric( wxSYS_SCREEN_Y );
|
||||
|
||||
// Read the size of the BSG
|
||||
int width, height;
|
||||
GetSize(&width, &height);
|
||||
|
||||
// Max sure that it doesn't go off to the right or bottom
|
||||
if ( x + width > maxX ) x=maxX-width;
|
||||
if ( y + height > maxY ) y=maxY-height;
|
||||
#endif
|
||||
|
||||
Move(x,y);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue