Examples?
You've mentioned the KeyBinder plugin, but I don't see changes in it.
I found such codes in KeyBinder
// ----------------------------------------------------------------------------
void cbKeyBinder::OnWindowCreateEvent(wxEvent& event)
// ----------------------------------------------------------------------------
{
// wxEVT_CREATE entry
// Have to do this for split windows since CodeBlocks does not have
// events when opening/closing split windows
// Attach a split window (or any other window)
if ( m_bBound )
{
wxWindow* pWindow = (wxWindow*)(event.GetEventObject());
cbEditor* ed = 0;
//cbStyledTextCtrl* p_cbStyledTextCtrl = 0;
//cbStyledTextCtrl* pLeftSplitWin = 0;
cbStyledTextCtrl* pRightSplitWin = 0;
ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();
if (ed)
{ //p_cbStyledTextCtrl = ed->GetControl();
//pLeftSplitWin = ed->GetLeftSplitViewControl();
pRightSplitWin = ed->GetRightSplitViewControl();
//Has this window been split?
//**This is a temporary hack until some cbEvents are defined**
if ( pWindow && (pRightSplitWin == 0) )
{
//-if (pRightSplitWin eq pWindow)
//-{ Attach(pRightSplitWin);
if (pWindow->GetParent() == ed)
{ LOGIT( _T("OnWindowCreateEvent Attaching:%p"), pWindow );
AttachEditor(pWindow);
}
}
}
}//if m_bBound...
event.Skip();
}//OnWindowCreateEvent
Although The plugin can find the split window in such way, the window relationship has not been built yet in such event.
That means the plugin can not find this window by Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor()->GetRightSplitViewControl()
What's more, the window's parent is going to be changed to a wxSplitterWindow after the window was created. In my cbVike plugin, It's important to get this wxSplitterWindow, but there is no way to do this without the split and unsplit event. You can refer to
https://github.com/zmj64351508/cbvike . It's very similar to keyBinder in structure.
Edit: Another example is if the plugin want to do something like change the caret style in WindowCreateEvent, it may crash the app because the wxScintilla is not initialized when this event occurs.