3
* $Id: ventanacontrollogs.h 3781 2011-04-27 10:13:05Z tovar $
6
* Copyright 2008-10 MetaEmotion S.L. All rights reserved.
7
* http://ginkgo-cadx.com
9
* This file is licensed under LGPL v3 license.
10
* See License.txt for details
16
#include <api/icontroladorlog.h>
17
#include <main/controllers/log4cplus/logdefines.h>
19
#include "ventanacontrollogsbase.h"
21
//DEFINE_EVENT_TYPE(wxEVT_LOG_ASYNC)
23
BEGIN_DECLARE_EVENT_TYPES()
24
DECLARE_EVENT_TYPE( wxEVT_LOG_ASYNC, wxNewEventType() )
25
END_DECLARE_EVENT_TYPES()*/
27
const wxEventType wxEVT_LOG_ASYNC = wxNewEventType();
29
extern const wxEventType wxEVT_LOG_ASYNC;
31
class LogAsyncEvent : public wxEvent
34
LogAsyncEvent() { SetEventType(wxEVT_LOG_ASYNC); }
36
LogAsyncEvent(const GNC::GCS::Logging::LogEvent& logEvent) : LogEvent(logEvent) { SetEventType(wxEVT_LOG_ASYNC); }
38
LogAsyncEvent(const LogAsyncEvent& event) : wxEvent(event), LogEvent(event.LogEvent) {}
40
virtual wxEvent *Clone() const { return new LogAsyncEvent(*this); }
42
const GNC::GCS::Logging::LogEvent LogEvent;
45
DECLARE_DYNAMIC_CLASS_NO_ASSIGN(LogAsyncEvent)
48
typedef void (wxEvtHandler::*LogAsyncEventFunction)(LogAsyncEvent&);
50
#define LogAsyncEventHandler(func) \
51
(wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(LogAsyncEventFunction, &func)
53
#define EVT_LOG_ASYNC(func) \
54
wx__DECLARE_EVT0(wxEVT_LOG_ASYNC, LogAsyncEventHandler(func))
59
class VentanaControlLogs : public VentanaControlLogsBase, public GNC::GCS::Logging::ILogger
63
static VentanaControlLogs* Instance();
64
static void CerrarSiAbierta();
67
//region Interfaz ILogger
69
virtual void Append(const GNC::GCS::Logging::LogEvent& le);
74
static VentanaControlLogs* m_pInstance;
75
GNC::GCS::IControladorLog::MapaLogLevels m_MapaLogLevels;
78
~VentanaControlLogs();
80
virtual void OnClose(wxCloseEvent& event);
81
virtual void OnLogAsync(LogAsyncEvent& event);
83
virtual void OnLimpiarClick( wxCommandEvent& /*event*/ ) { LimpiarRegistros(); }
84
virtual void OnLimpiarRegistros( wxCommandEvent& /*event*/ ) { LimpiarRegistros(); }
86
virtual void OnGuardarRegistros( wxCommandEvent& event );
87
virtual void OnNivelChoice( wxCommandEvent& event );
89
virtual void OnSalirClick( wxCommandEvent& event );
90
virtual void OnKeyDown( wxKeyEvent& event );
92
virtual void OnTreeItemMenu(wxTreeEvent &event);
93
virtual void OnShowPlainText(wxCommandEvent &event);
95
void LimpiarRegistros();