forked from teto/cbalert
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCBalert.cpp
More file actions
73 lines (60 loc) · 2.25 KB
/
Copy pathCBalert.cpp
File metadata and controls
73 lines (60 loc) · 2.25 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
73
#include <sdk.h> // Code::Blocks SDK
#include <configurationpanel.h>
#include "CBalert.h"
#include <logmanager.h>
// Register the plugin with Code::Blocks.
// We are using an anonymous namespace so we don't litter the global one.
namespace
{
PluginRegistrant<CBalert> reg(_T("CBalert"));
}
// constructor
CBalert::CBalert()
{
// Make sure our resources are available.
// In the generated boilerplate code we have no resources but when
// we add some, it will be nice that this code is in place already ;)
if(!Manager::LoadResource(_T("CBalert.zip")))
{
NotifyMissingFile(_T("CBalert.zip"));
}
}
// destructor
CBalert::~CBalert()
{
}
void CBalert::Alert(CodeBlocksEvent& event)
{
// wxBell();
//http://docs.wxwidgets.org/trunk/classwx_top_level_window.html#a749d23ea08f6273fb93fe2c003b650b3
//(wxFrame*)
Manager::Get()->GetLogManager()->Log( _("request user attention") );
wxFrame* frame = Manager::Get()->GetAppFrame();
frame->RequestUserAttention();
// wxWindowList & GetChildren ()
// WxWindow* FindWindow
}
// TODO on execution, run
// http://wiki.codeblocks.org/index.php?title=Code::Blocks_SDK_events
void CBalert::OnAttach()
{
// do whatever initialization you need for your plugin
// 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...
cbEventFunctor<CBalert, CodeBlocksEvent> *functor = new cbEventFunctor<CBalert, CodeBlocksEvent>(this, &CBalert::Alert);
//Manager::Get()->RegisterEventSink(cbEVT_DEBUGGER_PAUSED, functor);
//Manager::Get()->RegisterEventSink(cbEVT_DEBUGGER_FINISHED, functor);
Manager::Get()->RegisterEventSink(cbEVT_COMPILER_FINISHED, functor);
}
void CBalert::OnRelease(bool appShutDown)
{
// do de-initialization for your plugin
// if appShutDown is true, the plugin is unloaded because Code::Blocks is being shut down,
// which means you must not use any of the SDK Managers
// NOTE: after this function, the inherited member variable
// m_IsAttached will be FALSE...
// Note: on release codeblocks automatically unsubscribes to events
}