-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcbTerminal.cpp
More file actions
73 lines (63 loc) · 2.02 KB
/
cbTerminal.cpp
File metadata and controls
73 lines (63 loc) · 2.02 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/***************************************************************
* Name: cbTerminal
* Purpose: cbTerminal Code::Blocks plugin
* Most of the interactions with C::B are handled here.
* Author: Jerome ANTOINE
* Created: 2007-10-08
* Copyright: Jerome ANTOINE
* Copyright: Christo Joseph
* License: GPL
**************************************************************/
#include <sdk.h> // Code::Blocks SDK
#ifndef CB_PRECOMP
#include <wx/combobox.h>
#include <wx/menu.h>
#include <wx/toolbar.h>
#include <wx/xrc/xmlres.h>
#endif
#include "cbTerminal.hpp"
#include "cbTerminalView.hpp"
// Register the plugin with Code::Blocks.
// We are using an anonymous namespace so we don't litter the global one.
namespace
{
PluginRegistrant<cbTerminal> reg(_T("cbTerminal"));
}
// constructor
cbTerminal::cbTerminal()
:m_pcbTerminalView(nullptr),
m_pViewManager(nullptr)
{
}
// destructor
cbTerminal::~cbTerminal()
{
}
void cbTerminal::OnAttach()
{
// NOTE: after this function, the inherited member variable
// m_IsAttached will be TRUE...
// You should check for it in other functions, because if it
// is FALSE, it means that the application did *not* "load"
// (see: does not need) this plugin...
#if LOGGING
wxLog::EnableLogging(true);
m_pLog = new wxLogWindow(Manager::Get()->GetAppWindow(), _T(" cbTerminal Plugin"), true, false);
wxLog::SetActiveTarget( m_pLog);
m_pLog->Flush();
m_pLog->GetFrame()->SetSize(20,30,600,300);
LOGIT( _T("cbTerminal Plugin Logging Started"));
#endif
m_pcbTerminalView = new cbTerminalView(*this);
m_pViewManager = cbTerminalViewManagerBase::BuildcbTerminalViewManagerBase(m_pcbTerminalView, true, cbTerminalViewManagerBase::TypeMessagesNotebook);
}
void cbTerminal::OnRelease(bool /*appShutDown*/)
{
if (m_pcbTerminalView != nullptr)
{
m_pViewManager->RemoveViewFromManager();
m_pcbTerminalView = nullptr;
}
delete m_pViewManager;
m_pViewManager = nullptr;
}