diff --git a/clientgui/BOINCGUI.vcproj b/clientgui/BOINCGUI.vcproj
index aa16f6a598..f9bf81a738 100644
--- a/clientgui/BOINCGUI.vcproj
+++ b/clientgui/BOINCGUI.vcproj
@@ -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}">
+
+
diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp
index 0280f6d21b..3e97129a47 100644
--- a/clientgui/BOINCGUIApp.cpp
+++ b/clientgui/BOINCGUIApp.cpp
@@ -94,7 +94,8 @@ bool CBOINCGUIApp::OnCmdLineParsed(wxCmdLineParser &parser)
wxDefaultPosition
);
- pDlg->ShowModal();
+ if (pDlg)
+ pDlg->ShowModal();
return false;
} else {
diff --git a/clientgui/BOINCGUIApp.rc b/clientgui/BOINCGUIApp.rc
index 288b92494c..a1f83eadb7 100644
--- a/clientgui/BOINCGUIApp.rc
+++ b/clientgui/BOINCGUIApp.rc
@@ -41,6 +41,28 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Cursor
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Bitmap
+//
+
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
diff --git a/clientgui/BaseListCtrlView.cpp b/clientgui/BaseListCtrlView.cpp
index c21d831abf..2dc6560acf 100644
--- a/clientgui/BaseListCtrlView.cpp
+++ b/clientgui/BaseListCtrlView.cpp
@@ -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;
+}
+
diff --git a/clientgui/BaseListCtrlView.h b/clientgui/BaseListCtrlView.h
index ea6daae2c1..2ba60c05c0 100644
--- a/clientgui/BaseListCtrlView.h
+++ b/clientgui/BaseListCtrlView.h
@@ -36,6 +36,7 @@ public:
~CBaseListCtrlView(void);
virtual wxString GetViewName(void);
+ virtual char** GetViewIcon(void);
};
diff --git a/clientgui/BaseWindowView.cpp b/clientgui/BaseWindowView.cpp
index 702badf699..e1206b4d7e 100644
--- a/clientgui/BaseWindowView.cpp
+++ b/clientgui/BaseWindowView.cpp
@@ -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;
+}
+
diff --git a/clientgui/BaseWindowView.h b/clientgui/BaseWindowView.h
index f9c7704f6c..2489a24829 100644
--- a/clientgui/BaseWindowView.h
+++ b/clientgui/BaseWindowView.h
@@ -36,6 +36,7 @@ public:
~CBaseWindowView(void);
virtual wxString GetViewName(void);
+ virtual char** GetViewIcon(void);
};
diff --git a/clientgui/MainFrame.cpp b/clientgui/MainFrame.cpp
index 144867cc58..3a4dd267e6 100644
--- a/clientgui/MainFrame.cpp
+++ b/clientgui/MainFrame.cpp
@@ -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);
-}
-
diff --git a/clientgui/MainFrame.h b/clientgui/MainFrame.h
index 7163e39304..bb12c1d1bb 100644
--- a/clientgui/MainFrame.h
+++ b/clientgui/MainFrame.h
@@ -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:
diff --git a/clientgui/MessagesView.cpp b/clientgui/MessagesView.cpp
index 40e301af3d..5e33b7a3d8 100644
--- a/clientgui/MessagesView.cpp
+++ b/clientgui/MessagesView.cpp
@@ -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;
+}
+
diff --git a/clientgui/MessagesView.h b/clientgui/MessagesView.h
index 0397b41d25..56ba2ee188 100644
--- a/clientgui/MessagesView.h
+++ b/clientgui/MessagesView.h
@@ -38,6 +38,7 @@ public:
~CMessagesView(void);
virtual wxString GetViewName(void);
+ virtual char** GetViewIcon(void);
};
diff --git a/clientgui/ProjectsView.cpp b/clientgui/ProjectsView.cpp
index 114494767e..d311e82ec0 100644
--- a/clientgui/ProjectsView.cpp
+++ b/clientgui/ProjectsView.cpp
@@ -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;
+}
+
diff --git a/clientgui/ProjectsView.h b/clientgui/ProjectsView.h
index 7a4f519bca..2215706278 100644
--- a/clientgui/ProjectsView.h
+++ b/clientgui/ProjectsView.h
@@ -38,6 +38,7 @@ public:
~CProjectsView(void);
virtual wxString GetViewName(void);
+ virtual char** GetViewIcon(void);
};
diff --git a/clientgui/ResourceUtilizationView.cpp b/clientgui/ResourceUtilizationView.cpp
index f8a5742f63..8e63eb52b5 100644
--- a/clientgui/ResourceUtilizationView.cpp
+++ b/clientgui/ResourceUtilizationView.cpp
@@ -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;
+}
+
diff --git a/clientgui/ResourceUtilizationView.h b/clientgui/ResourceUtilizationView.h
index 47b5dd77ca..b8bb026408 100644
--- a/clientgui/ResourceUtilizationView.h
+++ b/clientgui/ResourceUtilizationView.h
@@ -38,6 +38,7 @@ public:
~CResourceUtilizationView(void);
virtual wxString GetViewName(void);
+ virtual char** GetViewIcon(void);
};
diff --git a/clientgui/TransfersView.cpp b/clientgui/TransfersView.cpp
index 206bf13618..239d32abc4 100644
--- a/clientgui/TransfersView.cpp
+++ b/clientgui/TransfersView.cpp
@@ -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;
+}
+
diff --git a/clientgui/TransfersView.h b/clientgui/TransfersView.h
index ec68786e0f..ee0d4f7aad 100644
--- a/clientgui/TransfersView.h
+++ b/clientgui/TransfersView.h
@@ -38,6 +38,7 @@ public:
~CTransfersView(void);
virtual wxString GetViewName(void);
+ virtual char** GetViewIcon(void);
};
diff --git a/clientgui/WorkView.cpp b/clientgui/WorkView.cpp
index b49841e3c5..dbd1331c07 100644
--- a/clientgui/WorkView.cpp
+++ b/clientgui/WorkView.cpp
@@ -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;
+}
+
diff --git a/clientgui/WorkView.h b/clientgui/WorkView.h
index c53011e2bb..47e7069844 100644
--- a/clientgui/WorkView.h
+++ b/clientgui/WorkView.h
@@ -38,6 +38,7 @@ public:
~CWorkView(void);
virtual wxString GetViewName(void);
+ virtual char** GetViewIcon(void);
};
diff --git a/clientgui/res/boinc.xpm b/clientgui/res/boinc.xpm
new file mode 100644
index 0000000000..d545a92f44
--- /dev/null
+++ b/clientgui/res/boinc.xpm
@@ -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>705X>>qO<<",
+" XXX-2--&w9< ",
+" 0XXX>>>>73ew3 ",
+" 3XX4446ww93 ",
+" 0o<6ww96O ",
+" 0660 "};
diff --git a/clientgui/resource.h b/clientgui/resource.h
index c555558f6d..7dd26ca744 100644
--- a/clientgui/resource.h
+++ b/clientgui/resource.h
@@ -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
-