diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index 5b278bfabe..e544e71d83 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -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); diff --git a/clientgui/common/wxFlatNotebook.cpp b/clientgui/common/wxFlatNotebook.cpp index ff27784e23..897af14d24 100644 --- a/clientgui/common/wxFlatNotebook.cpp +++ b/clientgui/common/wxFlatNotebook.cpp @@ -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); diff --git a/clientgui/sg_BoincSimpleGUI.cpp b/clientgui/sg_BoincSimpleGUI.cpp index 3a99229463..e760153008 100644 --- a/clientgui/sg_BoincSimpleGUI.cpp +++ b/clientgui/sg_BoincSimpleGUI.cpp @@ -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 @@ -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, "", val)) { appSkin->SetBtnPrefer(wxString( val.c_str(), wxConvUTF8 )); } - }else if(match_tag(buf, "")){ + }else if(match_tag(buf, "")){ mf.fgets(buf, 256); if (parse_str(buf, "", val)) { - appSkin->SetBtnAttProj(wxString( val.c_str(), wxConvUTF8 )); + appSkin->SetBtnAddProj(wxString( val.c_str(), wxConvUTF8 )); } }else if(match_tag(buf, "")){ mf.fgets(buf, 256); @@ -585,6 +627,15 @@ int CSimpleFrame::LoadSkinXML(){ if (parse_str(buf, "", val)) { appSkin->SetBtnCollapseClick(wxString( val.c_str(), wxConvUTF8 )); } + }else if(match_tag(buf, "")){ + mf.fgets(buf, 256); + if (parse_str(buf, "", val)) { + appSkin->SetBtnShowGraphic(wxString( val.c_str(), wxConvUTF8 )); + } + mf.fgets(buf, 256); + if (parse_str(buf, "", val)) { + appSkin->SetBtnShowGraphicClick(wxString( val.c_str(), wxConvUTF8 )); + } } }//end of while }else if (match_tag(buf, "", val)) { appSkin->SetIcnPrjPRED(wxString( val.c_str(), wxConvUTF8 )); } + }else if(match_tag(buf, "")){ + mf.fgets(buf, 256); + if (parse_str(buf, "", val)) { + appSkin->SetIcnPrjGeneric(wxString( val.c_str(), wxConvUTF8 )); + } } }// end of while loop }else if (match_tag(buf, "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;} diff --git a/clientgui/sg_BoincSimpleGUI.h b/clientgui/sg_BoincSimpleGUI.h index 7575e2090c..8d4e6e8eca 100644 --- a/clientgui/sg_BoincSimpleGUI.h +++ b/clientgui/sg_BoincSimpleGUI.h @@ -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; diff --git a/clientgui/sg_SkinClass.h b/clientgui/sg_SkinClass.h index 140a7535e9..4f3df2f90d 100644 --- a/clientgui/sg_SkinClass.h +++ b/clientgui/sg_SkinClass.h @@ -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; diff --git a/clientgui/sg_StatImageLoader.cpp b/clientgui/sg_StatImageLoader.cpp index 3e8cdd87bb..2c09f1ceee 100644 --- a/clientgui/sg_StatImageLoader.cpp +++ b/clientgui/sg_StatImageLoader.cpp @@ -2,18 +2,25 @@ #include #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 diff --git a/clientgui/sg_StatImageLoader.h b/clientgui/sg_StatImageLoader.h index 6ff367e906..624019be6d 100644 --- a/clientgui/sg_StatImageLoader.h +++ b/clientgui/sg_StatImageLoader.h @@ -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: diff --git a/clientgui/skins/WorldCommunityGrid/graphic/btnAddProject.bmp b/clientgui/skins/WorldCommunityGrid/graphic/btnAddProject.bmp new file mode 100644 index 0000000000..cc54a5fdfe Binary files /dev/null and b/clientgui/skins/WorldCommunityGrid/graphic/btnAddProject.bmp differ diff --git a/clientgui/skins/WorldCommunityGrid/graphic/btnMessages.bmp b/clientgui/skins/WorldCommunityGrid/graphic/btnMessages.bmp new file mode 100644 index 0000000000..67d876a622 Binary files /dev/null and b/clientgui/skins/WorldCommunityGrid/graphic/btnMessages.bmp differ diff --git a/clientgui/skins/WorldCommunityGrid/graphic/btnPause.bmp b/clientgui/skins/WorldCommunityGrid/graphic/btnPause.bmp new file mode 100644 index 0000000000..e2800287d1 Binary files /dev/null and b/clientgui/skins/WorldCommunityGrid/graphic/btnPause.bmp differ diff --git a/clientgui/skins/WorldCommunityGrid/graphic/btnResume.bmp b/clientgui/skins/WorldCommunityGrid/graphic/btnResume.bmp new file mode 100644 index 0000000000..40bd9fe177 Binary files /dev/null and b/clientgui/skins/WorldCommunityGrid/graphic/btnResume.bmp differ diff --git a/clientgui/skins/WorldCommunityGrid/graphic/btnShowGraphic.png b/clientgui/skins/WorldCommunityGrid/graphic/btnShowGraphic.png new file mode 100644 index 0000000000..cd8a43ad02 Binary files /dev/null and b/clientgui/skins/WorldCommunityGrid/graphic/btnShowGraphic.png differ diff --git a/clientgui/skins/WorldCommunityGrid/graphic/btnShowGraphicClick.png b/clientgui/skins/WorldCommunityGrid/graphic/btnShowGraphicClick.png new file mode 100644 index 0000000000..69d19a1722 Binary files /dev/null and b/clientgui/skins/WorldCommunityGrid/graphic/btnShowGraphicClick.png differ diff --git a/clientgui/skins/WorldCommunityGrid/graphic/statBoinc.png b/clientgui/skins/WorldCommunityGrid/graphic/statBoinc.png new file mode 100644 index 0000000000..8ae8757a33 Binary files /dev/null and b/clientgui/skins/WorldCommunityGrid/graphic/statBoinc.png differ diff --git a/clientgui/skins/WorldCommunityGrid/skin.xml b/clientgui/skins/WorldCommunityGrid/skin.xml index 6376b28b3e..145fe93507 100644 --- a/clientgui/skins/WorldCommunityGrid/skin.xml +++ b/clientgui/skins/WorldCommunityGrid/skin.xml @@ -16,20 +16,20 @@ graphic/btnPreferences.bmp - - graphic/btnAttachProject.bmp - + + graphic/btnAddProject.bmp + graphic/btnAdvancedView.bmp - graphic/play.bmp + graphic/btnResume.bmp - graphic/pause.bmp + graphic/btnPause.bmp - graphic/messages.bmp + graphic/btnMessages.bmp graphic/btnOpen.bmp @@ -56,6 +56,10 @@ graphic/btnCollapse.png graphic/btnCollapseClick.png + + graphic/btnShowGraphic.png + graphic/btnShowGraphicClick.png + @@ -82,6 +86,9 @@ graphic/19_16_prdct.png + + graphic/statBoinc.png + graphic/project_image.bmp diff --git a/clientgui/skins/default/graphic/Thumbs.db b/clientgui/skins/default/graphic/Thumbs.db index 3c1e34ada7..ae9ff33f78 100644 Binary files a/clientgui/skins/default/graphic/Thumbs.db and b/clientgui/skins/default/graphic/Thumbs.db differ diff --git a/clientgui/skins/default/graphic/btnAddProject.bmp b/clientgui/skins/default/graphic/btnAddProject.bmp new file mode 100644 index 0000000000..dfade8ad61 Binary files /dev/null and b/clientgui/skins/default/graphic/btnAddProject.bmp differ diff --git a/clientgui/skins/default/graphic/btnCollapse.png b/clientgui/skins/default/graphic/btnCollapse.png index 6cb4da7f49..bb0a891884 100644 Binary files a/clientgui/skins/default/graphic/btnCollapse.png and b/clientgui/skins/default/graphic/btnCollapse.png differ diff --git a/clientgui/skins/default/graphic/btnCollapseClick.png b/clientgui/skins/default/graphic/btnCollapseClick.png index 66255a97c8..29e0adaed7 100644 Binary files a/clientgui/skins/default/graphic/btnCollapseClick.png and b/clientgui/skins/default/graphic/btnCollapseClick.png differ diff --git a/clientgui/skins/default/graphic/btnMessages.bmp b/clientgui/skins/default/graphic/btnMessages.bmp new file mode 100644 index 0000000000..198cbfc7c6 Binary files /dev/null and b/clientgui/skins/default/graphic/btnMessages.bmp differ diff --git a/clientgui/skins/default/graphic/btnPause.bmp b/clientgui/skins/default/graphic/btnPause.bmp new file mode 100644 index 0000000000..51b0035681 Binary files /dev/null and b/clientgui/skins/default/graphic/btnPause.bmp differ diff --git a/clientgui/skins/default/graphic/btnResume.bmp b/clientgui/skins/default/graphic/btnResume.bmp new file mode 100644 index 0000000000..4f49ab355b Binary files /dev/null and b/clientgui/skins/default/graphic/btnResume.bmp differ diff --git a/clientgui/skins/default/graphic/btnShowGraphic.png b/clientgui/skins/default/graphic/btnShowGraphic.png new file mode 100644 index 0000000000..264b46216c Binary files /dev/null and b/clientgui/skins/default/graphic/btnShowGraphic.png differ diff --git a/clientgui/skins/default/graphic/btnShowGraphicClick.png b/clientgui/skins/default/graphic/btnShowGraphicClick.png new file mode 100644 index 0000000000..a2ca1aaffe Binary files /dev/null and b/clientgui/skins/default/graphic/btnShowGraphicClick.png differ diff --git a/clientgui/skins/default/graphic/statBoinc.png b/clientgui/skins/default/graphic/statBoinc.png new file mode 100644 index 0000000000..8ae8757a33 Binary files /dev/null and b/clientgui/skins/default/graphic/statBoinc.png differ diff --git a/clientgui/skins/default/skin.xml b/clientgui/skins/default/skin.xml index cd5df2e756..e9877fe665 100644 --- a/clientgui/skins/default/skin.xml +++ b/clientgui/skins/default/skin.xml @@ -16,20 +16,20 @@ graphic/btnPreferences.bmp - - graphic/btnAttachProject.bmp - + + graphic/btnAddProject.bmp + graphic/btnAdvancedView.bmp - graphic/play.bmp + graphic/btnResume.bmp - graphic/pause.bmp + graphic/btnPause.bmp - graphic/messages.bmp + graphic/btnMessages.bmp graphic/btnOpen.bmp @@ -56,6 +56,10 @@ graphic/btnCollapse.png graphic/btnCollapseClick.png + + graphic/btnShowGraphic.png + graphic/btnShowGraphicClick.png + @@ -82,6 +86,9 @@ graphic/19_16_prdct.png + + graphic/statBoinc.png + graphic/project_image.bmp