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.,
|
|
|
|
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
|
|
|
#ifndef _VIEWTABPAGE_H_
|
|
|
|
#define _VIEWTABPAGE_H_
|
|
|
|
|
|
|
|
#if defined(__GNUG__) && !defined(__APPLE__)
|
|
|
|
#pragma interface "sg_ViewTabPage.cpp"
|
|
|
|
#endif
|
|
|
|
|
2006-09-29 16:01:17 +00:00
|
|
|
#include <vector>
|
|
|
|
#include "common/wxFlatNotebook.h"
|
|
|
|
#include "BOINCGUIApp.h"
|
|
|
|
#include "sg_ImageLoader.h"
|
2006-10-10 02:53:25 +00:00
|
|
|
#include "sg_SkinClass.h"
|
2006-09-29 16:01:17 +00:00
|
|
|
|
|
|
|
|
2006-07-11 23:19:53 +00:00
|
|
|
class MyCanvas : public wxScrolledWindow
|
|
|
|
{
|
|
|
|
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;
|
|
|
|
class CStaticLine;
|
2006-08-10 19:32:47 +00:00
|
|
|
class CStaticLine;
|
|
|
|
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
|
|
|
//Skin Class
|
|
|
|
SkinClass *appSkin;
|
|
|
|
// btns ////////////
|
|
|
|
////////////////////
|
|
|
|
// animation
|
2006-09-15 16:47:04 +00:00
|
|
|
wxBitmap* btmpBgAnim;
|
2006-08-10 19:32:47 +00:00
|
|
|
CImageButton * btnAminBg;
|
|
|
|
//line
|
2006-08-07 15:33:03 +00:00
|
|
|
CStaticLine *lnProjName;
|
|
|
|
//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();
|
2006-08-07 15:33:03 +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-15 20:15:44 +00:00
|
|
|
void DrawBackImg(wxEraseEvent& event,wxWindow *win,wxBitmap bitMap,int opz);
|
2006-07-11 23:19:53 +00:00
|
|
|
|
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();
|
|
|
|
wxString FormatText(const wxString& text, wxDC* dc);
|
2006-09-29 16:01:17 +00:00
|
|
|
std::vector<wxBitmap> GetSlideShow();
|
|
|
|
wxWindow* wSlideShow;
|
|
|
|
MyCanvas* m_canvas;
|
2006-10-12 02:18:08 +00:00
|
|
|
int scheduler_rpc_in_progress;
|
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));
|
|
|
|
|
|
|
|
protected:
|
2006-07-11 23:19:53 +00:00
|
|
|
|
2006-10-10 02:53:25 +00:00
|
|
|
private:
|
|
|
|
SkinClass *appSkin;
|
|
|
|
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
|
|
|
|
|