*** empty log message ***

svn path=/trunk/boinc/; revision=9901
This commit is contained in:
Charlie Fenton 2006-04-14 11:27:37 +00:00
parent cff3b0e63a
commit e3f857336f
4 changed files with 49 additions and 12 deletions

View File

@ -3828,6 +3828,10 @@ Charlie 14 Apr 2006
CMainFrame::OnShow() into new method CMainFrame::GetWindowDimensions().
Call GetWindowDimensions() from CMainFrame::OnShow() and also from
Mac-only method CMainFrame::Show().
- Mac: Fix compile errors due to xpm files.
- Save main window dimensions on Hide so SaveState can write them even
if the window is hidden before application exit.
clientgui/
BOINCGUIApp.cpp
MainFrame.cpp, .h

View File

@ -38,13 +38,10 @@
#ifdef __APPLE__
#include "res/boinc_mac.xpm"
#include "res/gridrepublic_mac.xpm"
#endif
#else
#include "res/boinc.xpm"
#include "res/boincsm.xpm"
#include "res/gridrepublic16.xpm"
#include "res/gridrepublic32.xpm"
#include "res/gridrepublicamwizard.xpm"
#include "res/cpdnbbc16.xpm"
#include "res/cpdnbbc32.xpm"
#include "res/cpdnbbcapwizard.xpm"
@ -52,6 +49,9 @@
#include "res/seed32.xpm"
#include "res/seedamwizard.xpm"
#include "res/seedapwizard.xpm"
#endif
#include "res/boincsm.xpm"
#include "res/gridrepublicamwizard.xpm"
////@end XPM images

View File

@ -205,6 +205,11 @@ CMainFrame::CMainFrame(wxString title, wxIcon* icon) :
m_iReminderFrequency = 0;
m_iDisplayExitWarning = 1;
m_Top = 30;
m_Left = 30;
m_Width = 800;
m_Height = 600;
m_strNetworkDialupConnectionName = wxEmptyString;
@ -726,15 +731,21 @@ bool CMainFrame::SaveState() {
#if defined(__WXMSW__) || defined(__WXMAC__)
pConfig->Write(wxT("WindowMaximized"), IsMaximized());
#endif
if (!IsIconized() && !IsMaximized()) {
pConfig->Write(wxT("Width"), GetSize().GetWidth());
pConfig->Write(wxT("Height"), GetSize().GetHeight());
#ifdef __WXMAC__
pConfig->Write(wxT("XPos"),GetPosition().x);
pConfig->Write(wxT("YPos"), GetPosition().y);
#endif
m_Width = GetSize().GetWidth();
m_Height = GetSize().GetHeight();
m_Left = GetPosition().x;
m_Top = GetPosition().y;
}
pConfig->Write(wxT("Width"), m_Width);
pConfig->Write(wxT("Height"), m_Height);
#ifdef __WXMAC__
pConfig->Write(wxT("XPos"), m_Left);
pConfig->Write(wxT("YPos"), m_Top);
#endif
//
// Save Page(s) State
@ -1502,14 +1513,28 @@ void CMainFrame::OnShow(wxShowEvent& event) {
wxLogTrace(wxT("Function Start/End"), wxT("CMainFrame::OnShow - Function Begin"));
if (event.GetShow())
SetWindowDimensions();
else
GetWindowDimensions();
event.Skip();
wxLogTrace(wxT("Function Start/End"), wxT("CMainFrame::OnShow - Function End"));
}
void CMainFrame::GetWindowDimensions() {
if (!IsIconized() && !IsMaximized()) {
#ifdef __WXMAC__
m_Top = GetPosition().y;
m_Left = GetPosition().x;
#endif
m_Width = GetSize().GetWidth();
m_Height = GetSize().GetHeight();
}
}
void CMainFrame::SetWindowDimensions() {
static bool bFirstTime = true;
if (bFirstTime) {
@ -2155,10 +2180,12 @@ bool CMainFrame::Show(bool show) {
GetCurrentProcess(&psn);
if (show) {
SetFrontProcess(&psn); // Shows process if hidden
SetWindowDimensions();
} else {
GetWindowDimensions();
} else
if (IsProcessVisible(&psn))
ShowHideProcess(&psn, false);
}
return wxFrame::Show(show);
}

View File

@ -88,6 +88,7 @@ public:
void OnClose( wxCloseEvent& event );
void OnShow( wxShowEvent& event );
void SetWindowDimensions();
void GetWindowDimensions();
void OnRefreshState( wxTimerEvent& event );
@ -158,6 +159,11 @@ private:
wxArrayString m_aSelectedComputerMRU;
long m_Top;
long m_Left;
long m_Height;
long m_Width;
bool CreateMenu();
bool DeleteMenu();