~ubuntu-branches/ubuntu/wily/ginkgocadx/wily-proposed

« back to all changes in this revision

Viewing changes to src/cadxcore/main/gui/logcontrolwindow/ventanacontrollogs.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Tille
  • Date: 2011-05-02 08:09:26 UTC
  • Revision ID: james.westby@ubuntu.com-20110502080926-bql5wep49c7hg91t
Tags: upstream-2.4.1.1
ImportĀ upstreamĀ versionĀ 2.4.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 *  
 
3
 *  $Id: ventanacontrollogs.h 3781 2011-04-27 10:13:05Z tovar $
 
4
 *  Ginkgo CADx Project
 
5
 *
 
6
 *  Copyright 2008-10 MetaEmotion S.L. All rights reserved.
 
7
 *  http://ginkgo-cadx.com
 
8
 *
 
9
 *  This file is licensed under LGPL v3 license.
 
10
 *  See License.txt for details
 
11
 *
 
12
 *
 
13
 */
 
14
#pragma once
 
15
#include <list>
 
16
#include <api/icontroladorlog.h>
 
17
#include <main/controllers/log4cplus/logdefines.h>
 
18
#include <wx/event.h>
 
19
#include "ventanacontrollogsbase.h"
 
20
 
 
21
//DEFINE_EVENT_TYPE(wxEVT_LOG_ASYNC)
 
22
/*
 
23
BEGIN_DECLARE_EVENT_TYPES()
 
24
DECLARE_EVENT_TYPE( wxEVT_LOG_ASYNC, wxNewEventType() )
 
25
END_DECLARE_EVENT_TYPES()*/
 
26
 
 
27
const wxEventType wxEVT_LOG_ASYNC = wxNewEventType();
 
28
 
 
29
extern const wxEventType wxEVT_LOG_ASYNC;
 
30
 
 
31
class LogAsyncEvent : public wxEvent
 
32
{
 
33
public:
 
34
        LogAsyncEvent() { SetEventType(wxEVT_LOG_ASYNC); }
 
35
 
 
36
        LogAsyncEvent(const GNC::GCS::Logging::LogEvent& logEvent) : LogEvent(logEvent) { SetEventType(wxEVT_LOG_ASYNC); }
 
37
 
 
38
        LogAsyncEvent(const LogAsyncEvent& event) : wxEvent(event), LogEvent(event.LogEvent) {}
 
39
 
 
40
        virtual wxEvent *Clone() const { return new LogAsyncEvent(*this); }
 
41
 
 
42
    const GNC::GCS::Logging::LogEvent LogEvent;
 
43
 
 
44
private:
 
45
    DECLARE_DYNAMIC_CLASS_NO_ASSIGN(LogAsyncEvent)
 
46
};
 
47
 
 
48
typedef void (wxEvtHandler::*LogAsyncEventFunction)(LogAsyncEvent&);
 
49
 
 
50
#define LogAsyncEventHandler(func) \
 
51
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(LogAsyncEventFunction, &func)
 
52
 
 
53
#define EVT_LOG_ASYNC(func) \
 
54
wx__DECLARE_EVT0(wxEVT_LOG_ASYNC, LogAsyncEventHandler(func))
 
55
 
 
56
namespace GNC {
 
57
        namespace GUI {
 
58
 
 
59
                class VentanaControlLogs : public VentanaControlLogsBase, public GNC::GCS::Logging::ILogger
 
60
                {
 
61
                public:
 
62
                        //singleton
 
63
                        static VentanaControlLogs* Instance();
 
64
                        static void CerrarSiAbierta();
 
65
                        void Refrescar();
 
66
 
 
67
                        //region Interfaz ILogger
 
68
 
 
69
                        virtual void Append(const GNC::GCS::Logging::LogEvent& le);
 
70
 
 
71
                        //endregion
 
72
 
 
73
                protected:
 
74
                        static VentanaControlLogs*  m_pInstance;
 
75
                        GNC::GCS::IControladorLog::MapaLogLevels m_MapaLogLevels;
 
76
 
 
77
                        VentanaControlLogs();
 
78
                        ~VentanaControlLogs();
 
79
 
 
80
                        virtual void OnClose(wxCloseEvent& event);
 
81
                        virtual void OnLogAsync(LogAsyncEvent& event);
 
82
 
 
83
                        virtual void OnLimpiarClick( wxCommandEvent& /*event*/ ) { LimpiarRegistros(); }
 
84
                        virtual void OnLimpiarRegistros( wxCommandEvent& /*event*/ ) { LimpiarRegistros(); }
 
85
 
 
86
                        virtual void OnGuardarRegistros( wxCommandEvent& event );
 
87
                        virtual void OnNivelChoice( wxCommandEvent& event );
 
88
 
 
89
                        virtual void OnSalirClick( wxCommandEvent& event );
 
90
                        virtual void OnKeyDown( wxKeyEvent& event );
 
91
 
 
92
                        virtual void OnTreeItemMenu(wxTreeEvent &event);
 
93
                        virtual void OnShowPlainText(wxCommandEvent &event);
 
94
 
 
95
                        void LimpiarRegistros();
 
96
 
 
97
                };
 
98
        }
 
99
}