Patch #3290 2012-05-12 21:11

mistar

Added new event cbEVT_EDITOR_OPENED
Download
3290-Added_new_even.patch (2.1 KB)
Category
Application::FeatureAdd
Status
Out of date
Close date
2012-10-12 11:21
Assigned to
mortenmacfly
Index: src/sdk/sdk_events.cpp
===================================================================
--- src/sdk/sdk_events.cpp    (revision 7965)
+++ src/sdk/sdk_events.cpp    (working copy)
@@ -77,6 +77,7 @@
 // editor events
 const wxEventType cbEVT_EDITOR_CLOSE = wxNewEventType();
 const wxEventType cbEVT_EDITOR_OPEN = wxNewEventType();
+const wxEventType cbEVT_EDITOR_OPENED = wxNewEventType();
 const wxEventType cbEVT_EDITOR_SWITCHED = wxNewEventType();
 const wxEventType cbEVT_EDITOR_ACTIVATED = wxNewEventType();
 const wxEventType cbEVT_EDITOR_DEACTIVATED = wxNewEventType();
Index: src/sdk/editormanager.cpp
===================================================================
--- src/sdk/editormanager.cpp    (revision 7965)
+++ src/sdk/editormanager.cpp    (working copy)
@@ -543,7 +543,12 @@
             ed->SetProjectFile(data,true);
     }
 
-
+    if (!eb)
+    {
+        CodeBlocksEvent evt(cbEVT_EDITOR_OPENED, -1, 0, ed);
+        Manager::Get()->GetPluginManager()->NotifyPlugins(evt);
+    }
+    
     // we 're done
     s_CanShutdown = true;
 
Index: src/include/sdk_events.h
===================================================================
--- src/include/sdk_events.h    (revision 7965)
+++ src/include/sdk_events.h    (working copy)
@@ -230,6 +230,8 @@
 #define EVT_EDITOR_CLOSE(fn) DECLARE_EVENT_TABLE_ENTRY( cbEVT_EDITOR_CLOSE, -1, -1, (wxObjectEventFunction)(wxEventFunction)(CodeBlocksEventFunction)&fn, (wxObject *) NULL ),
 extern EVTIMPORT const wxEventType cbEVT_EDITOR_OPEN;
 #define EVT_EDITOR_OPEN(fn) DECLARE_EVENT_TABLE_ENTRY( cbEVT_EDITOR_OPEN, -1, -1, (wxObjectEventFunction)(wxEventFunction)(CodeBlocksEventFunction)&fn, (wxObject *) NULL ),
+extern EVTIMPORT const wxEventType cbEVT_EDITOR_OPENED;
+#define EVT_EDITOR_OPENED(fn) DECLARE_EVENT_TABLE_ENTRY( cbEVT_EDITOR_OPENED, -1, -1, (wxObjectEventFunction)(wxEventFunction)(CodeBlocksEventFunction)&fn, (wxObject *) NULL ),
 extern EVTIMPORT const wxEventType cbEVT_EDITOR_SWITCHED;
 #define EVT_EDITOR_SWITCHED(fn) DECLARE_EVENT_TABLE_ENTRY( cbEVT_EDITOR_SWITCHED, -1, -1, (wxObjectEventFunction)(wxEventFunction)(CodeBlocksEventFunction)&fn, (wxObject *) NULL ),
 extern EVTIMPORT const wxEventType cbEVT_EDITOR_ACTIVATED;
mortenmacfly 2012-05-13 10:09

Looks good so far... will try

mortenmacfly 2012-05-15 06:56
mortenmacfly 2012-10-12 08:51

...any feedback on this? Still needed / obsolete?

mistar 2012-10-12 10:52

Obsolete, I use cbEVT_EDITOR_ACTIVATED as discussed at C::B forum