~ubuntu-branches/ubuntu/quantal/ginkgocadx/quantal

« back to all changes in this revision

Viewing changes to src/cadxcore/main/gui/progress/paneltarea.cpp

  • Committer: Package Import Robot
  • Author(s): Andreas Tille
  • Date: 2011-11-09 12:29:00 UTC
  • mfrom: (1.1.4)
  • Revision ID: package-import@ubuntu.com-20111109122900-idkd9vvhr31whz8z
Tags: 2.6.0.0~rc-1
* New upstream version
  Closes: #647413
* Rebuild against recent insighttoolkit
  Closes: #648167

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  
3
 
 *  $Id: paneltarea.cpp 3526 2011-03-16 19:56:19Z carlos $
 
3
 *  $Id: paneltarea.cpp 4366 2011-11-04 09:14:49Z tovar $
4
4
 *  Ginkgo CADx Project
5
5
 *
6
6
 *  Copyright 2008-10 MetaEmotion S.L. All rights reserved.
13
13
 */
14
14
#include "paneltarea.h"
15
15
#include <main/controllers/controladorcomandos.h>
 
16
#include <wx/ginkgostyle/ginkgostyle.h>
 
17
#include <wx/image.h>
 
18
#include <wx/dc.h>
 
19
#include <wx/aui/auibar.h>
 
20
 
 
21
#include <resources/ginkgoresourcemanager.h>
 
22
 
 
23
#define ID_BUTTON_INIT_STOP 0
 
24
 
 
25
namespace GNC {
 
26
        namespace GUI {
 
27
                class PanelTareaToolBar:public wxAuiToolBar{
 
28
                public:
 
29
                        PanelTareaToolBar(wxWindow* pParent, const wxColor& color = wxColor(0x40, 0x40, 0x40)): wxAuiToolBar(pParent,wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_DEFAULT_STYLE)
 
30
                        {
 
31
                                SetToolBitmapSize(wxSize(16,16));
 
32
                                wxAuiDefaultToolBarArt* pToolArt= new wxAuiDefaultToolBarArt();
 
33
                #if defined(USE_PATCHED_LIBS) && !defined(__WXOSX__)
 
34
                                pToolArt->SetBaseColor(color);
 
35
                #endif
 
36
                                SetArtProvider(pToolArt);
 
37
                        }
 
38
 
 
39
                        ~PanelTareaToolBar()
 
40
                        {
 
41
                        }
 
42
                };
 
43
        }
 
44
}
16
45
 
17
46
GNC::GUI::PanelTarea::PanelTarea( wxWindow* pPadre,long pidTarea) : PanelTareaBase(pPadre)
18
47
{
19
48
        m_PIDTarea = pidTarea;
 
49
        m_pProgress->SetColorSchema(GinkgoGauge::TCS_BLUE);
 
50
 
 
51
        GNC::GUI::PanelTareaToolBar* m_pToolBar = new GNC::GUI::PanelTareaToolBar(this, GetBackgroundColour());
 
52
        m_pToolBar->AddTool(ID_BUTTON_INIT_STOP,_("Start"),GinkgoResourcesManager::BarraCine::GetIcoStop(),_("Stop"));
 
53
        m_pToolBar->Connect(ID_BUTTON_INIT_STOP,wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler( GNC::GUI::PanelTarea::OnTareaCancelarClick),NULL,this);
 
54
 
 
55
        m_pToolBar->Realize();
 
56
        GetSizer()->Add(m_pToolBar,0, wxALIGN_CENTER_VERTICAL|wxEXPAND,0);
 
57
 
 
58
        m_pProgress->SetMinSize(wxSize(-1, m_pToolBar->GetSize().y));
 
59
        Layout();
20
60
}
21
61
 
22
62
GNC::GUI::PanelTarea::~PanelTarea()
24
64
        
25
65
}
26
66
 
 
67
void GNC::GUI::PanelTarea::SetProgress(const wxString& text, float progress)
 
68
{
 
69
        m_pProgress->SetStatus(text);
 
70
        m_pProgress->SetProgress(progress);
 
71
}
 
72
 
 
73
wxString GNC::GUI::PanelTarea::GetStatus()
 
74
{
 
75
        return m_pProgress->GetStatus();
 
76
}
 
77
float GNC::GUI::PanelTarea::GetProgress()
 
78
{
 
79
        return m_pProgress->GetProgress();
 
80
}
 
81
 
27
82
void GNC::GUI::PanelTarea::OnTareaCancelarClick(wxCommandEvent &)
28
83
{
29
84
        GNC::GCS::ControladorComandos::Instance()->AbortarComando(m_PIDTarea, false);