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
|
|
|
|
|
|
|
|
class MyCanvas : public wxScrolledWindow
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size);
|
|
|
|
void OnPaint(wxPaintEvent& event);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
|
|
|
#include "BOINCGUIApp.h"
|
|
|
|
#include "common/wxAnimate.h"
|
|
|
|
#include "common/wxFlatNotebook.h"
|
2006-08-07 15:33:03 +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;
|
2006-08-10 19:32:47 +00:00
|
|
|
wxString dirPref;
|
2006-07-11 23:19:53 +00:00
|
|
|
// btns ////////////
|
|
|
|
////////////////////
|
|
|
|
// animation
|
|
|
|
wxBitmap *btmpBgAnim;
|
2006-08-10 19:32:47 +00:00
|
|
|
wxBitmap fileImgBuf[1];
|
|
|
|
wxImage *g_projBg;
|
2006-07-11 23:19:53 +00:00
|
|
|
wxWindow *wAnimWk1;
|
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
|
|
|
|
wxBitmap *btmpComponentBg;
|
2006-08-26 04:17:56 +00:00
|
|
|
RESULT* resultWU;
|
2006-07-11 23:19:53 +00:00
|
|
|
|
|
|
|
CViewTabPage();
|
|
|
|
CViewTabPage(
|
2006-08-26 04:17:56 +00:00
|
|
|
wxFlatNotebook* parent, RESULT* result, std::string name,std::string url
|
2006-07-11 23:19:53 +00:00
|
|
|
);
|
|
|
|
~CViewTabPage();
|
|
|
|
|
|
|
|
void LoadSkinImages();
|
|
|
|
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; }
|
|
|
|
wxGIFAnimationCtrl* GetAnimationCtrl() const { return m_animationCtrl; }
|
|
|
|
|
|
|
|
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);
|
|
|
|
void DrawBackImg(wxEraseEvent& event,wxWindow *win,wxBitmap & bitMap,int opz);
|
2006-07-11 23:19:53 +00:00
|
|
|
|
|
|
|
MyCanvas* m_canvas;
|
|
|
|
wxGIFAnimationCtrl* m_animationCtrl;
|
|
|
|
#if 0
|
|
|
|
wxAnimationPlayer m_player;
|
|
|
|
wxGIFAnimation m_animation;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|