-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogFrame.cpp
32 lines (27 loc) · 1.08 KB
/
LogFrame.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#include "stdafx.h"
#include "LogFrame.h"
LogFrame::LogFrame(wxWindow* parent, const wxSize& sz) : wxTextCtrl(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, sz, wxTE_MULTILINE | wxTE_READONLY), _logRedirector(this)
{
#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR <= 2
Ogre::LogManager::getSingleton().addListener(this);
#else
Ogre::LogManager::getSingleton().getDefaultLog()->addListener(this);
#endif
}
LogFrame::~LogFrame()
{
#if OGRE_VERSION_MAJOR == 1 && OGRE_VERSION_MINOR <= 2
Ogre::LogManager::getSingleton().removeListener(this);
#else
Ogre::LogManager::getSingleton().getDefaultLog()->removeListener(this);
#endif
}
void LogFrame::write(const Ogre::String &name, const Ogre::String &message, Ogre::LogMessageLevel lml /* = Ogre::LML_NORMAL */, bool maskDebug /* = false */)
{
AppendText(_("\n") + wxString(message.c_str(), wxConvUTF8));
}
void LogFrame::messageLogged(const Ogre::String &message, Ogre::LogMessageLevel lml,
bool maskDebug, const Ogre::String &logName)
{
AppendText(_("\n") + wxString(message.c_str(), wxConvUTF8));
}