2006-07-11 23:19:53 +00:00
|
|
|
// Berkeley Open Infrastructure for Network Computing
|
|
|
|
// http://boinc.berkeley.edu
|
|
|
|
// Copyright (C) 2005 University of California
|
|
|
|
//
|
|
|
|
// This is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Lesser General Public
|
|
|
|
// License as published by the Free Software Foundation;
|
|
|
|
// either version 2.1 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This software is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
// See the GNU Lesser General Public License for more details.
|
|
|
|
//
|
|
|
|
// To view the GNU Lesser General Public License visit
|
|
|
|
// http://www.gnu.org/copyleft/lesser.html
|
|
|
|
// or write to the Free Software Foundation, Inc.,
|
2007-10-09 11:35:47 +00:00
|
|
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
2006-07-11 23:19:53 +00:00
|
|
|
|
|
|
|
#ifndef _VIEWTABPAGE_H_
|
|
|
|
#define _VIEWTABPAGE_H_
|
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma interface "sg_ViewTabPage.cpp"
|
|
|
|
#endif
|
|
|
|
|
2006-11-02 11:59:42 +00:00
|
|
|
#ifdef __WXMAC__
|
2006-11-08 17:38:27 +00:00
|
|
|
#define SMALL_FONT 12
|
|
|
|
#define MEDIUM_FONT 16
|
|
|
|
#define LARGE_FONT 20
|
2006-11-02 11:59:42 +00:00
|
|
|
#else
|
2006-11-08 17:38:27 +00:00
|
|
|
#define SMALL_FONT 9
|
|
|
|
#define MEDIUM_FONT 12
|
|
|
|
#define LARGE_FONT 16
|
2006-11-02 11:59:42 +00:00
|
|
|
#endif
|
2006-11-08 17:38:27 +00:00
|
|
|
|
|
|
|
class MyCanvas : public wxWindow
|
2006-07-11 23:19:53 +00:00
|
|
|
{
|
|
|
|
public:
|
2006-09-29 16:01:17 +00:00
|
|
|
MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size, std::vector<wxBitmap> images);
|
2006-07-11 23:19:53 +00:00
|
|
|
void OnPaint(wxPaintEvent& event);
|
2006-10-10 02:53:25 +00:00
|
|
|
void AdvanceSlide();
|
|
|
|
void ReloadSlideShow(std::vector<wxBitmap> images);
|
2006-07-11 23:19:53 +00:00
|
|
|
|
|
|
|
private:
|
2006-09-29 16:01:17 +00:00
|
|
|
std::vector<ImageLoader*> vSlideShow;
|
2006-10-05 13:40:12 +00:00
|
|
|
int currentImageIndex;
|
2006-10-10 02:53:25 +00:00
|
|
|
std::vector<wxBitmap> ssImages;
|
|
|
|
bool reloadSlideShow;
|
|
|
|
void LoadSlideShow();
|
2006-07-11 23:19:53 +00:00
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
};
|
|
|
|
|
2006-08-07 15:33:03 +00:00
|
|
|
class CProgressBar;
|
2006-10-28 09:02:46 +00:00
|
|
|
class CTransparentStaticLine;
|
2006-08-10 19:32:47 +00:00
|
|
|
class CImageButton;
|
2006-10-10 02:53:25 +00:00
|
|
|
class WorkunitNotebook;
|
2006-08-10 19:32:47 +00:00
|
|
|
|
2006-07-11 23:19:53 +00:00
|
|
|
class CViewTabPage : public wxPanel {
|
|
|
|
DECLARE_DYNAMIC_CLASS( CViewTabPage )
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2006-07-31 13:59:21 +00:00
|
|
|
bool isAlive;
|
2006-07-11 23:19:53 +00:00
|
|
|
// btns ////////////
|
|
|
|
////////////////////
|
|
|
|
// animation
|
2006-09-15 16:47:04 +00:00
|
|
|
wxBitmap* btmpBgAnim;
|
2006-08-10 19:32:47 +00:00
|
|
|
CImageButton * btnAminBg;
|
|
|
|
//line
|
2006-10-28 09:02:46 +00:00
|
|
|
CTransparentStaticLine *lnProjName;
|
2006-08-07 15:33:03 +00:00
|
|
|
//strings
|
|
|
|
wxString projName;
|
|
|
|
wxString projectFrName;
|
|
|
|
wxString wrkUnitName;
|
|
|
|
wxString gaugePercent;
|
|
|
|
wxString elapsedTimeValue;
|
|
|
|
wxString timeRemainingValue;
|
|
|
|
//wxGauge *gaugeWUMain;
|
|
|
|
CProgressBar *gaugeWUMain;
|
2006-07-11 23:19:53 +00:00
|
|
|
wxStaticText *lblWrkUnitName;
|
2006-07-24 22:10:28 +00:00
|
|
|
wxStaticText *lblProjectFrName;
|
2006-08-07 15:33:03 +00:00
|
|
|
wxString percStr;
|
2006-08-26 04:17:56 +00:00
|
|
|
wxFloat64 percNum;
|
2006-08-07 15:33:03 +00:00
|
|
|
// bg
|
2006-08-26 04:17:56 +00:00
|
|
|
RESULT* resultWU;
|
2006-07-11 23:19:53 +00:00
|
|
|
|
|
|
|
CViewTabPage();
|
|
|
|
CViewTabPage(
|
2006-10-10 02:53:25 +00:00
|
|
|
WorkunitNotebook* parent, RESULT* result, std::string name,std::string url
|
2006-07-11 23:19:53 +00:00
|
|
|
);
|
|
|
|
~CViewTabPage();
|
|
|
|
|
|
|
|
void CreatePage();
|
|
|
|
void UpdateInterface();
|
2006-07-24 22:10:28 +00:00
|
|
|
void ReskinInterface();
|
2006-07-20 14:44:33 +00:00
|
|
|
void OnWorkShowGraphics();
|
2007-03-15 10:00:50 +00:00
|
|
|
void OnPaint(wxPaintEvent& event);
|
2006-08-10 19:32:47 +00:00
|
|
|
void OnLeftUp(wxMouseEvent& event);
|
2006-08-07 15:33:03 +00:00
|
|
|
void DrawText();
|
2006-08-10 19:32:47 +00:00
|
|
|
void OnImageButton();
|
2006-07-11 23:19:53 +00:00
|
|
|
|
|
|
|
// Setters
|
|
|
|
void SetTabName(const std::string nme) { m_name = nme; }
|
|
|
|
// Getters
|
|
|
|
std::string GetTabName() { return m_name; }
|
|
|
|
|
|
|
|
// Animation
|
|
|
|
MyCanvas* GetCanvas() const { return m_canvas; }
|
|
|
|
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
|
|
|
protected:
|
2006-08-07 15:33:03 +00:00
|
|
|
|
2006-07-11 23:19:53 +00:00
|
|
|
//tab identifier
|
|
|
|
std::string m_name;
|
2006-07-21 18:05:43 +00:00
|
|
|
std::string m_prjUrl;
|
2006-07-24 22:10:28 +00:00
|
|
|
bool m_hasGraphic;
|
2006-07-11 23:19:53 +00:00
|
|
|
|
|
|
|
wxInt32 FormatCPUTime( RESULT* rslt, wxString& strBuffer ) const;
|
|
|
|
wxInt32 FormatTimeToCompletion( RESULT* rslt, wxString& strBuffer ) const;
|
|
|
|
void SGUITimeFormat( float fBuffer, wxString& strBuffer) const;
|
2006-08-07 15:33:03 +00:00
|
|
|
|
|
|
|
void OnEraseBackground(wxEraseEvent& event);
|
2006-09-29 16:01:17 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
void CreateSlideShowWindow();
|
2006-10-05 13:40:12 +00:00
|
|
|
void LoadSlideShow(std::vector<wxBitmap> *vSlideShow);
|
2006-10-10 02:53:25 +00:00
|
|
|
bool Downloading();
|
2006-10-12 02:18:08 +00:00
|
|
|
int ComputeState();
|
2006-11-08 17:38:27 +00:00
|
|
|
void WriteText(wxDC* dc);
|
|
|
|
void FormatText(const wxString& title, const wxString& text, wxDC* dc, wxPoint pos, int col_width = 0, wxFont font = wxFont(SMALL_FONT,74,90,90,0,wxT("Arial")));
|
2006-09-29 16:01:17 +00:00
|
|
|
std::vector<wxBitmap> GetSlideShow();
|
|
|
|
wxWindow* wSlideShow;
|
|
|
|
MyCanvas* m_canvas;
|
2006-10-16 20:46:57 +00:00
|
|
|
double project_files_downloaded_time;
|
2006-07-11 23:19:53 +00:00
|
|
|
|
|
|
|
};
|
|
|
|
|
2006-10-10 02:53:25 +00:00
|
|
|
class WorkunitNotebook : public wxFlatNotebook {
|
|
|
|
|
|
|
|
public:
|
|
|
|
WorkunitNotebook(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxT("FlatNotebook"));
|
|
|
|
~WorkunitNotebook();
|
|
|
|
void ReskinAppGUI();
|
|
|
|
void Update();
|
|
|
|
void OnChangeSlide(wxTimerEvent& WXUNUSED(event));
|
2007-03-15 10:00:50 +00:00
|
|
|
void OnTabChanged(wxFlatNotebookEvent& WXUNUSED(event));
|
|
|
|
|
2006-10-10 02:53:25 +00:00
|
|
|
|
|
|
|
protected:
|
2006-07-11 23:19:53 +00:00
|
|
|
|
2006-10-10 02:53:25 +00:00
|
|
|
private:
|
|
|
|
wxFlatNotebookImageList m_ImageList;
|
|
|
|
wxTimer* changeSlideTimer;
|
|
|
|
std::vector<CViewTabPage*> m_windows; // vector of all window tabs created for notebook
|
|
|
|
void AddTab(RESULT* result);
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
|
|
|
};
|
2006-07-11 23:19:53 +00:00
|
|
|
#endif
|
|
|
|
|