2004-05-17 22:15:10 +00:00
|
|
|
// $Id$
|
|
|
|
//
|
2004-04-10 09:11:03 +00:00
|
|
|
// The contents of this file are subject to the BOINC Public License
|
|
|
|
// Version 1.0 (the "License"); you may not use this file except in
|
|
|
|
// compliance with the License. You may obtain a copy of the License at
|
|
|
|
// http://boinc.berkeley.edu/license_1.0.txt
|
|
|
|
//
|
|
|
|
// Software distributed under the License is distributed on an "AS IS"
|
|
|
|
// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
|
|
|
|
// License for the specific language governing rights and limitations
|
|
|
|
// under the License.
|
|
|
|
//
|
|
|
|
// The Original Code is the Berkeley Open Infrastructure for Network Computing.
|
|
|
|
//
|
|
|
|
// The Initial Developer of the Original Code is the SETI@home project.
|
|
|
|
// Portions created by the SETI@home project are Copyright (C) 2002
|
|
|
|
// University of California at Berkeley. All Rights Reserved.
|
|
|
|
//
|
|
|
|
// Contributor(s):
|
|
|
|
//
|
2004-05-17 22:15:10 +00:00
|
|
|
// Revision History:
|
|
|
|
//
|
|
|
|
// $Log$
|
2004-05-22 01:36:36 +00:00
|
|
|
// Revision 1.11 2004/05/22 01:36:36 rwalton
|
|
|
|
// *** empty log message ***
|
|
|
|
//
|
2004-05-21 06:27:15 +00:00
|
|
|
// Revision 1.10 2004/05/21 06:27:15 rwalton
|
|
|
|
// *** empty log message ***
|
|
|
|
//
|
2004-05-17 22:15:10 +00:00
|
|
|
// Revision 1.9 2004/05/17 22:15:09 rwalton
|
|
|
|
// *** empty log message ***
|
|
|
|
//
|
|
|
|
//
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-04-11 04:37:10 +00:00
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma implementation "MainFrame.h"
|
|
|
|
#endif
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
#include "stdwx.h"
|
2004-04-10 20:25:27 +00:00
|
|
|
#include "BOINCGUIApp.h"
|
|
|
|
#include "MainFrame.h"
|
|
|
|
#include "BaseListCtrlView.h"
|
|
|
|
#include "BaseWindowView.h"
|
|
|
|
#include "MessagesView.h"
|
|
|
|
#include "ProjectsView.h"
|
|
|
|
#include "ResourceUtilizationView.h"
|
|
|
|
#include "TransfersView.h"
|
|
|
|
#include "WorkView.h"
|
|
|
|
#include "DlgAbout.h"
|
2004-04-11 04:12:44 +00:00
|
|
|
#include "DlgOptions.h"
|
2004-04-11 05:09:18 +00:00
|
|
|
#include "DlgAttachProject.h"
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-04-11 04:12:44 +00:00
|
|
|
#include "res/BOINCGUIApp.xpm"
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-04-13 00:33:40 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
IMPLEMENT_DYNAMIC_CLASS(CMainFrame, wxFrame)
|
|
|
|
|
|
|
|
BEGIN_EVENT_TABLE (CMainFrame, wxFrame)
|
2004-04-11 05:09:18 +00:00
|
|
|
EVT_CLOSE ( CMainFrame::OnClose)
|
2004-05-21 06:27:15 +00:00
|
|
|
|
2004-04-11 05:09:18 +00:00
|
|
|
EVT_MENU (wxID_EXIT, CMainFrame::OnExit)
|
|
|
|
EVT_MENU (ID_COMMANDSATTACHPROJECT, CMainFrame::OnCommandsAttachProject)
|
|
|
|
EVT_MENU (ID_TOOLSOPTIONS, CMainFrame::OnToolsOptions)
|
|
|
|
EVT_MENU (wxID_ABOUT, CMainFrame::OnAbout)
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
EVT_TIMER (ID_FRAMERENDERTIMER, CMainFrame::OnFrameRender)
|
|
|
|
END_EVENT_TABLE ()
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
CMainFrame::CMainFrame()
|
|
|
|
{
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::CMainFrame - Function Begining");
|
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::CMainFrame - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CMainFrame::CMainFrame(wxString strTitle) :
|
|
|
|
wxFrame ((wxFrame *)NULL, -1, strTitle, wxDefaultPosition, wxDefaultSize,
|
|
|
|
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
|
|
|
|
{
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::CMainFrame - Function Begining");
|
|
|
|
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
m_pMenubar = NULL;
|
|
|
|
m_pNotebook = NULL;
|
|
|
|
m_pStatusbar = NULL;
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
SetIcon(wxICON(APP_ICON));
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
wxCHECK_RET(CreateMenu(), _T("Failed to create menu bar."));
|
|
|
|
wxCHECK_RET(CreateNotebook(), _T("Failed to create notebook."));
|
|
|
|
wxCHECK_RET(CreateStatusbar(), _T("Failed to create status bar."));
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
m_pFrameRenderTimer = new wxTimer(this, ID_FRAMERENDERTIMER);
|
|
|
|
wxASSERT(NULL != m_pFrameRenderTimer);
|
|
|
|
|
|
|
|
m_pFrameRenderTimer->Start(1000); // Send event every second
|
|
|
|
|
|
|
|
|
2004-05-22 01:36:36 +00:00
|
|
|
RestoreState();
|
|
|
|
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::CMainFrame - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
CMainFrame::~CMainFrame(){
|
|
|
|
wxLogTrace("CMainFrame::~CMainFrame - Function Begining");
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
wxASSERT(NULL != m_pFrameRenderTimer);
|
|
|
|
wxASSERT(NULL != m_pMenubar);
|
|
|
|
wxASSERT(NULL != m_pNotebook);
|
|
|
|
wxASSERT(NULL != m_pStatusbar);
|
|
|
|
|
|
|
|
|
2004-05-22 01:36:36 +00:00
|
|
|
SaveState();
|
|
|
|
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
if (m_pFrameRenderTimer) {
|
|
|
|
m_pFrameRenderTimer->Stop();
|
|
|
|
delete m_pFrameRenderTimer;
|
|
|
|
}
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
if (m_pStatusbar)
|
|
|
|
wxCHECK_RET(DeleteStatusbar(), _T("Failed to delete status bar."));
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
if (m_pNotebook)
|
|
|
|
wxCHECK_RET(DeleteNotebook(), _T("Failed to delete notebook."));
|
|
|
|
|
|
|
|
if (m_pMenubar)
|
|
|
|
wxCHECK_RET(DeleteMenu(), _T("Failed to delete menu bar."));
|
|
|
|
|
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::~CMainFrame - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CMainFrame::CreateMenu() {
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::CreateMenu - Function Begining");
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
// File menu
|
|
|
|
wxMenu *menuFile = new wxMenu;
|
|
|
|
menuFile->Append(wxID_EXIT, _("E&xit"));
|
|
|
|
|
|
|
|
// Commands menu
|
|
|
|
wxMenu *menuCommands = new wxMenu;
|
2004-04-11 05:09:18 +00:00
|
|
|
menuCommands->Append(ID_COMMANDSATTACHPROJECT, _("&Attach to Project..."));
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
// Tools menu
|
|
|
|
wxMenu *menuTools = new wxMenu;
|
2004-04-11 04:12:44 +00:00
|
|
|
menuTools->Append(ID_TOOLSOPTIONS, _("&Options"));
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
// Help menu
|
|
|
|
wxMenu *menuHelp = new wxMenu;
|
|
|
|
menuHelp->Append(wxID_ABOUT, _("&About BOINC..."));
|
|
|
|
|
|
|
|
// construct menu
|
|
|
|
m_pMenubar = new wxMenuBar;
|
|
|
|
m_pMenubar->Append(menuFile, _("&File"));
|
|
|
|
m_pMenubar->Append(menuCommands, _("&Commands"));
|
|
|
|
m_pMenubar->Append(menuTools, _("&Tools"));
|
|
|
|
m_pMenubar->Append(menuHelp, _("&Help"));
|
|
|
|
SetMenuBar(m_pMenubar);
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::CreateMenu - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CMainFrame::CreateNotebook() {
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::CreateNotebook - Function Begining");
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
// create frame panel
|
|
|
|
wxPanel *pPanel = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize,
|
|
|
|
wxTAB_TRAVERSAL|wxCLIP_CHILDREN|wxNO_BORDER);
|
|
|
|
|
|
|
|
// initialize notebook
|
|
|
|
m_pNotebook = new wxNotebook(pPanel, -1, wxDefaultPosition, wxDefaultSize,
|
|
|
|
wxNB_FIXEDWIDTH|wxCLIP_CHILDREN);
|
|
|
|
|
|
|
|
wxNotebookSizer *pNotebookSizer = new wxNotebookSizer(m_pNotebook);
|
|
|
|
|
|
|
|
// layout frame panel
|
|
|
|
wxBoxSizer *pPanelSizer = new wxBoxSizer(wxVERTICAL);
|
|
|
|
pPanelSizer->Add(new wxStaticLine(pPanel, -1), 0, wxEXPAND);
|
|
|
|
pPanelSizer->Add(0, 4);
|
|
|
|
pPanelSizer->Add(pNotebookSizer, 1, wxEXPAND);
|
2004-04-13 00:33:40 +00:00
|
|
|
pPanel->SetAutoLayout(true);
|
2004-04-10 09:11:03 +00:00
|
|
|
pPanel->SetSizerAndFit(pPanelSizer);
|
|
|
|
|
|
|
|
CreateNotebookPage(new CProjectsView(m_pNotebook));
|
|
|
|
CreateNotebookPage(new CWorkView(m_pNotebook));
|
|
|
|
CreateNotebookPage(new CTransfersView(m_pNotebook));
|
|
|
|
CreateNotebookPage(new CMessagesView(m_pNotebook));
|
|
|
|
CreateNotebookPage(new CResourceUtilizationView(m_pNotebook));
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::CreateNotebook - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CMainFrame::CreateNotebookPage(wxWindow* pwndNewNotebookPage) {
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::CreateNotebookPage - Function Begining");
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-04-13 00:33:40 +00:00
|
|
|
wxImageList* pImageList;
|
|
|
|
int iImageIndex = 0;
|
|
|
|
|
2004-04-13 02:06:27 +00:00
|
|
|
wxASSERT(NULL != pwndNewNotebookPage);
|
|
|
|
wxASSERT(NULL != m_pNotebook);
|
2004-05-21 06:27:15 +00:00
|
|
|
wxASSERT(wxDynamicCast(pwndNewNotebookPage, CBaseListCtrlView) ||
|
|
|
|
wxDynamicCast(pwndNewNotebookPage, CBaseWindowView));
|
2004-04-10 09:11:03 +00:00
|
|
|
|
2004-04-13 00:33:40 +00:00
|
|
|
|
|
|
|
pImageList = m_pNotebook->GetImageList();
|
|
|
|
if (!pImageList) {
|
|
|
|
pImageList = new wxImageList(16, 16, true, 0);
|
|
|
|
wxASSERT(pImageList != NULL);
|
2004-04-13 02:06:27 +00:00
|
|
|
m_pNotebook->SetImageList(pImageList);
|
2004-04-13 00:33:40 +00:00
|
|
|
}
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
if (wxDynamicCast(pwndNewNotebookPage, CProjectsView)) {
|
2004-04-13 00:33:40 +00:00
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
CProjectsView* pPage = wxDynamicCast(pwndNewNotebookPage, CProjectsView);
|
|
|
|
iImageIndex = pImageList->Add(wxBitmap(pPage->GetViewIcon()), wxColour(255, 0, 255));
|
|
|
|
m_pNotebook->AddPage(pPage, pPage->GetViewName(), TRUE, iImageIndex);
|
2004-04-13 00:33:40 +00:00
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
} else if (wxDynamicCast(pwndNewNotebookPage, CWorkView)) {
|
|
|
|
|
|
|
|
CWorkView* pPage = wxDynamicCast(pwndNewNotebookPage, CWorkView);
|
2004-04-13 02:06:27 +00:00
|
|
|
iImageIndex = pImageList->Add(wxBitmap(pPage->GetViewIcon()), wxColour(255, 0, 255));
|
2004-04-13 00:33:40 +00:00
|
|
|
m_pNotebook->AddPage(pPage, pPage->GetViewName(), TRUE, iImageIndex);
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
} else if (wxDynamicCast(pwndNewNotebookPage, CTransfersView)) {
|
2004-04-13 00:33:40 +00:00
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
CTransfersView* pPage = wxDynamicCast(pwndNewNotebookPage, CTransfersView);
|
|
|
|
iImageIndex = pImageList->Add(wxBitmap(pPage->GetViewIcon()), wxColour(255, 0, 255));
|
|
|
|
m_pNotebook->AddPage(pPage, pPage->GetViewName(), TRUE, iImageIndex);
|
|
|
|
|
|
|
|
} else if (wxDynamicCast(pwndNewNotebookPage, CMessagesView)) {
|
|
|
|
|
|
|
|
CMessagesView* pPage = wxDynamicCast(pwndNewNotebookPage, CMessagesView);
|
|
|
|
iImageIndex = pImageList->Add(wxBitmap(pPage->GetViewIcon()), wxColour(255, 0, 255));
|
|
|
|
m_pNotebook->AddPage(pPage, pPage->GetViewName(), TRUE, iImageIndex);
|
|
|
|
|
|
|
|
} else if (wxDynamicCast(pwndNewNotebookPage, CResourceUtilizationView)) {
|
2004-04-13 00:33:40 +00:00
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
CResourceUtilizationView* pPage = wxDynamicCast(pwndNewNotebookPage, CResourceUtilizationView);
|
|
|
|
iImageIndex = pImageList->Add(wxBitmap(pPage->GetViewIcon()), wxColour(255, 0, 255));
|
|
|
|
m_pNotebook->AddPage(pPage, pPage->GetViewName(), TRUE, iImageIndex);
|
2004-04-13 00:33:40 +00:00
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
} else if (wxDynamicCast(pwndNewNotebookPage, CBaseListCtrlView)) {
|
|
|
|
|
|
|
|
CBaseListCtrlView* pPage = wxDynamicCast(pwndNewNotebookPage, CBaseListCtrlView);
|
|
|
|
iImageIndex = pImageList->Add(wxBitmap(pPage->GetViewIcon()), wxColour(255, 0, 255));
|
|
|
|
m_pNotebook->AddPage(pPage, pPage->GetViewName(), TRUE, iImageIndex);
|
|
|
|
|
|
|
|
} else if (wxDynamicCast(pwndNewNotebookPage, CBaseWindowView)) {
|
|
|
|
|
|
|
|
CBaseWindowView* pPage = wxDynamicCast(pwndNewNotebookPage, CBaseWindowView);
|
|
|
|
iImageIndex = pImageList->Add(wxBitmap(pPage->GetViewIcon()), wxColour(255, 0, 255));
|
|
|
|
m_pNotebook->AddPage(pPage, pPage->GetViewName(), TRUE, iImageIndex);
|
2004-04-13 00:33:40 +00:00
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::CreateNotebookPage - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CMainFrame::CreateStatusbar() {
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::CreateStatusbar - Function Begining");
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
if (m_pStatusbar)
|
|
|
|
return true;
|
|
|
|
|
|
|
|
int ch = GetCharWidth();
|
|
|
|
|
|
|
|
const int widths[] = {-1, 20*ch, 15};
|
|
|
|
|
|
|
|
m_pStatusbar = CreateStatusBar(WXSIZEOF(widths), wxST_SIZEGRIP, ID_STATUSBAR);
|
2004-05-21 06:27:15 +00:00
|
|
|
wxASSERT(NULL != m_pStatusbar);
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
m_pStatusbar->SetStatusWidths(WXSIZEOF(widths), widths);
|
|
|
|
|
|
|
|
SetStatusBar(m_pStatusbar);
|
|
|
|
SendSizeEvent();
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::CreateStatusbar - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CMainFrame::DeleteMenu() {
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::DeleteMenu - Function Begining");
|
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::DeleteMenu - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CMainFrame::DeleteNotebook() {
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::DeleteNotebook - Function Begining");
|
|
|
|
|
2004-04-13 00:33:40 +00:00
|
|
|
|
|
|
|
wxImageList* pImageList;
|
|
|
|
|
2004-04-13 02:18:03 +00:00
|
|
|
wxASSERT(NULL != m_pNotebook);
|
|
|
|
|
2004-04-13 00:33:40 +00:00
|
|
|
pImageList = m_pNotebook->GetImageList();
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
wxASSERT(NULL != pImageList);
|
|
|
|
|
2004-04-13 00:33:40 +00:00
|
|
|
if (pImageList)
|
|
|
|
delete pImageList;
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::DeleteNotebook - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool CMainFrame::DeleteStatusbar() {
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::DeleteStatusbar - Function Begining");
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
if (!m_pStatusbar)
|
|
|
|
return true;
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
SetStatusBar(NULL);
|
2004-04-10 09:11:03 +00:00
|
|
|
|
|
|
|
delete m_pStatusbar;
|
|
|
|
|
|
|
|
m_pStatusbar = NULL;
|
|
|
|
SendSizeEvent();
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::DeleteStatusbar - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
bool CMainFrame::SaveState() {
|
|
|
|
wxLogTrace("CMainFrame::SaveState - Function Begining");
|
2004-04-10 20:25:27 +00:00
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::DeleteStatusbar - Function Ending");
|
|
|
|
return true;
|
|
|
|
}
|
2004-04-10 20:25:27 +00:00
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
bool CMainFrame::RestoreState() {
|
|
|
|
wxLogTrace("CMainFrame::RestoreState - Function Begining");
|
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::RestoreState - Function Ending");
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CMainFrame::OnExit(wxCommandEvent &WXUNUSED(event)) {
|
|
|
|
wxLogTrace("CMainFrame::OnExit - Function Begining");
|
|
|
|
|
|
|
|
Close(true);
|
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::OnExit - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void CMainFrame::OnClose(wxCloseEvent &event) {
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::OnClose - Function Begining");
|
|
|
|
|
2004-04-10 09:11:03 +00:00
|
|
|
Destroy();
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::OnClose - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-04-11 05:09:18 +00:00
|
|
|
void CMainFrame::OnCommandsAttachProject(wxCommandEvent &WXUNUSED(event)) {
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::OnCommandsAttachProject - Function Begining");
|
|
|
|
|
|
|
|
|
2004-04-11 05:09:18 +00:00
|
|
|
CDlgAttachProject* pDlg = new CDlgAttachProject(this);
|
2004-05-21 06:27:15 +00:00
|
|
|
wxASSERT(NULL != pDlg);
|
2004-04-11 05:09:18 +00:00
|
|
|
|
|
|
|
pDlg->ShowModal();
|
|
|
|
|
|
|
|
if (pDlg)
|
|
|
|
delete pDlg;
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::OnCommandsAttachProject - Function Ending");
|
2004-04-11 05:09:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-04-11 04:12:44 +00:00
|
|
|
void CMainFrame::OnToolsOptions(wxCommandEvent &WXUNUSED(event)) {
|
2004-05-21 06:27:15 +00:00
|
|
|
wxLogTrace("CMainFrame::OnToolsOptions - Function Begining");
|
|
|
|
|
|
|
|
|
2004-04-11 04:12:44 +00:00
|
|
|
CDlgOptions* pDlg = new CDlgOptions(this);
|
2004-05-21 06:27:15 +00:00
|
|
|
wxASSERT(NULL != pDlg);
|
2004-04-11 04:12:44 +00:00
|
|
|
|
|
|
|
pDlg->ShowModal();
|
|
|
|
|
|
|
|
if (pDlg)
|
|
|
|
delete pDlg;
|
2004-05-21 06:27:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::OnToolsOptions - Function Ending");
|
2004-04-11 04:12:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
void CMainFrame::OnAbout(wxCommandEvent &WXUNUSED(event)) {
|
|
|
|
wxLogTrace("CMainFrame::OnAbout - Function Begining");
|
|
|
|
|
|
|
|
|
|
|
|
CDlgAbout* pDlg = new CDlgAbout(this);
|
|
|
|
wxASSERT(NULL != pDlg);
|
|
|
|
|
|
|
|
pDlg->ShowModal();
|
|
|
|
|
|
|
|
if (pDlg)
|
|
|
|
delete pDlg;
|
|
|
|
|
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::OnAbout - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2004-05-21 06:27:15 +00:00
|
|
|
void CMainFrame::OnFrameRender (wxTimerEvent &event) {
|
|
|
|
wxLogTrace("CMainFrame::OnFrameRender - Function Begining");
|
|
|
|
|
|
|
|
wxWindow* pwndCurrentlySelectedPage;
|
|
|
|
|
|
|
|
wxASSERT(NULL != m_pNotebook);
|
|
|
|
|
|
|
|
|
|
|
|
pwndCurrentlySelectedPage = m_pNotebook->GetPage(m_pNotebook->GetSelection());
|
|
|
|
wxASSERT(NULL != pwndCurrentlySelectedPage);
|
|
|
|
wxASSERT(wxDynamicCast(pwndCurrentlySelectedPage, CBaseListCtrlView) ||
|
|
|
|
wxDynamicCast(pwndCurrentlySelectedPage, CBaseWindowView));
|
|
|
|
|
|
|
|
|
|
|
|
if (wxDynamicCast(pwndCurrentlySelectedPage, CProjectsView)) {
|
|
|
|
|
|
|
|
CProjectsView* pPage = wxDynamicCast(pwndCurrentlySelectedPage, CProjectsView);
|
|
|
|
pPage->OnRender(event);
|
|
|
|
|
|
|
|
} else if (wxDynamicCast(pwndCurrentlySelectedPage, CWorkView)) {
|
|
|
|
|
|
|
|
CWorkView* pPage = wxDynamicCast(pwndCurrentlySelectedPage, CWorkView);
|
|
|
|
pPage->OnRender(event);
|
|
|
|
|
|
|
|
} else if (wxDynamicCast(pwndCurrentlySelectedPage, CTransfersView)) {
|
|
|
|
|
|
|
|
CTransfersView* pPage = wxDynamicCast(pwndCurrentlySelectedPage, CTransfersView);
|
|
|
|
pPage->OnRender(event);
|
|
|
|
|
|
|
|
} else if (wxDynamicCast(pwndCurrentlySelectedPage, CMessagesView)) {
|
|
|
|
|
|
|
|
CMessagesView* pPage = wxDynamicCast(pwndCurrentlySelectedPage, CMessagesView);
|
|
|
|
pPage->OnRender(event);
|
|
|
|
|
|
|
|
} else if (wxDynamicCast(pwndCurrentlySelectedPage, CResourceUtilizationView)) {
|
|
|
|
|
|
|
|
CResourceUtilizationView* pPage = wxDynamicCast(pwndCurrentlySelectedPage, CResourceUtilizationView);
|
|
|
|
pPage->OnRender(event);
|
|
|
|
|
|
|
|
} else if (wxDynamicCast(pwndCurrentlySelectedPage, CBaseListCtrlView)) {
|
|
|
|
|
|
|
|
CBaseListCtrlView* pPage = wxDynamicCast(pwndCurrentlySelectedPage, CBaseListCtrlView);
|
|
|
|
pPage->OnRender(event);
|
|
|
|
|
|
|
|
} else if (wxDynamicCast(pwndCurrentlySelectedPage, CBaseWindowView)) {
|
|
|
|
|
|
|
|
CBaseWindowView* pPage = wxDynamicCast(pwndCurrentlySelectedPage, CBaseWindowView);
|
|
|
|
pPage->OnRender(event);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wxLogTrace("CMainFrame::OnFrameRender - Function Ending");
|
2004-04-10 09:11:03 +00:00
|
|
|
}
|
|
|
|
|