*** empty log message ***

svn path=/trunk/boinc/; revision=10612
This commit is contained in:
Milos Travar 2006-07-10 13:41:10 +00:00
parent e1bb41e20a
commit 31d548b04c
26 changed files with 231 additions and 95 deletions

View File

@ -1075,7 +1075,8 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) {
#endif
// Show the new frame if needed
if (m_pFrame && bShowWindow) m_pFrame->Show();
//if (m_pFrame && bShowWindow) m_pFrame->Show();
if (m_pFrame && bShowWindow && (iGUISelection == BOINC_ADVANCEDGUI)) m_pFrame->Show();
m_iGUISelected = iGUISelection;
m_pConfig->Write(wxT("GUISelection"), iGUISelection);

View File

@ -889,6 +889,14 @@ void wxPageContainerBase::OnPaint(wxPaintEvent &event)
m_pagesInfoVec[i].GetRegion().Clear();
}
if(GetNumOfVisibleTabs() < (int)m_pagesInfoVec.size()){
long style = GetParent()->GetWindowStyleFlag();
if(style & wxFNB_NO_NAV_BUTTONS){
style ^= wxFNB_NO_NAV_BUTTONS;
GetParent()->SetWindowStyleFlag(style);
}
}
// Draw the left/right/close buttons
// Left arrow
DrawLeftArrow(dc);

View File

@ -29,10 +29,8 @@
#include "common/wxAnimate.h"
#include "common/wxFlatNotebook.h"
#include "sg_ImageLoader.h"
#include "sg_StatImageLoader.h"
#include "sg_DlgPreferences.h"
#include "sg_SkinClass.h"
#include "sg_BoincSimpleGUI.h"
#include "error_numbers.h"
#include "parse.h"
#include <string>
@ -41,17 +39,25 @@
#include "BOINCBaseWizard.h"
#include "WizardAttachProject.h"
#include "WizardAccountManager.h"
#include "sg_StatImageLoader.h"
#include "sg_BoincSimpleGUI.h"
#include "res/boinc.xpm"
IMPLEMENT_DYNAMIC_CLASS(CSimpleFrame, CBOINCBaseFrame)
enum{
BTN_SHOW_GRAPHICS = 24000,
BTN_COLLAPSE = 24100,
};
BEGIN_EVENT_TABLE(CSimpleFrame, CBOINCBaseFrame)
EVT_BUTTON(-1,CSimpleFrame::OnBtnClick)
EVT_SIZE(CSimpleFrame::OnSize)
EVT_ERASE_BACKGROUND(CSimpleFrame::OnEraseBackground)
EVT_FRAME_CONNECT(CSimpleFrame::OnConnect)
EVT_TIMER(ID_SIMPLEFRAMERENDERTIMER, CSimpleFrame::OnFrameRender)
EVT_FLATNOTEBOOK_PAGE_CHANGED(-1, CSimpleFrame::OnPageChanged)
END_EVENT_TABLE()
@ -241,7 +247,7 @@ void CSimpleFrame::InitSimpleClient()
friendlyName += wxString(index.c_str(), wxConvUTF8 );
wxWindow *wTab = this->CreateNotebookPage();
wrkUnitNB->AddPage(wTab, wxT(friendlyName, true));
if(result->active_task){
if(result->active_task_state == 1){
wrkUnitNB->SetPageImageIndex(i, 0); // this is working process
}else{
wrkUnitNB->SetPageImageIndex(i, 1); // this is sleeping process
@ -271,7 +277,7 @@ void CSimpleFrame::InitSimpleClient()
gaugeWuP1->SetBackgroundColour(appSkin->GetGaugeBgCol());
gaugeWuP1->SetValue(floor(result->fraction_done * 100000)/1000);
//Work Unit Name
lblWrkUnitName=new wxStaticText(wTab,-1,wxT(""),SetwxPoint(110,34),SetwxSize(79,13),wxST_NO_AUTORESIZE);
lblWrkUnitName=new wxStaticText(wTab,-1,wxT(""),SetwxPoint(110,34),SetwxSize(250,13),wxST_NO_AUTORESIZE);
lblWrkUnitName->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
lblWrkUnitName->SetLabel(wxString(result->name.c_str(),wxConvUTF8));
//Elapsed Time
@ -292,11 +298,23 @@ void CSimpleFrame::InitSimpleClient()
lblTimeRemaining->SetLabel(wxT("Time remaining:"));
lblTimeRemaining->SetFont(wxFont(10,74,90,90,0,wxT("Tahoma")));
//Time Remaining Value
lblTimeRemainingValue=new wxStaticText(wTab,-1,wxT(""),SetwxPoint(115,119),SetwxSize(294,18),wxST_NO_AUTORESIZE);
lblTimeRemainingValue=new wxStaticText(wTab,-1,wxT(""),SetwxPoint(115,119),SetwxSize(200,18),wxST_NO_AUTORESIZE);
lblTimeRemainingValue->SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
FormatTimeToCompletion(result, strBuffer);
lblTimeRemainingValue->SetLabel(strBuffer);
lblTimeRemainingValue->SetFont(wxFont(10,74,90,90,0,wxT("Tahoma")));
// show graphic button
wxToolTip *ttShowGraphic = new wxToolTip(wxT("Launch Real-Time Graphics"));
btnShowGraphic=new wxBitmapButton(wTab,BTN_SHOW_GRAPHICS,btmpShwGrph,SetwxPoint(315,117),SetwxSize(24,24),wxSIMPLE_BORDER);
btnShowGraphic->SetBitmapSelected(btmpShwGrphClick);
btnShowGraphic->SetBackgroundColour(wxColour(255,255,255));
btnShowGraphic->SetToolTip(ttShowGraphic);
// Collapse button
wxToolTip *ttCollapse = new wxToolTip(wxT("Hide Graphic"));
btnCollapse=new wxBitmapButton(wTab,BTN_COLLAPSE,btmpCol,SetwxPoint(341,117),SetwxSize(24,24),wxSIMPLE_BORDER);
btnCollapse->SetBitmapSelected(btmpColClick);
btnCollapse->SetBackgroundColour(wxColour(255,255,255));
btnCollapse->SetToolTip(ttCollapse);
// project image behind graphic <><><>
imgBgAnim=new wxStaticBitmap(wTab,-1,*btmpBgAnim,SetwxPoint(0,146),SetwxSize(370,182));
//// Animation Window
@ -336,15 +354,21 @@ void CSimpleFrame::InitSimpleClient()
stMyProj=new wxStaticText(this,-1,wxT(""),SetwxPoint(20,434),SetwxSize(84,18),wxST_NO_AUTORESIZE);
stMyProj->SetLabel(wxT("My Projects:"));
stMyProj->SetFont(wxFont(10,74,90,92,0,wxT("Tahoma")));
// Attach Project <><><>
btnAttProj=new wxBitmapButton(this,-1,*btmpBtnAttProjL,SetwxPoint(250,431),SetwxSize(109,20));
// Collapse button mid
btnCollapseMid=new wxBitmapButton(this,-1,btmpCol,SetwxPoint(366,429),SetwxSize(24,24),wxSIMPLE_BORDER);
btnCollapseMid->SetBitmapSelected(btmpColClick);
// Add Project <><><>
wxToolTip *ttAddProject = new wxToolTip(wxT("Add Project"));
btnAddProj=new wxBitmapButton(this,-1,*btmpBtnAttProjL,SetwxPoint(237,431),SetwxSize(96,20));
btnAddProj->SetToolTip(ttAddProject);
// Collapse button
//wxToolTip *ttCollapse = new wxToolTip(wxT("Hide Graphic"));
//btnCollapse=new wxBitmapButton(this,-1,btmpCol,SetwxPoint(366,410),SetwxSize(24,24),wxSIMPLE_BORDER);
//btnCollapse->SetBitmapSelected(btmpColClick);
//btnCollapse->SetToolTip(ttCollapse);
//expand buttons
btnExpandMid=new wxBitmapButton(this,-1,btmpExp,SetwxPoint(336,429),SetwxSize(24,24),wxSIMPLE_BORDER);
btnExpandMid->SetBitmapSelected(btmpExpClick);
btnExpandMid->Show(false); // at initial build there is no need to show
wxToolTip *ttExpand = new wxToolTip(wxT("Show Graphic"));
btnExpand=new wxBitmapButton(this,-1,btmpExp,SetwxPoint(336,429),SetwxSize(24,24),wxSIMPLE_BORDER);
btnExpand->SetBitmapSelected(btmpExpClick);
btnExpand->SetToolTip(ttExpand);
btnExpand->Show(false); // at initial build there is no need to show
/// Line
lnMyProjTop=new wxStaticLine(this,-1,SetwxPoint(20,454),SetwxSize(370,2));
///////
@ -365,7 +389,7 @@ void CSimpleFrame::InitSimpleClient()
}else if(project->project_name == "Predictor @ Home"){
i_statW->LoadImage(g_statPred);
}else{
i_statW->LoadImage(g_statWCG);
i_statW->LoadImage(g_statGeneric);
}
i_statW->SetToolTip(statWCGtip);
}
@ -378,14 +402,26 @@ void CSimpleFrame::InitSimpleClient()
///////////
lnMyProjBtm=new wxStaticLine(this,-1,SetwxPoint(20,516),SetwxSize(370,2));
//// Messages Play Pause Btns
btnMessages=new wxBitmapButton(this,-1,*btmpMessagesBtnL,SetwxPoint(28,522),SetwxSize(20,20));
// play pause btn
btnPause=new wxBitmapButton(this,-1,*btmpBtnPauseL,SetwxPoint(55,522),SetwxSize(20,20));
btnPlay=new wxBitmapButton(this,-1,*btmpBtnPlayL,SetwxPoint(55,522),SetwxSize(20,20));
wxToolTip *ttMessages = new wxToolTip(wxT("Messages"));
btnMessages=new wxBitmapButton(this,-1,*btmpMessagesBtnL,SetwxPoint(20,522),SetwxSize(76,20));
btnMessages->SetToolTip(ttMessages);
// pause btn
wxToolTip *ttPause = new wxToolTip(wxT("Pause all processing"));
btnPause=new wxBitmapButton(this,-1,*btmpBtnPauseL,SetwxPoint(97,522),SetwxSize(59,20));
btnPause->SetToolTip(ttPause);
// play btn
wxToolTip *ttPlay = new wxToolTip(wxT("Resume all Processing"));
btnPlay=new wxBitmapButton(this,-1,*btmpBtnPlayL,SetwxPoint(97,522),SetwxSize(62,20));
btnPlay->SetToolTip(ttPlay);
btnPlay->Show(false);
// Class View ,Pref Btns
// Pref Btn
wxToolTip *ttPreferences = new wxToolTip(wxT("Preferences"));
btnPreferences=new wxBitmapButton(this,-1,*btmpBtnPrefL,SetwxPoint(183,522),SetwxSize(86,20));
btnPreferences->SetToolTip(ttPreferences);
// Advanced View
wxToolTip *ttAdvView = new wxToolTip(wxT("Advanced View"));
btnAdvancedView=new wxBitmapButton(this,-1,*btmpBtnAdvViewL,SetwxPoint(273,522),SetwxSize(116,20));
btnAdvancedView->SetToolTip(ttAdvView);
Refresh();
}
@ -408,8 +444,9 @@ void CSimpleFrame::LoadSkinImages(){
g_icoWorkWU = new wxImage(dirPref + appSkin->GetIcnWorkingWkUnit(), wxBITMAP_TYPE_PNG);
// stat icons
g_statWCG = new wxImage(_T("skins/default/graphic/statWCG.png"), wxBITMAP_TYPE_PNG);
g_statSeti = new wxImage(_T("skins/default/graphic/statSeti.png"), wxBITMAP_TYPE_PNG);
g_statPred = new wxImage(_T("skins/default/graphic/statPred.png"), wxBITMAP_TYPE_PNG);
// generic project icon
g_statGeneric = new wxImage(dirPref + appSkin->GetIcnPrjGeneric(), wxBITMAP_TYPE_PNG);
// arrows
g_arwLeft = new wxImage(dirPref + appSkin->GetBtnLeftArr(), wxBITMAP_TYPE_PNG);
g_arwRight = new wxImage(dirPref + appSkin->GetBtnRightArr(), wxBITMAP_TYPE_PNG);
@ -429,9 +466,14 @@ void CSimpleFrame::LoadSkinImages(){
g_expandClick = new wxImage(dirPref + appSkin->GetBtnExpandClick(), wxBITMAP_TYPE_PNG);
btmpExp= wxBitmap(g_expand);
btmpExpClick= wxBitmap(g_expandClick);
// show graphic
g_showGraphic = new wxImage(dirPref + appSkin->GetBtnShowGraphic(), wxBITMAP_TYPE_PNG);
g_showGraphicClick = new wxImage(dirPref + appSkin->GetBtnShowGraphicClick(), wxBITMAP_TYPE_PNG);
btmpShwGrph= wxBitmap(g_showGraphic);
btmpShwGrphClick= wxBitmap(g_showGraphicClick);
//////////////////////////////
fileImgBuf[2].LoadFile(dirPref + appSkin->GetBtnPrefer(),wxBITMAP_TYPE_BMP);
fileImgBuf[3].LoadFile(dirPref + appSkin->GetBtnAttProj(),wxBITMAP_TYPE_BMP);
fileImgBuf[3].LoadFile(dirPref + appSkin->GetBtnAddProj(),wxBITMAP_TYPE_BMP);
fileImgBuf[4].LoadFile(dirPref + appSkin->GetIcnWorking(),wxBITMAP_TYPE_BMP);
fileImgBuf[5].LoadFile(dirPref + appSkin->GetBtnMessages(),wxBITMAP_TYPE_BMP);
fileImgBuf[6].LoadFile(dirPref + appSkin->GetBtnPause(),wxBITMAP_TYPE_BMP);
@ -509,10 +551,10 @@ int CSimpleFrame::LoadSkinXML(){
if (parse_str(buf, "<imgsrc>", val)) {
appSkin->SetBtnPrefer(wxString( val.c_str(), wxConvUTF8 ));
}
}else if(match_tag(buf, "<attchproj>")){
}else if(match_tag(buf, "<addproj>")){
mf.fgets(buf, 256);
if (parse_str(buf, "<imgsrc>", val)) {
appSkin->SetBtnAttProj(wxString( val.c_str(), wxConvUTF8 ));
appSkin->SetBtnAddProj(wxString( val.c_str(), wxConvUTF8 ));
}
}else if(match_tag(buf, "<advancedview>")){
mf.fgets(buf, 256);
@ -585,6 +627,15 @@ int CSimpleFrame::LoadSkinXML(){
if (parse_str(buf, "<imgsrcclick>", val)) {
appSkin->SetBtnCollapseClick(wxString( val.c_str(), wxConvUTF8 ));
}
}else if(match_tag(buf, "<showgraphics>")){
mf.fgets(buf, 256);
if (parse_str(buf, "<imgsrc>", val)) {
appSkin->SetBtnShowGraphic(wxString( val.c_str(), wxConvUTF8 ));
}
mf.fgets(buf, 256);
if (parse_str(buf, "<imgsrcclick>", val)) {
appSkin->SetBtnShowGraphicClick(wxString( val.c_str(), wxConvUTF8 ));
}
}
}//end of while
}else if (match_tag(buf, "<icons")) {
@ -648,6 +699,11 @@ int CSimpleFrame::LoadSkinXML(){
if (parse_str(buf, "<imgsrc>", val)) {
appSkin->SetIcnPrjPRED(wxString( val.c_str(), wxConvUTF8 ));
}
}else if(match_tag(buf, "<prjIconGeneric>")){
mf.fgets(buf, 256);
if (parse_str(buf, "<imgsrc>", val)) {
appSkin->SetIcnPrjGeneric(wxString( val.c_str(), wxConvUTF8 ));
}
}
}// end of while loop
}else if (match_tag(buf, "<animation")) {
@ -681,7 +737,7 @@ void CSimpleFrame::ReskinAppGUI(){
btnMessages->SetBitmapLabel(*btmpMessagesBtnL);
btnPlay->SetBitmapLabel(*btmpBtnPlayL);
btnPause->SetBitmapLabel(*btmpBtnPauseL);
btnAttProj->SetBitmapLabel(*btmpBtnAttProjL);
btnAddProj->SetBitmapLabel(*btmpBtnAttProjL);
btnPreferences->SetBitmapLabel(*btmpBtnPrefL);
btnAdvancedView->SetBitmapLabel(*btmpBtnAdvViewL);
//arrows
@ -690,16 +746,16 @@ void CSimpleFrame::ReskinAppGUI(){
btnArwRight->SetBitmapLabel(btmpArwR);
btnArwRight->SetBitmapSelected(btmpArwRC);
//collapse
btnCollapseMid->SetBitmapLabel(btmpCol);
btnCollapseMid->SetBitmapSelected(btmpColClick);
btnCollapse->SetBitmapLabel(btmpCol);
btnCollapse->SetBitmapSelected(btmpColClick);
//expand buttons
btnExpandMid->SetBitmapLabel(btmpExp);
btnExpandMid->SetBitmapSelected(btmpExpClick);
btnExpand->SetBitmapLabel(btmpExp);
btnExpand->SetBitmapSelected(btmpExpClick);
//gauges
gaugeWuP1->SetForegroundColour(appSkin->GetGaugeFgCol());
gaugeWuP1->SetBackgroundColour(appSkin->GetGaugeBgCol());
btnExpandMid->SetBackgroundColour(appSkin->GetAppBgCol());
btnCollapseMid->SetBackgroundColour(appSkin->GetAppBgCol());
btnExpand->SetBackgroundColour(appSkin->GetAppBgCol());
btnCollapse->SetBackgroundColour(appSkin->GetAppBgCol());
btnArwLeft->SetBackgroundColour(appSkin->GetAppBgCol());
btnArwRight->SetBackgroundColour(appSkin->GetAppBgCol());
@ -803,36 +859,39 @@ void CSimpleFrame::OnBtnClick(wxCommandEvent& event){ //init function
}else if(m_wxBtnObj==btnArwRight){
//refresh btn
btnArwRight->Refresh();
}else if(m_wxBtnObj==btnCollapseMid){
}else if(event.GetId()==BTN_SHOW_GRAPHICS){
//refresh btn
btnShowGraphic->Refresh();
}else if(event.GetId()==BTN_COLLAPSE){
//refresh btn
wxNotebookSize = SetwxSize(370, 170); //fix
if((!midAppCollapsed) && (!btmAppCollapsed)){
m_canvas->Show(false);
imgBgAnim->Show(false);
btnCollapseMid->Show(false);
btnExpandMid->Show(true);
btnCollapse->Show(false);
btnExpand->Show(true);
this->SetSize(-1, -1, 416, 398);
wTab1->SetSize(-1, -1, 370, 170);
wTab2->SetSize(-1, -1, 370, 170);
//wTab1->SetSize(-1, -1, 370, 170);
//wTab2->SetSize(-1, -1, 370, 170);
wrkUnitNB->SetSize(-1, -1, 370, 170);
//move controls up
MoveControlsUp();
midAppCollapsed = true;
}else{
this->SetSize(-1, -1, 416, 305);
wTab1->SetSize(-1, -1, 370, 170);
wTab2->SetSize(-1, -1, 370, 170);
//wTab1->SetSize(-1, -1, 370, 170);
//wTab2->SetSize(-1, -1, 370, 170);
wrkUnitNB->SetSize(-1, -1, 370, 170);
btnExpandMid->Move(366,247);
btnExpand->Move(366,247);
midAppCollapsed = true;
}
Refresh();
}else if(m_wxBtnObj==btnExpandMid){
}else if(m_wxBtnObj==btnExpand){
if((btmAppCollapsed) && (midAppCollapsed)){ // in this case open up bottom first
this->SetSize(-1, -1, 416, 398);
wrkUnitNB->SetSize(-1, -1, 370, 170);
stMyProj->Show(true);
btnAttProj->Show(true);
btnAddProj->Show(true);
stMyProj->Move(20,252);//(20,434)
//move controls up
MoveControlsUp();
@ -843,17 +902,17 @@ void CSimpleFrame::OnBtnClick(wxCommandEvent& event){ //init function
MoveControlsDown();
m_canvas->Show(true);
imgBgAnim->Show(true);
btnExpandMid->Show(false);
btnCollapseMid->Show(true);
btnAttProj->Show(true);
btnExpand->Show(false);
btnCollapse->Show(true);
btnAddProj->Show(true);
midAppCollapsed = false;
wrkUnitNB->SetSize(-1, -1, 370, 353); // fix
}else if((!midAppCollapsed) && (btmAppCollapsed)){
this->SetSize(-1, -1, 416, 581);
stMyProj->Show(true);
btnExpandMid->Show(false);
btnCollapseMid->Move(366,429);
btnAttProj->Move(250,431);
btnExpand->Show(false);
btnCollapse->Move(366,429);
btnAddProj->Move(237,431);
//midAppCollapsed = false;
btmAppCollapsed = false;
}
@ -867,37 +926,41 @@ void CSimpleFrame::OnBtnClick(wxCommandEvent& event){ //init function
//end function
void CSimpleFrame::MoveControlsUp(){
stMyProj->Move(20,252);//(20,434)
btnAttProj->Move(250,249);//(250,431)
btnExpandMid->Move(366,247);//(366,429)
btnAddProj->Move(237,249);//(237,431)
btnExpand->Move(366,247);//(366,429)
lnMyProjTop->Move(20,272);//(20,454)
w_statWCG->Move(60,278);//(60,460)
w_statSeti->Move(112,278);//(112,460)
w_statPred->Move(164,278);//(164,460)
//w_statWCG->Move(60,278);//(60,460)
//w_statSeti->Move(112,278);//(112,460)
//w_statPred->Move(164,278);//(164,460)
btnArwLeft->Move(25,291);//(25,483)
btnArwRight->Move(360,291);//(360,483)
lnMyProjBtm->Move(20,334);//(20,516)
btnMessages->Move(28,340);//(28,522)
btnPause->Move(55,340);//(55,522)
btnMessages->Move(20,340);//(28,522)
btnPause->Move(97,340);//(106,522)
btnPreferences->Move(183,340);//(183,522)
btnAdvancedView->Move(273,340);//(273,522)
}
void CSimpleFrame::MoveControlsDown(){
stMyProj->Move(20,434);
btnAttProj->Move(250,431);
btnExpandMid->Move(366,429);
btnAddProj->Move(237,431);
btnExpand->Move(366,429);
lnMyProjTop->Move(20,454);
w_statWCG->Move(60,460);
w_statSeti->Move(112,460);
w_statPred->Move(164,460);
//w_statWCG->Move(60,460);
//w_statSeti->Move(112,460);
//w_statPred->Move(164,460);
btnArwLeft->Move(25,473);
btnArwRight->Move(360,473);
lnMyProjBtm->Move(20,516);
btnMessages->Move(28,522);
btnPause->Move(55,522);
btnMessages->Move(20,522);
btnPause->Move(97,522);
btnPreferences->Move(183,522);
btnAdvancedView->Move(273,522);
}
void CSimpleFrame::OnPageChanged(wxFlatNotebookEvent& event)
{
btnCollapse->Refresh();
}
void CSimpleFrame::OnEraseBackground(wxEraseEvent& event){
wxObject *m_wxWin = event.GetEventObject();
if(m_wxWin==this){event.Skip(true);DrawBackImg(event,this,*CSimpleFrameImg0,0);return;}

View File

@ -81,7 +81,7 @@ public:
wxWindow *w_statWCG;
//
wxImage *g_statSeti;
wxImage *g_statGeneric;
StatImageLoader *i_statSeti;
wxWindow *w_statSeti;
//
@ -99,21 +99,26 @@ public:
wxBitmap btmpArwRC;
wxBitmapButton *btnArwLeft;
wxBitmapButton *btnArwRight;
//Collapse buttons
//Collapse button
bool midAppCollapsed;
bool btmAppCollapsed;
wxImage *g_collapse;
wxImage *g_collapseClick;
wxBitmap btmpCol;
wxBitmap btmpColClick;
wxBitmapButton *btnCollapseMid;
//wxBitmapButton *btnCollapseBtm;
//Expand buttons
wxBitmapButton *btnCollapse;
//Expand button
wxImage *g_expand;
wxImage *g_expandClick;
wxBitmap btmpExp;
wxBitmap btmpExpClick;
wxBitmapButton *btnExpandMid;
wxBitmapButton *btnExpand;
//ShowGraphic button
wxImage *g_showGraphic;
wxImage *g_showGraphicClick;
wxBitmap btmpShwGrph;
wxBitmap btmpShwGrphClick;
wxBitmapButton *btnShowGraphic;
////////////////////////////
wxStaticText *st9c;
wxWindow *w11c;
@ -134,7 +139,7 @@ public:
wxStaticBitmap *bm29c;
wxGauge *gaugeProjP1;
wxBitmapButton *btnPreferences;
wxBitmapButton *btnAttProj;
wxBitmapButton *btnAddProj;
wxStaticBitmap *icnProjWork;
wxStaticBitmap *bm39c;
wxGauge *gaugeProjP2;
@ -191,8 +196,9 @@ public:
protected:
void OnEraseBackground(wxEraseEvent& event);
void OnBtnClick(wxCommandEvent& event);
void OnConnect( CFrameEvent& event );
void OnFrameRender( wxTimerEvent& event );
void OnConnect(CFrameEvent& event );
void OnFrameRender(wxTimerEvent& event );
void OnPageChanged(wxFlatNotebookEvent& event);
wxInt32 FormatCPUTime( RESULT* rslt, wxString& strBuffer ) const;
wxInt32 FormatTimeToCompletion( RESULT* rslt, wxString& strBuffer ) const;
void SGUITimeFormat( float fBuffer, wxString& strBuffer) const;

View File

@ -12,7 +12,7 @@ public:
wxString GetAppBg() { return m_appBg; }
wxColour GetAppBgCol() { return GetColorFromStr(m_appBgCol); }
wxString GetBtnPrefer() const { return m_btnPrefer; }
wxString GetBtnAttProj() const { return m_btnAttProj; }
wxString GetBtnAddProj() const { return m_btnAddProj; }
wxString GetBtnAdvView() const { return m_btnAdvView; }
wxString GetBtnPlay() const { return m_btnPlay; }
wxString GetBtnPause() const { return m_btnPause; }
@ -26,8 +26,10 @@ public:
wxString GetBtnRightArrClick() const { return m_btnRightArrClick; }
wxString GetBtnExpand() const { return m_btnExpand; }
wxString GetBtnCollapse() const { return m_btnCollapse; }
wxString GetBtnShowGraphic() const { return m_btnShowGraphic; }
wxString GetBtnExpandClick() const { return m_btnExpandClick; }
wxString GetBtnCollapseClick() const { return m_btnCollapseClick; }
wxString GetBtnShowGraphicClick() const { return m_btnShowGraphicClick; }
wxString GetDlgPrefBg() { return m_dlgPrefBg; }
@ -48,6 +50,7 @@ public:
wxString GetIcnSleepingWkUnit() const { return m_icnSleepingWkUnit; }
wxString GetIcnPrjWCG() const { return m_icnPrjWCG; }
wxString GetIcnPrjPRED() const { return m_icnPrjPRED; }
wxString GetIcnPrjGeneric() const { return m_icnPrjGeneric; }
wxString GetAnimationBG() const { return m_animBg; }
wxString GetAnimationFile() const { return m_animFile; }
@ -55,7 +58,7 @@ public:
void SetAppBg(const wxString imgsrc) { m_appBg = imgsrc; }
void SetAppBgCol(const wxString& clr) { m_appBgCol = clr; }
void SetBtnPrefer(const wxString& imgsrc) { m_btnPrefer = imgsrc; }
void SetBtnAttProj(const wxString& imgsrc) { m_btnAttProj = imgsrc; }
void SetBtnAddProj(const wxString& imgsrc) { m_btnAddProj = imgsrc; }
void SetBtnAdvView(const wxString& imgsrc) { m_btnAdvView = imgsrc; }
void SetBtnPlay(const wxString& imgsrc) { m_btnPlay = imgsrc; }
void SetBtnPause(const wxString& imgsrc) { m_btnPause = imgsrc; }
@ -69,9 +72,11 @@ public:
void SetBtnRightArrClick(const wxString& imgsrc) { m_btnRightArrClick = imgsrc; }
void SetBtnExpand(const wxString& imgsrc) { m_btnExpand = imgsrc; }
void SetBtnCollapse(const wxString& imgsrc) { m_btnCollapse = imgsrc; }
void SetBtnShowGraphic(const wxString& imgsrc) { m_btnShowGraphic = imgsrc; }
void SetBtnExpandClick(const wxString& imgsrc) { m_btnExpandClick = imgsrc; }
void SetBtnCollapseClick(const wxString& imgsrc) { m_btnCollapseClick = imgsrc; }
void SetBtnShowGraphicClick(const wxString& imgsrc) { m_btnShowGraphicClick = imgsrc; }
void SetDlgPrefBg(const wxString& imgsrc) { m_dlgPrefBg = imgsrc; }
void SetGaugeFgCol(const wxString& clr) { m_gaugeFgCol = clr; }
@ -90,6 +95,7 @@ public:
void SetIcnSleepingWkUnit(const wxString& imgsrc) { m_icnSleepingWkUnit = imgsrc; }
void SetIcnPrjWCG(const wxString& imgsrc) { m_icnPrjWCG = imgsrc; }
void SetIcnPrjPRED(const wxString& imgsrc) { m_icnPrjPRED = imgsrc; }
void SetIcnPrjGeneric(const wxString& imgsrc) { m_icnPrjGeneric = imgsrc; }
void SetAnimationBg(const wxString& imgsrc) { m_animBg = imgsrc; }
void SetAnimationFile(const wxString& imgsrc) { m_animFile = imgsrc; }
@ -116,7 +122,7 @@ private:
wxString m_tabBrdColIn;
// Btns
wxString m_btnPrefer;
wxString m_btnAttProj;
wxString m_btnAddProj;
wxString m_btnAdvView;
wxString m_btnPlay;
wxString m_btnPause;
@ -132,13 +138,16 @@ private:
wxString m_btnCollapse;
wxString m_btnExpandClick;
wxString m_btnCollapseClick;
wxString m_btnShowGraphic;
wxString m_btnShowGraphicClick;
// Icons
wxString m_icnWorking;
wxString m_icnSleeping;
wxString m_icnWorkingWkUnit;
wxString m_icnSleepingWkUnit;
wxString m_icnPrjWCG;
wxString m_icnPrjPRED;
wxString m_icnPrjWCG;// will be deleted when project icons are supplied
wxString m_icnPrjPRED;// will be deleted when project icons are supplied
wxString m_icnPrjGeneric;
// animation
wxString m_animBg;
wxString m_animFile;

View File

@ -2,18 +2,25 @@
#include <vector>
#include "BOINCGUIApp.h"
#include "sg_StatImageLoader.h"
#include "BOINCBaseFrame.h"
enum{
WEBSITE_URL_MENU_ID = 34500,
};
BEGIN_EVENT_TABLE(StatImageLoader, wxWindow)
EVT_PAINT(StatImageLoader::OnPaint)
EVT_LEFT_DOWN(StatImageLoader::PopUpMenu)
EVT_MENU(WEBSITE_URL_MENU_ID,StatImageLoader::OnMenuLinkClicked)
END_EVENT_TABLE()
StatImageLoader::StatImageLoader(wxWindow* parent, std::string url) : wxWindow(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNO_BORDER)
{
appSkin = SkinClass::Instance();
prjUrl = url;
CreateMenu();
{
m_parent = parent;
appSkin = SkinClass::Instance();
prjUrl = url;
CreateMenu();
}
void StatImageLoader::PopUpMenu(wxMouseEvent& event)
@ -24,7 +31,7 @@ void StatImageLoader::PopUpMenu(wxMouseEvent& event)
void StatImageLoader::CreateMenu()
{
CMainDocument* pDoc = wxGetApp().GetDocument();
CMainDocument* pDoc = wxGetApp().GetDocument();
wxASSERT(pDoc);
PROJECT* project = pDoc->state.lookup_project(prjUrl);
@ -34,10 +41,12 @@ void StatImageLoader::CreateMenu()
statPopUpMenu = new wxMenu(wxSIMPLE_BORDER);
for(int i = 0; i < urlCount; i++){
wxMenuItem *urlItem = new wxMenuItem(statPopUpMenu, -1,wxString(project->gui_urls[i].name.c_str(), wxConvUTF8));
wxMenuItem *urlItem = new wxMenuItem(statPopUpMenu, WEBSITE_URL_MENU_ID + i,wxString(project->gui_urls[i].name.c_str(), wxConvUTF8));
#ifdef __WXMSW__
urlItem->SetBackgroundColour(appSkin->GetAppBgCol());
#endif
Connect( WEBSITE_URL_MENU_ID + i, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(StatImageLoader::OnMenuLinkClicked) );
statPopUpMenu->Append(urlItem);
}
//
@ -47,6 +56,26 @@ void StatImageLoader::CreateMenu()
itmTellFriend->SetBitmap(*btmTellFriend);
*/
}
void StatImageLoader::OnMenuLinkClicked(wxCommandEvent& event)
{
wxObject *m_wxBtnObj = event.GetEventObject();
int menuIDevt = event.GetId();
int menuId = menuIDevt - WEBSITE_URL_MENU_ID;
CMainDocument* pDoc = wxGetApp().GetDocument();
wxASSERT(pDoc);
PROJECT* project = pDoc->state.lookup_project(prjUrl);
project->gui_urls[menuId].name.c_str();
CBOINCBaseFrame* pFrame = wxDynamicCast(m_parent->GetParent(),CBOINCBaseFrame);
wxASSERT(pFrame);
wxASSERT(wxDynamicCast(pFrame, CBOINCBaseFrame));
pFrame->ExecuteBrowserLink(project->gui_urls[menuId].url.c_str());
int re = 4;
}
void StatImageLoader::LoadImage(const wxImage& image)
{
Bitmap = wxBitmap();//delete existing bitmap since we are loading new one

View File

@ -1,7 +1,12 @@
#ifndef _STATIMAGELOADER_H_
#define _STATIMAGELOADER_H_
#if defined(__GNUG__) && !defined(__APPLE__)
#pragma interface "sg_StatImageLoader.cpp"
#endif
#include "BOINCBaseView.h"
#include "sg_SkinClass.h"
class StatImageLoader : public wxWindow
@ -15,7 +20,8 @@ public:
/// Constructors
StatImageLoader(wxWindow* parent, std::string url);
void LoadImage(const wxImage& image);
void CreateMenu();
void CreateMenu();
void OnMenuLinkClicked(wxCommandEvent& event);
void PopUpMenu(wxMouseEvent& event);
void OnPaint(wxPaintEvent& event);
private:

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -16,20 +16,20 @@
<preferences>
<imgsrc>graphic/btnPreferences.bmp</imgsrc>
</preferences>
<attchproj>
<imgsrc>graphic/btnAttachProject.bmp</imgsrc>
</attchproj>
<addproj>
<imgsrc>graphic/btnAddProject.bmp</imgsrc>
</addproj>
<advancedview>
<imgsrc>graphic/btnAdvancedView.bmp</imgsrc>
</advancedview>
<play>
<imgsrc>graphic/play.bmp</imgsrc>
<imgsrc>graphic/btnResume.bmp</imgsrc>
</play>
<pause>
<imgsrc>graphic/pause.bmp</imgsrc>
<imgsrc>graphic/btnPause.bmp</imgsrc>
</pause>
<messages>
<imgsrc>graphic/messages.bmp</imgsrc>
<imgsrc>graphic/btnMessages.bmp</imgsrc>
</messages>
<open>
<imgsrc>graphic/btnOpen.bmp</imgsrc>
@ -56,6 +56,10 @@
<imgsrc>graphic/btnCollapse.png</imgsrc>
<imgsrcclick>graphic/btnCollapseClick.png</imgsrcclick>
</collapse>
<showgraphics>
<imgsrc>graphic/btnShowGraphic.png</imgsrc>
<imgsrcclick>graphic/btnShowGraphicClick.png</imgsrcclick>
</showgraphics>
</buttons>
<icons>
<working>
@ -82,6 +86,9 @@
<prjPREDicon>
<imgsrc>graphic/19_16_prdct.png</imgsrc>
</prjPREDicon>
<prjIconGeneric>
<imgsrc>graphic/statBoinc.png</imgsrc>
</prjIconGeneric>
</icons>
<animation>
<background>graphic/project_image.bmp</background>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View File

@ -16,20 +16,20 @@
<preferences>
<imgsrc>graphic/btnPreferences.bmp</imgsrc>
</preferences>
<attchproj>
<imgsrc>graphic/btnAttachProject.bmp</imgsrc>
</attchproj>
<addproj>
<imgsrc>graphic/btnAddProject.bmp</imgsrc>
</addproj>
<advancedview>
<imgsrc>graphic/btnAdvancedView.bmp</imgsrc>
</advancedview>
<play>
<imgsrc>graphic/play.bmp</imgsrc>
<imgsrc>graphic/btnResume.bmp</imgsrc>
</play>
<pause>
<imgsrc>graphic/pause.bmp</imgsrc>
<imgsrc>graphic/btnPause.bmp</imgsrc>
</pause>
<messages>
<imgsrc>graphic/messages.bmp</imgsrc>
<imgsrc>graphic/btnMessages.bmp</imgsrc>
</messages>
<open>
<imgsrc>graphic/btnOpen.bmp</imgsrc>
@ -56,6 +56,10 @@
<imgsrc>graphic/btnCollapse.png</imgsrc>
<imgsrcclick>graphic/btnCollapseClick.png</imgsrcclick>
</collapse>
<showgraphics>
<imgsrc>graphic/btnShowGraphic.png</imgsrc>
<imgsrcclick>graphic/btnShowGraphicClick.png</imgsrcclick>
</showgraphics>
</buttons>
<icons>
<working>
@ -82,6 +86,9 @@
<prjPREDicon>
<imgsrc>graphic/19_16_prdct.png</imgsrc>
</prjPREDicon>
<prjIconGeneric>
<imgsrc>graphic/statBoinc.png</imgsrc>
</prjIconGeneric>
</icons>
<animation>
<background>graphic/project_image.bmp</background>