*** empty log message ***

svn path=/trunk/boinc/; revision=3254
This commit is contained in:
Rom Walton 2004-04-13 00:33:40 +00:00
parent 0d96c9ef2b
commit c96d1ee152
21 changed files with 185 additions and 27 deletions

View File

@ -247,6 +247,9 @@
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;xrc"
UniqueIdentifier="{08DB1F42-8D4B-491a-870C-2A991D5ED0DB}">
<File
RelativePath=".\res\boinc.xpm">
</File>
<File
RelativePath=".\res\BOINCGUIApp.ico">
</File>

View File

@ -94,7 +94,8 @@ bool CBOINCGUIApp::OnCmdLineParsed(wxCmdLineParser &parser)
wxDefaultPosition
);
pDlg->ShowModal();
if (pDlg)
pDlg->ShowModal();
return false;
} else {

View File

@ -41,6 +41,28 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
/////////////////////////////////////////////////////////////////////////////
//
// Cursor
//
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//

View File

@ -23,6 +23,7 @@
#include "stdwx.h"
#include "BaseListCtrlView.h"
#include "res/boinc.xpm"
IMPLEMENT_DYNAMIC_CLASS(CBaseListCtrlView, wxListCtrl)
@ -52,3 +53,12 @@ wxString CBaseListCtrlView::GetViewName(void)
return wxString(_T("Undefined"));
}
// The user friendly icon of the view.
// If it has not been defined by the view the BOINC icon is returned.
//
char** CBaseListCtrlView::GetViewIcon(void)
{
return boinc_xpm;
}

View File

@ -36,6 +36,7 @@ public:
~CBaseListCtrlView(void);
virtual wxString GetViewName(void);
virtual char** GetViewIcon(void);
};

View File

@ -23,6 +23,7 @@
#include "stdwx.h"
#include "BaseWindowView.h"
#include "res/boinc.xpm"
IMPLEMENT_DYNAMIC_CLASS(CBaseWindowView, wxPanel)
@ -52,3 +53,12 @@ wxString CBaseWindowView::GetViewName(void)
return wxString(_T("Undefined"));
}
// The user friendly icon of the view.
// If it has not been defined by the view the BOINC icon is returned.
//
char** CBaseWindowView::GetViewIcon(void)
{
return boinc_xpm;
}

View File

@ -36,6 +36,7 @@ public:
~CBaseWindowView(void);
virtual wxString GetViewName(void);
virtual char** GetViewIcon(void);
};

View File

@ -38,6 +38,7 @@
#include "res/BOINCGUIApp.xpm"
IMPLEMENT_DYNAMIC_CLASS(CMainFrame, wxFrame)
@ -48,8 +49,6 @@ BEGIN_EVENT_TABLE (CMainFrame, wxFrame)
EVT_MENU (ID_COMMANDSATTACHPROJECT, CMainFrame::OnCommandsAttachProject)
EVT_MENU (ID_TOOLSOPTIONS, CMainFrame::OnToolsOptions)
EVT_MENU (wxID_ABOUT, CMainFrame::OnAbout)
EVT_MENU (ID_STATUSBAR, CMainFrame::OnStatusbar)
EVT_UPDATE_UI (ID_STATUSBAR, CMainFrame::OnStatusbarUI)
END_EVENT_TABLE ()
@ -134,6 +133,7 @@ bool CMainFrame::CreateNotebook() {
pPanelSizer->Add(new wxStaticLine(pPanel, -1), 0, wxEXPAND);
pPanelSizer->Add(0, 4);
pPanelSizer->Add(pNotebookSizer, 1, wxEXPAND);
pPanel->SetAutoLayout(true);
pPanel->SetSizerAndFit(pPanelSizer);
CreateNotebookPage(new CProjectsView(m_pNotebook));
@ -148,19 +148,45 @@ bool CMainFrame::CreateNotebook() {
bool CMainFrame::CreateNotebookPage(wxWindow* pwndNewNotebookPage) {
wxImageList* pImageList;
wxBitmap bmpTabImage;
int iImageIndex = 0;
wxASSERT(pwndNewNotebookPage->IsKindOf(CLASSINFO(CBaseListCtrlView)) ||
pwndNewNotebookPage->IsKindOf(CLASSINFO(CBaseWindowView)));
pImageList = m_pNotebook->GetImageList();
if (!pImageList) {
pImageList = new wxImageList(16, 16, true, 0);
wxASSERT(pImageList != NULL);
}
if(pwndNewNotebookPage->IsKindOf(CLASSINFO(CBaseListCtrlView))) {
CBaseListCtrlView* pPage = (CBaseListCtrlView*)pwndNewNotebookPage;
m_pNotebook->AddPage(pPage, pPage->GetViewName(), true, -1);
bmpTabImage = wxBitmap(pPage->GetViewIcon());
iImageIndex = pImageList->Add(bmpTabImage, wxColour(255, 0, 255));
m_pNotebook->AddPage(pPage, pPage->GetViewName(), TRUE, iImageIndex);
} else {
if(pwndNewNotebookPage->IsKindOf(CLASSINFO(CBaseWindowView))) {
CBaseWindowView* pPage = (CBaseWindowView*)pwndNewNotebookPage;
m_pNotebook->AddPage(pPage, pPage->GetViewName(), true, -1);
bmpTabImage = wxBitmap(pPage->GetViewIcon());
iImageIndex = pImageList->Add(bmpTabImage, wxColour(255, 0, 255));
m_pNotebook->AddPage(pPage, pPage->GetViewName(), TRUE, iImageIndex);
}
}
m_pNotebook->SetImageList(pImageList);
return true;
}
@ -190,6 +216,13 @@ bool CMainFrame::DeleteMenu() {
bool CMainFrame::DeleteNotebook() {
wxImageList* pImageList;
pImageList = m_pNotebook->GetImageList();
if (pImageList)
delete pImageList;
return true;
}
@ -253,18 +286,3 @@ void CMainFrame::OnExit(wxCommandEvent &WXUNUSED(event)) {
void CMainFrame::OnIdle (wxIdleEvent &event) {
}
void CMainFrame::OnStatusbar (wxCommandEvent &WXUNUSED(event)) {
if (!m_pStatusbar)
CreateStatusbar();
else
DeleteStatusbar();
}
void CMainFrame::OnStatusbarUI (wxUpdateUIEvent &event) {
event.Check(m_pStatusbar != NULL);
}

View File

@ -42,10 +42,6 @@ public:
void OnCommandsAttachProject(wxCommandEvent &event);
void OnToolsOptions(wxCommandEvent &event);
void OnAbout(wxCommandEvent &event);
void OnStatusbar(wxCommandEvent &event);
void OnToolbarsUI(wxUpdateUIEvent &event);
void OnStatusbarUI(wxUpdateUIEvent &event);
private:

View File

@ -24,6 +24,8 @@
#include "stdwx.h"
#include "MessagesView.h"
#include "res/mess.xpm"
IMPLEMENT_DYNAMIC_CLASS(CMessagesView, CBaseListCtrlView)
@ -52,3 +54,9 @@ wxString CMessagesView::GetViewName(void)
return wxString(_("Messages"));
}
char** CMessagesView::GetViewIcon(void)
{
return mess_xpm;
}

View File

@ -38,6 +38,7 @@ public:
~CMessagesView(void);
virtual wxString GetViewName(void);
virtual char** GetViewIcon(void);
};

View File

@ -24,6 +24,8 @@
#include "stdwx.h"
#include "ProjectsView.h"
#include "res/proj.xpm"
IMPLEMENT_DYNAMIC_CLASS(CProjectsView, CBaseListCtrlView)
@ -54,3 +56,9 @@ wxString CProjectsView::GetViewName(void)
return wxString(_("Projects"));
}
char** CProjectsView::GetViewIcon(void)
{
return proj_xpm;
}

View File

@ -38,6 +38,7 @@ public:
~CProjectsView(void);
virtual wxString GetViewName(void);
virtual char** GetViewIcon(void);
};

View File

@ -24,6 +24,8 @@
#include "stdwx.h"
#include "ResourceUtilizationView.h"
#include "res/usage.xpm"
IMPLEMENT_DYNAMIC_CLASS(CResourceUtilizationView, CBaseWindowView)
@ -53,3 +55,9 @@ wxString CResourceUtilizationView::GetViewName(void)
return wxString(_("Disk"));
}
char** CResourceUtilizationView::GetViewIcon(void)
{
return usage_xpm;
}

View File

@ -38,6 +38,7 @@ public:
~CResourceUtilizationView(void);
virtual wxString GetViewName(void);
virtual char** GetViewIcon(void);
};

View File

@ -24,6 +24,8 @@
#include "stdwx.h"
#include "TransfersView.h"
#include "res/xfer.xpm"
IMPLEMENT_DYNAMIC_CLASS(CTransfersView, CBaseListCtrlView)
@ -56,3 +58,9 @@ wxString CTransfersView::GetViewName(void)
return wxString(_("Transfers"));
}
char** CTransfersView::GetViewIcon(void)
{
return xfer_xpm;
}

View File

@ -38,6 +38,7 @@ public:
~CTransfersView(void);
virtual wxString GetViewName(void);
virtual char** GetViewIcon(void);
};

View File

@ -24,6 +24,8 @@
#include "stdwx.h"
#include "WorkView.h"
#include "res/result.xpm"
IMPLEMENT_DYNAMIC_CLASS(CWorkView, CBaseListCtrlView)
@ -57,3 +59,9 @@ wxString CWorkView::GetViewName(void)
return wxString(_("Work"));
}
char** CWorkView::GetViewIcon(void)
{
return result_xpm;
}

View File

@ -38,6 +38,7 @@ public:
~CWorkView(void);
virtual wxString GetViewName(void);
virtual char** GetViewIcon(void);
};

51
clientgui/res/boinc.xpm Normal file
View File

@ -0,0 +1,51 @@
/* XPM */
static char *boinc_xpm[] = {
"16 16 32 1",
" c None",
". c #000066",
"X c #000033",
"o c #333333",
"O c #555555",
"+ c #000080",
"@ c #4D4D4D",
"# c #996666",
"$ c #393939",
"% c #000099",
"& c #424242",
"* c #FFCC99",
"= c #FFCC66",
"- c #999933",
"; c #808080",
": c #CC9966",
"> c #CC9933",
", c #CCCC33",
"< c #333366",
"1 c #292929",
"2 c #FFCC33",
"3 c #5F5F5F",
"4 c #666633",
"5 c #333399",
"6 c #666666",
"7 c #996633",
"8 c #CCCC66",
"9 c #666699",
"0 c #777777",
"q c #666600",
"w c #868686",
"e c #969696",
" .XoO ",
" +.XXXXXXO ",
" +.XX@###$XO ",
" %+X&***===-X; ",
" %++X:*=>.,,-<$ ",
" ++.X1=23.2-4O< ",
"5++.X6=2O>27O<<@",
"++.XX82>-,27&<11",
"...X1=>69@2>7<o1",
"<.XX4=>05X>>qO<<",
" XXX-2-<XX24O9< ",
" XXX727XX>-&w9< ",
" 0XXX>>>>73ew3 ",
" 3XX4446ww93 ",
" 0o<6ww96O ",
" 0660 "};

View File

@ -1,18 +1,18 @@
//{{NO_DEPENDENCIES}}
// Microsoft Visual C++ generated include file.
// Used by wxWindowsTemplate.rc
// Used by BOINCGUIApp.rc
//
#define IDI_MYFRAME 1
#define IDB_BITMAP1 109
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_RESOURCE_VALUE 110
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif